Error while optimization simulink

1 次查看(过去 30 天)
I am running an Ant Lion Optimization.
I have called the ITAE function in my simulink model.
I am facing such error while the simulation
Solver was unable to reduce the step size without violating minimum step size of 2.0123E-13
for 1 consecutive times at time 56.6413. Solver will continue simulation with the step size restricted
to 2.0123E-13 and using an effective relative error tolerance of 0.135505, which is greater than the
specified relative error tolerance of 0.1. This usually may be caused by the high stiffness of the
system. Please check the system or increase the solver Number of consecutive min steps violation
parameter.

回答(1 个)

Walter Roberson
Walter Roberson 2022-3-13
Ant Lion Optimization uses random numbers. Unless you set the random number seed to be the same before every time you start the Ant Lion optimization, then the search is non-deterministic.
When Simulink is operating in continuous time, it needs all calculations to be deterministic, because it is operating Ordinary Differential Equation solvers in order to determine what the proper combinations of values are that will satisfy the mathematics of all of the blocks.
Consider for example, if you are working in continuous time, and you have the blocks
------
| |
[constant 1]-----+ |
| plus|-----+---- [scope]
+---+ | |
| | | |
| ------- |
| |
+---------------+
That is, add 1 to the value each time through.
But this is continuous time: there is no elapsed time between the lower input and the output. The same value has to be satisfy the conditions simultaneously -- the lower signal needs to be carrying a value such that the value and (value plus 1) are the same value. No finite value can satisfy that condition... so Simulink has to figure out that the value on the signal must be -inf or +inf, both of which satisfy (value) == (value + 1) mathematically.
The only way that Simulink can make these kinds of calculations to satisfy all of the blocks simultaneously, is if the blocks have continuous derivatives -- the blocks must give consistent values. Which cannot happen for processes that use random numbers.
So... you have two choices:
  1. You can give up on using Ant Lion optimization from Simulink; OR
  2. You can switch to discrete time instead of continuous time, and make sure that your diagram includes delays in the feedback.
Discrete time blocks do not need to be consistent in their output.
In my opinion, in most cases, the better of the two choices is often the first, to give up on using randomizing processes. However, it might be reasonable to use such a process if each step is a system responsible for responding to an input signal that is changing in time, with the system using a heuristic to find a best response.

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by