Main Content

Auto scale absolute tolerance

Option to scale absolute tolerance based on state values

Model Configuration Pane: Solver


Choose whether to use a fixed tolerance value for all states throughout the simulation or to scale the absolute tolerance value for each state based on the state value.


To enable this parameter:

  • Set the solver Type to Variable-step.

  • From the Solver list, select an option other than discrete (no continuous states).

  • Specify the Absolute tolerance parameter as a positive scalar number.


on (default) | off

When you enable absolute tolerance scaling, as the simulation progresses, the absolute tolerance for each state is scaled to the maximum value that state has reached up to the current time step times the relative tolerance.

abstol = xmax * reltol

For example, if a state reaches a value of 1 during the simulation, the relative tolerance is 1e-4, and the absolute tolerance value is auto, then the absolute tolerance is initialized to 1e-7 and reaches a value of 1e-4 by the end of the simulation.

Recommended Settings

The table summarizes recommended values for this parameter based on considerations related to code generation.

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: AutoScaleAbsTol
Type: string | character vector
Value:'on' | 'off'
Default: 'on'

Version History

Introduced in R2018a