"Unable to reduce step size"-error occurs when a scope is connected to specific outputs.

10 Ansichten (letzte 30 Tage)
My simulation works but when I try to observe certain states in my simulation using scopes, an error occurs: "An error occurred while running the simulation and the simulation was terminated Caused by: Unable to reduce the step size without violating a minimum step size of 1.43102346483262E-21 at time 4.0279729643616539E-7 for model 'modelname'". Solver is ode23t, relative tolerance is 1e-3, absolute tolerance is set to 'auto'. This is strange because if I remove the scope again, the simulation will not crash.. How is this error possible?
  1 Kommentar
Fred
Fred am 27 Apr. 2017
Well turns out it helped to plug a memory block between the scope and the state it is supposed to log. I still do not know why this happened.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jyotish Robin
Jyotish Robin am 14 Mär. 2017
Hi Fred!
This error can happen when the solver is unable to solve the equations within the step-size provided.
One of the recommended ways to resolve this error is to increase the number of consecutive minimum steps the model is taking. This value can be modified by expanding the ' Additional options' section in solver section of the configuration parameters.
In this section, you should see a dialog box with the title ' Number of consecutive min steps:' next to it. Increase the value in this box.
You can also try to relax all the tolerances in the model from the Model Configuration Parameters.
Hope it helps!
  2 Kommentare
Fred
Fred am 16 Mär. 2017
Bearbeitet: Fred am 16 Mär. 2017
Thank you for your comprehensive answer that showed me that I did not explain my problem clearly. The point is: I have a simulation file with said solver settings. It already has some scopes attached to signals. NOW when I start simulating, it will not crash. If after that, I connect a scope to another signal (that existed before! It has been calculated in the run that did NOT crash), I get the error I told about. How is this possible? Randomly getting simulation errors after just adding in a single scope?
Tony Castillo
Tony Castillo am 15 Jan. 2020
Hi Fred,
I have been having a warning not an error like you explained in this blog, nonetheless, I have overcome it, just increasing my 'Number of consecutive min steps: from 1 to 3', and also I have changed to 'Robust' the Solver reset method. I can notice the simulation takes maybe 3 more times than before, but it is entirely executed without any warning. Even though I was diving into Matlab help, I could not find anything where it is explained in detail, so I wonder, how the increase of 'Number of consecutive min steps might affect if does to the accuracy of the simulation?.
I would like to receive an answer so as to clarify my doubts about that subject.
Best regards,

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Event Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by