Solver error during simulation in matlab simulink R2023a

12 Ansichten (letzte 30 Tage)
KODJOVI SENAM BORIS AHIANDIPE
Kommentiert: Daniel am 8 Sep. 2023
Hello, I'm running my simulation, and I'm uncountering this error in matlab during the simulation.
To solve this I tried to increase the solver number of consecutive min steps violation paramerter to 4 (it was originally 1), but still I'm facing the same error. And I've noticed my simulation is giving weird response at the time where the error pops up.
Please I need you guidance . Thanks

Antworten (1)

Daniel
Daniel am 7 Sep. 2023
Bearbeitet: Daniel am 7 Sep. 2023
It's going to be hard to answer this without a little more information, so if you can upload the model that might help.
That said, the general principle here is that your model conditions are changing extremely quickly. Whatever solver you're running is an variable-step solver, and it's controlling the step size to minimize error. These solvers all compare multiple numerical methods to each other for the same starting conditions, and if they don't converge on a solution the solver will reduce the step size down to a certain minimum.
If the numerical methods aren't converging for a step size of 1e-13, there is likely something very strange happening at t=33. Perhaps you're generating a random number which is different every time any solver is invoked (though we take steps to prevent this when using our own random number sources in Simulink), or there's some other input to your model with very erratic, nonrepeatable behavior, which turns on at t=33. So, without seeing the system, my advice would be to see whether any condition changes at t=33, and if any of the inputs at that time step look erratic or nondeterministic. You should be able to attach scopes to any point in the model and see their behavior up to the simulation halt time of t=33.
Also, the suggested actions include opening the Solver Profiler. Have you tried that? Did it give any more information on the issue?
  2 Kommentare
KODJOVI SENAM BORIS AHIANDIPE
Bearbeitet: KODJOVI SENAM BORIS AHIANDIPE am 8 Sep. 2023
The problem seems not to be there when I change to fixed time step, the issue is it takes more time than variable time-step.
Daniel
Daniel am 8 Sep. 2023
@KODJOVI SENAM BORIS AHIANDIPE I'm surprised fixed step would take more time than variable step. You're probably using a small step size in comparison to what the variable-step solver is doing.
What's your fundamental sample time for the fixed-step run? (Access the model configuration parameters by clicking the gear under the Modeling tab in the ribbon, then go to the Solver pane, expand the Solver details, and you'll see it.)
What's the duration of the simulation?
What is the average step size for the variable-step solver? (Go to the Debug tab in the ribbon, look at the Performance pane, click the drop-down under Performance Advisor, select Solver Profiler, and run the model. Statistics on step size will be on the left side.)
If you wouldn't mind posting a screenshot of the Step Size pane from the Solver Profiler after running the model, that might help as well.
Also, is your variable step simulation completing? What you show in the screenshot is technically a warning, not an error, so ignoring it is a perfectly acceptable option if you're happy with the results. If you want to get rid of the warning anyway, there are a few options you can fiddle with besides changing the number of consecutive min steps, but it might be a little easier to figure out what changes will work well if you look at the Step Size plot in the Solver Profiler first.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Configure Simulation Conditions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by