Type
Description
Select the type of solver you want to use to simulate your model.
Category: Solver
Settings
Default:
Variable-step
Variable-step
Step size varies from step to step, depending on model dynamics. A variable-step solver:
Reduces step size when model states change rapidly, to maintain accuracy.
Increases step size when model states change slowly, to avoid unnecessary steps.
Variable-step is recommended for models in which states change rapidly or that contain discontinuities. In these cases, a variable-step solver requires fewer time steps than a fixed-step solver to achieve a comparable level of accuracy. This can significantly shorten simulation time.
Fixed-step
Step size remains constant throughout the simulation. You require a fixed-step solver for code generation, unless you use an S-function or RSim target. Typically, lower order solvers are computationally less expensive than higher order solvers. However, they also provide less accuracy.
Note
The solver computes the next time as the sum of the current time and the step size.
Dependencies
Selecting Variable-step
enables the following
parameters:
Solver
Max step size
Min step size
Initial step size
Relative tolerance
Absolute tolerance
Shape preservation
Initial step size
Number of consecutive min steps
Zero-crossing control
Time tolerance
Algorithm
Selecting Fixed-step
enables the following
parameters:
Solver
Periodic sample time constraint
Fixed-step size (fundamental sample time)
Treat each discrete rate as a separate task
Higher priority value indicates higher task priority
Automatically handle rate transitions for data transfers
Programmatic Use
Parameter:
SolverType |
Value:
'Variable-step' |
'Fixed-step' |
Default:
'Variable-step' |