MATLAB: Simulink – simulation time slows WAY down and information omitted from scope

memory errorsimulinkslow simulation time

Hi,
This is likely a very basic question, but I have not been able to find an answer on my own yet. I have a very simple model (<10 substystems with basic functions, nothing fancier than an integrator) where the simulation time becomes really slow after I change an initial condition in a single integrator (from -65 to -30). This behavior also occurs if I remove the integrator completely. Additionally, if I let the simulation run, the scope omits the first 10 seconds of the simulation. I have tried various ODE solvers and played with the tolerance levels a bit. Could anyone help me understand why this is happening or point me toward a source of help?
Best,

Best Answer

Hi,
you are most likely changing the problem to be stiff as Kaustubha wrote, therefore try e.g. ode15s which should make larger steps
Regarding "loosing" data: the scope usually only stores the last 5000 data points. If the problem get's stiff, non stiff solvers like ode45 make very small steps, therefore 5000 steps may only be the very last part of your integration. Click in the scope on the very left button and uncheck the "limit number of data points".
Titus