This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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

Command-Line Information

Parameter: SolverType
Value: 'Variable-step' | 'Fixed-step'
Default: 'Variable-step'

Related Topics