Using Simulink    

Solvers

Simulink computes the current value of a block's continuous states by numerically integrating the state's derivatives. The numerical integration task is performed by a Simulink component called a solver. Simulink allows you to choose the solver that it uses to simulate a model. The solvers that Simulink provides fall into two classes: fixed-step solvers and variable-step solvers.

Fixed-Step Solvers

Fixed-step solvers divide the simulation timespan up into an integral number of fixed-size intervals called time steps. Then, starting from initial estimates, at each time step, a fixed-step solver computes the value of each of the system's state variables at the next time step from the variable's current value and the current value of its derivatives. The accuracy of the estimation depends on the step size, that is, the time between successive time steps. Generally, a smaller step size produces a more accurate simulation but results in a longer execution time because more steps are required to compute a system's states.

Variable Step Solvers

A variable step solver dynamically varies the step size to meet a specified level of precision. Such a solver expands the step size when the state variables are changing slowly (as indicated by the magnitude of the state derivatives) and decreases the step size when the state variables are changing rapidly. A variable step solver can, depending on the application, produce more accurate results without sacrificing execution speed.

Major Versus Minor Steps

Some solvers subdivide the simulation time span into major and minor steps, where a minor time step represents a subdivision of the major time step. The solver produces a result at each major time step. It use results at the minor time steps to improve the accuracy of the result at the major time step.


 Atomic Versus Virtual Subsystems Zero Crossing Detection