How can I increase simulation speed?

Problem description: 

My simulation appears to be running very slowly. How can I accelerate it?


There is no general solution to improve simulation speed. However, here is some advice:

1. If your system is stiff, i.e. the time constants in your circuits differ by many orders of magnitude, the simulation may advance very slowly when you use a standard ODE solver such as 'ode45' resp. 'DOPRI'. Change to a stiff solver such as 'ode15s', 'ode23tb' or 'RADAU'.

2. Avoid using discrete control blocks with very small sample times as your entire model will be evaluated at every discrete sample.

3. We generally discourage switching to a fixed-step solver to increase simulation speed, as the ability to control the accuracy of the simulation results is lost.