Specify the simulation start and stop time, and the solver configuration for the simulation. Use the Solver pane to set up a solver for a model's active configuration set.
A solver computes a dynamic system's states at successive time steps over a specified time span, using information provided by the model. Once the model compiles, the Solver Information tooltip displays
Compiled solver name
Step size (Max step size or Fixed step size)
Once the model compiles, the status bar displays the solver used for compiling and a carat (^) when:
Simulink^{®} selects a different solver during compilation.
You set the step size to auto
.
The Solver Information tooltip displays the step size that Simulink calculated.
Select a solver type from the Type list.
Select a solver from the Solver list.
Set the parameters displayed for the selected type and solver combination.
Apply the changes.
To open the Solver pane, in the Simulink Editor, select Simulation > Model Configuration Parameters > Solver.
Simulation time is not the same as clock time. For example, running a simulation for 10 seconds usually does not take 10 seconds. Total simulation time depends on factors such as model complexity, solver step sizes, and computer speed.
Fixedstep
solver type
is required for code generation, unless you use an Sfunction or RSim
target.
Variablestep
solver type
can significantly shorten the time required to simulate models in
which states change rapidly or which contain discontinuities.
Specify the start time for the simulation or generated code as a doubleprecision value, scaled to seconds.
Default: 0.0
A start time must be less than or equal to the stop time. For example, use a nonzero start time to delay the start of a simulation while running an initialization script.
The values of block parameters with initial conditions must match the initial condition settings at the specified start time.
Simulation time is not the same as clock time. For example, running a simulation for 10 seconds usually does not take 10 seconds. Total simulation time depends on factors such as model complexity, solver step sizes, and computer speed.
Parameter: StartTime 
Type: string 
Value: any valid value 
Default: '0.0' 
Specify the stop time for the simulation or generated code as a doubleprecision value, scaled to seconds.
Default: 10
Stop time must be greater than or equal to the start time.
Specify inf
to run a simulation
or generated program until you explicitly pause or stop it.
If the stop time is the same as the start time, the simulation or generated program runs for one step.
Simulation time is not the same as clock time. For example, running a simulation for 10 seconds usually does not take 10 seconds. Total simulation time depends on factors such as model complexity, solver step sizes, and computer speed.
If your model includes blocks that depend on absolute time and you are creating a design that runs indefinitely, see Blocks That Depend on Absolute Time.
Parameter: StopTime 
Type: string 
Value: any valid value 
Default: '10.0' 
Select the type of solver you want to use to simulate your model.
Default: Variablestep
Variablestep
Step size varies from step to step, depending on model dynamics. A variablestep solver:
Reduces step size when model states change rapidly, to maintain accuracy.
Increases step size when model states change slowly, to avoid unnecessary steps.
Variablestep is recommended for models in which states change rapidly or that contain discontinuities. In these cases, a variablestep solver requires fewer time steps than a fixedstep solver to achieve a comparable level of accuracy. This can significantly shorten simulation time.
Fixedstep
Step size remains constant throughout the simulation. You require a fixedstep solver for code generation, unless you use an Sfunction 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. 
Selecting Variablestep
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
Zerocrossing control
Time tolerance
Algorithm
Selecting Fixedstep
enables the
following parameters:
Solver
Periodic sample time constraint
Fixedstep size (fundamental sample time)
Tasking mode for periodic sample times
Higher priority value indicates higher task priority
Automatically handle rate transitions for data transfers
Parameter: SolverType 
Type: string 
Value: 'Variablestep'  'Fixedstep' 
Default: 'Variablestep' 
Select the solver you want to use to compute the states of the model during simulation or code generation.
Select from these types:
The default setting for new models is VariableStepAuto
.
Fixedstep Solvers. Default: FixedStepAuto
auto
Computes the state of the model using a fixedstep solver that
auto solver selects. At the time the model compiles, auto
changes
to a fixedstep solver that auto solver selects based on the model
dynamics. Click on the solver hyperlink in the lower right corner
of the model to accept or change this selection.
ode3 (BogackiShampine)
Computes the state of the model at the next time step as an
explicit function of the current value of the state and the state
derivatives, using the BogackiShampine Formula integration technique
to compute the state derivatives. In the following example, X
is
the state, DX
is the state derivative, and h
is
the step size:
X(n+1) = X(n) + h * DX(n)
Discrete (no continuous states)
Computes the time of the next time step by adding a fixed step size to the current time.
Use this solver for models with no states or discrete states only, using a fixed step size. Relies on the model's blocks to update discrete states.
The accuracy and length of time of the resulting simulation depends on the size of the steps taken by the simulation: the smaller the step size, the more accurate the results but the longer the simulation takes.
Note: The fixedstep discrete solver cannot be used to simulate models that have continuous states. 
ode8 (DormandPrince RK8(7))
Uses the eighthorder DormandPrince formula to compute the model state at the next time step as an explicit function of the current value of the state and the state derivatives approximated at intermediate points.
ode5 (DormandPrince)
Uses the fifthorder DormandPrince formula to compute the model state at the next time step as an explicit function of the current value of the state and the state derivatives approximated at intermediate points.
ode4 (RungeKutta)
Uses the fourthorder RungeKutta (RK4) formula to compute the model state at the next time step as an explicit function of the current value of the state and the state derivatives.
ode2 (Heun)
Uses the Heun integration method to compute the model state at the next time step as an explicit function of the current value of the state and the state derivatives.
ode1 (Euler)
Uses the Euler integration method to compute the model state at the next time step as an explicit function of the current value of the state and the state derivatives. This solver requires fewer computations than a higher order solver. However, it provides comparatively less accuracy.
ode14x (extrapolation)
Uses a combination of Newton's method and extrapolation from
the current value to compute the model's state at the next time step,
as an implicit function of the state and the
state derivative at the next time step. In the following example, X
is
the state, DX
is the state derivative, and h
is
the step size:
X(n+1)  X(n)  h * DX(n+1) = 0
This solver requires more computation per step than an explicit solver, but is more accurate for a given step size.
Variablestep Solvers. Default: VariableStepAuto
auto
Computes the state of the model using a variablestep solver
that auto solver selects. At the time the model compiles, auto
changes
to a variablestep solver that auto solver selects based on the model
dynamics. Click on the solver hyperlink in the lower right corner
of the model to accept or change this selection.
ode45 (DormandPrince)
Computes the model's state at the next time step using an explicit RungeKutta (4,5) formula (the DormandPrince pair) for numerical integration.
ode45
is a onestep solver, and therefore
only needs the solution at the preceding time point.
Use ode45
as a first try for most problems.
Discrete (no continuous states)
Computes the time of the next step by adding a step size that varies depending on the rate of change of the model's states.
Use this solver for models with no states or discrete states only, using a variable step size.
ode23 (BogackiShampine)
Computes the model's state at the next time step using an explicit RungeKutta (2,3) formula (the BogackiShampine pair) for numerical integration.
ode23
is a onestep solver, and therefore
only needs the solution at the preceding time point.
ode23
is more efficient than ode45
at
crude tolerances and in the presence of mild stiffness.
ode113 (Adams)
Computes the model's state at the next time step using a variableorder AdamsBashforthMoulton PECE numerical integration technique.
ode113
is a multistep solver, and thus generally
needs the solutions at several preceding time points to compute the
current solution.
ode113
can be more efficient than ode45
at
stringent tolerances.
ode15s (stiff/NDF)
Computes the model's state at the next time step using variableorder numerical differentiation formulas (NDFs). These are related to, but more efficient than the backward differentiation formulas (BDFs), also known as Gear's method.
ode15s
is a multistep solver, and thus generally
needs the solutions at several preceding time points to compute the
current solution.
ode15s
is efficient for stiff problems. Try
this solver if ode45
fails or is inefficient.
ode23s (stiff/Mod. Rosenbrock)
Computes the model's state at the next time step using a modified Rosenbrock formula of order 2.
ode23s
is a onestep solver, and therefore
only needs the solution at the preceding time point.
ode23s
is more efficient than ode15s
at
crude tolerances, and can solve stiff problems for which ode15s
is
ineffective.
ode23t (Mod. stiff/Trapezoidal)
Computes the model's state at the next time step using an implementation of the trapezoidal rule with a "free" interpolant.
ode23t
is a onestep solver, and therefore
only needs the solution at the preceding time point.
Use ode23t
if the problem is only moderately
stiff and you need a solution with no numerical damping.
ode23tb (stiff/TRBDF2)
Computes the model's state at the next time step using a multistep implementation of TRBDF2, an implicit RungeKutta formula with a trapezoidal rule first stage, and a second stage consisting of a backward differentiation formula of order two. By construction, the same iteration matrix is used in evaluating both stages.
ode23tb
is more efficient than ode15s
at
crude tolerances, and can solve stiff problems for which ode15s
is
ineffective.
Identifying the optimal solver for a model requires experimentation. For an indepth discussion, see Solvers.
The optimal solver balances acceptable accuracy with the shortest simulation time.
Simulink software uses a discrete solver for any model with no states or discrete states only, even if you specify a continuous solver.
A smaller step size increases accuracy, but also increases simulation time.
The degree of computational complexity increases for ode
n
,
as n
increases.
As computational complexity increases, the accuracy of the results also increases.
Selecting the ode1 (Euler)
, ode2
(Huen)
, ode 3 (BogackiShampine)
, ode4
(RungeKutta)
, ode 5 (DormandPrince)
,
or Discrete (no continuous states)
fixedstep
solvers enables the following parameters:
Fixedstep size (fundamental sample time)
Periodic sample time constraint
Tasking mode for periodic sample times
Automatically handle rate transition for data transfers
Higher priority value indicates higher task priority
Selecting ode14x (extrapolation)
enables
the following parameters:
Fixedstep size (fundamental sample time)
Extrapolation order
Number Newton's iterations
Periodic sample time constraint
Tasking mode for periodic sample times
Automatically handle rate transition for data transfers
Higher priority value indicates higher task priority
Selecting the Discrete (no continuous states)
variablestep
solver enables the following parameters:
Max step size
Automatically handle rate transition for data transfers
Higher priority value indicates higher task priority
Zerocrossing control
Time tolerance
Number of consecutive zero crossings
Algorithm
Selecting ode45 (DormandPrince)
, ode23
(BogackiShampine)
, ode113 (Adams)
,
or ode23s (stiff/Mod. Rosenbrock)
enables
the following parameters:
Max step size
Min step size
Initial step size
Relative tolerance
Absolute tolerance
Shape preservation
Number of consecutive min steps
Automatically handle rate transition for data transfers
Higher priority value indicates higher task priority
Zerocrossing control
Time tolerance
Number of consecutive zero crossings
Algorithm
Selecting ode15s (stiff/NDF)
, ode23t
(Mod. stiff/Trapezoidal
)
,
or ode23tb (stiff/TRBDF2)
enables the
following parameters:
Max step size
Min step size
Initial step size
Solver reset method
Number of consecutive min steps
Relative tolerance
Absolute tolerance
Shape preservation
Maximum order
Automatically handle rate transition for data transfers
Higher priority value indicates higher task priority
Zerocrossing control
Time tolerance
Number of consecutive zero crossings
Algorithm
Parameter: Solver 
Type: string 
Value: 'VariableStepAuto'
 'VariableStepDiscrete'  'ode45'  'ode23'  'ode113'  'ode15s'
 'ode23s'  'ode23t'  'ode23tb'  'FixedStepAuto'  'FixedStepDiscrete'
'ode8' 'ode5'  'ode4'  'ode3'  'ode2'  'ode1'  'ode14x' 
Default: 'ode45' 
Specify the largest time step that the solver can take.
Default: auto
For the discrete solver, the default value (auto
)
is the model's shortest sample time.
For continuous solvers, the default value (auto
)
is determined from the start and stop times. If the stop time equals
the start time or is inf
, Simulink chooses 0.2
seconds
as the maximum step size. Otherwise, it sets the maximum step size
to
$${h}_{\mathrm{max}}=\frac{{t}_{stop}{t}_{start}}{50}$$
For Sine and Signal Generator source blocks, Simulink calculates the max step size using this heuristic:
where $$Fre{q}_{\mathrm{max}}$$ is the maximum frequency (Hz) of these blocks in the model.
Generally, the default maximum step size is sufficient. If you are concerned about the solver missing significant behavior, change the parameter to prevent the solver from taking too large a step.
Max step size determines the step size of the variablestep solver.
If the time span of the simulation is very long, the default step size might be too large for the solver to find the solution.
If your model contains periodic or nearly periodic behavior and you know the period, set the maximum step size to some fraction (such as 1/4) of that period.
In general, for more output points, change the refine factor, not the maximum step size.
This parameter is enabled only if the solver Type is
set to Variablestep
.
Parameter: MaxStep 
Type: string 
Value: any valid value 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the size of the first time step that the solver takes.
Default: auto
By default, the solver selects an initial step size by examining the derivatives of the states at the start time.
Be careful when increasing the initial step size. If the first step size is too large, the solver might step over important behavior.
The initial step size parameter is a suggested first step size. The solver tries this step size but reduces it if error criteria are not satisfied.
This parameter is enabled only if the solver Type is
set to Variablestep
.
Parameter: InitialStep 
Type: string 
Value: any valid value 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the smallest time step that the solver can take.
Default: auto
The default value (auto
) sets
an unlimited number of warnings and a minimum step size on the order
of machine precision.
You can specify either a real number greater than zero, or a twoelement vector for which the first element is the minimum step size and the second element is the maximum number of minimum step size warnings before an error was issued.
If the solver takes a smaller step to meet error tolerances, it issues a warning indicating the current effective relative tolerance.
Setting the second element to zero results in an error
the first time the solver must take a step smaller than the specified
minimum. This is equivalent to changing the Min step size
violation diagnostic to error
on the Diagnostics pane (see Min step size violation).
Setting the second element to 1 results in an unlimited number of warnings. This is also the default if the input is a scalar.
Min step size determines the step size of the variable step ODE solver. The size is limited by the smallest discrete sample time in the model.
This parameter is enabled only if the solver Type is
set to Variablestep
.
Parameter: MinStep 
Type: string 
Value: any valid value 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the largest acceptable solver error, relative to the size of each state during each time step. If the relative error exceeds this tolerance, the solver reduces the time step size.
Default: 1e3
Setting the relative tolerance to auto
is
actually the default value of 1e3
.
The relative tolerance is a percentage of the state's value.
The default value (1e3
) means
that the computed state is accurate to within 0.1%.
The acceptable error at each time step is a function of both the Relative tolerance and the Absolute tolerance. For more information about how these settings work together, see Error Tolerances for VariableStep Solvers.
During each time step, the solver computes the state values at the end of the step and also determines the local error – the estimated error of these state values. If the error is greater than the acceptable error for any state, the solver reduces the step size and tries again.
The default relative tolerance value is sufficient for most applications. Decreasing the relative tolerance value can slow down the simulation.
To check the accuracy of a simulation after you run it, you can reduce the relative tolerance to 1e4 and run it again. If the results of the two simulations are not significantly different, you can feel confident that the solution has converged.
This parameter is enabled only if you set:
Solver Type to Variablestep
.
Solver to a continuous variablestep solver.
This parameter works along with Absolute tolerance to determine the acceptable error at each time step. For more information about how these settings work together, see Error Tolerances for VariableStep Solvers.
Parameter: RelTol 
Type: string 
Value: any valid value 
Default: '1e3' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the largest acceptable solver error, as the value of the measured state approaches zero. If the absolute error exceeds this tolerance, the solver reduces the time step size.
Default: auto
The default value (auto
) initially
sets the absolute tolerance for each state to 1e6. As the simulation
progresses, the absolute tolerance for each state is reset to the
maximum value that the state has thus far assumed times the relative
tolerance for that state.
For example, if a state goes from 0 to 1 and the Relative tolerance is 1e3, then by the end of the simulation, the Absolute tolerance is set to 1e3.
If the computed setting is not suitable, you can determine an appropriate setting yourself.
The acceptable error at each time step is a function of both the Relative tolerance and the Absolute tolerance. For more information about how these settings work together, see Error Tolerances for VariableStep Solvers.
The Integrator, SecondOrder Integrator, Variable Transport Delay, Transfer Fcn, StateSpace, and ZeroPole blocks allow you to specify absolute tolerance values for solving the model states that they compute or that determine their output. The absolute tolerance values that you specify in these blocks override the global setting in the Configuration Parameters dialog box.
You might want to override the Absolute tolerance setting using blocks if the global setting does not provide sufficient error control for all of your model states, for example, if they vary widely in magnitude.
If you set the Absolute tolerance too low, the solver might take too many steps around nearzero state values, and thus slow the simulation.
To check the accuracy of a simulation after you run it, you can reduce the absolute tolerance and run it again. If the results of the two simulations are not significantly different, you can feel confident that the solution has converged.
If your simulation results do not seem accurate, and your model has states whose values approach zero, the Absolute tolerance may be too large. Reduce the Absolute tolerance to force the simulation to take more steps around areas of nearzero state values.
This parameter is enabled only if you set:
Solver Type to Variablestep
.
Solver to a continuous variablestep solver.
This parameter works along with Relative tolerance to determine the acceptable error at each time step. For more information about how these settings work together, see Error Tolerances for VariableStep Solvers.
Parameter: AbsTol 
Type: string  numeric value 
Value: 'auto' 
positive real scalar 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
At each time step use derivative information to improve integration accuracy.
Default: Disable
all
Disable all
Do not perform Shape preservation on any signals.
Enable all
Perform Shape preservation on all signals.
The default setting (Disable all) usually provides good accuracy for most models.
Setting to Enable all
will
increase accuracy in those models having signals whose derivative
exhibits a high rate of change, but simulation time may be increased.
This parameter is enabled only if you use a continuousstep solver.
Parameter: ShapePreserveControl 
Type: string 
Value: 'EnableAll  'DisableAll 
Default: 'DisableAll 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Select the order of the numerical differentiation formulas (NDFs)
used in the ode15s
solver.
Default: 5
5
Specifies that the solver uses fifth order NDFs.
1
Specifies that the solver uses first order NDFs.
2
Specifies that the solver uses second order NDFs.
3
Specifies that the solver uses third order NDFs.
4
Specifies that the solver uses fourth order NDFs.
Although the higher order formulas are more accurate, they are less stable.
If your model is stiff and requires more stability, reduce the maximum order to 2 (the highest order for which the NDF formula is Astable).
As an alternative, you can try using the ode23s
solver,
which is a lower order (and Astable) solver.
This parameter is enabled only if Solver is
set to ode15s
.
Parameter: MaxOrder 
Type: integer 
Value: 1  2  3  4  5 
Default: 5 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Select how the solver behaves during a reset, such as when it detects a zero crossing.
Default: Fast
Fast
Specifies that the solver will not recompute the Jacobian matrix at a solver reset.
Robust
Specifies that the solver will recompute the Jacobian matrix needed by the integration step at every solver reset.
Selecting Fast
speeds up
the simulation. However, it can result in incorrect solutions in some
cases.
If you suspect that the simulation is giving incorrect
results, try the Robust
setting. If there
is no difference in simulation results between the fast and robust
settings, revert to the fast setting.
This parameter is enabled only if you select one of the following solvers:
ode15s (Stiff/NDF)
ode23t (Mod. Stiff/Trapezoidal)
ode23tb (Stiff/TRBDF2)
Parameter: SolverResetMethod 
Type: string 
Value: 'Fast'  'Robust' 
Default: 'Fast' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the maximum number of consecutive minimum step size violations allowed during simulation.
Default: 1
A minimum step size violation occurs when a variablestep continuous solver takes a smaller step than that specified by the Min step size property (see Min step size).
Simulink software counts the number of consecutive violations that it detects. If the count exceeds the value of Number of consecutive min steps, Simulink software displays either a warning or error message as specified by the Min step size violation diagnostic (see Min step size violation).
This parameter is enabled only if you set:
Solver Type to Variablestep
.
Solver to a continuous variable step solver.
Parameter: MaxConsecutiveMinStep 
Type: string 
Value: any valid value 
Default: '1' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Default: Auto
auto
Sparse perturbation
Full perturbation
Sparse analytical
Full analytical
The default setting (Auto
)
usually provides good accuracy for most models.
This parameter is enabled only if an implicit solver is used.
Parameter: SolverJacobianMethodControl 
Type: string 
Value: 'auto'  'SparsePerturbation' 'FullPerturbation'  'SparseAnalytical' 'FullAnalytical' 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Select how blocks with periodic sample times execute.
Default: Auto
Auto
Specifies that singletasking execution is used if:
Your model contains one sample time.
Your model contains a continuous and a discrete sample time, and the fixedstep size is equal to the discrete sample time.
Selects multitasking execution for models operating at different sample rates.
SingleTasking
Specifies that all blocks are processed through each stage of simulation together (for example, calculating output and updating discrete states).
MultiTasking
Specifies that groups of blocks with the same execution priority are processed through each stage of simulation (for example, calculating output and updating discrete states) based on task priority. Multitasking mode helps to create valid models of realworld multitasking systems, where sections of your model represent concurrent tasks.
For multirate models, Simulink treats an Auto
setting
as a MultiTasking
setting.
A model that is multirate and uses multitasking (that
is, uses a setting of Auto
or MultiTasking
)
cannot reference a multirate model that uses a SingleTasking
setting.
The Single task rate transition and Multitask rate transition parameters on the Diagnostics > Sample Time pane allow you to adjust error checking for sample rate transitions between blocks that operate at different sample rates.
This parameter is enabled by selecting Fixedstep
solver
type.
Parameter: SolverMode 
Type: string 
Value: 'Auto'  'SingleTasking'  'MultiTasking' 
Default: 'Auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify whether Simulink software automatically inserts hidden Rate Transition blocks between blocks that have different sample rates to ensure: the integrity of data transfers between tasks; and optional determinism of data transfers for periodic tasks.
Default: Off
Inserts hidden Rate Transition blocks between blocks when rate transitions are detected. Handles rate transitions for asynchronous and periodic tasks. Simulink software adds the hidden blocks configured to ensure data integrity for data transfers. Selecting this option also enables the parameter Deterministic data transfer, which allows you to control the level of data transfer determinism for periodic tasks.
Does not insert hidden Rate Transition blocks when rate transitions are detected. If Simulink software detects invalid transitions, you must adjust the model such that the sample rates for the blocks in question match or manually add a Rate Transition block.
See Rate Transition Block Options in the Simulink Coder™ documentation for further details.
Selecting this parameter allows you to handle rate transition issues automatically. This saves you from having to manually insert Rate Transition blocks to avoid invalid rate transitions, including invalid asynchronoustoperiodic and asynchronoustoasynchronous rate transitions, in multirate models.
For asynchronous tasks, Simulink software configures the inserted blocks to ensure data integrity but not determinism during data transfers.
Parameter: AutoInsertRateTranBlk 
Type: string 
Value: 'on'  'off' 
Default: 'off' 
Application  Setting 

Debugging  No impact 
Traceability  No impact
for simulation or during development Off for production code generation 
Efficiency  No impact 
Safety precaution  No recommendation 
Control whether the Rate Transition block parameter Ensure deterministic data transfer (maximum delay) is set for autoinserted Rate Transition blocks
Default: Whenever
possible
Always
Specifies that the block parameter Ensure deterministic data transfer (maximum delay) is always set for autoinserted Rate Transition blocks.
If Always
is selected and if a model
needs to autoinsert a Rate Transition block to handle a rate transition
that is not between two periodic sample times
related by an integer multiple, Simulink errors out.
Whenever possible
Specifies that the block parameter Ensure deterministic data transfer (maximum delay) is set for autoinserted Rate Transition blocks whenever possible. If an autoinserted Rate Transition block handles data transfer between two periodic sample times that are related by an integer multiple, Ensure deterministic data transfer (maximum delay) is set; otherwise, it is cleared.
Never (minimum delay)
Specifies that the block parameter Ensure deterministic data transfer (maximum delay) is never set for autoinserted Rate Transition blocks.
Note: Clearing the Rate Transition block parameter Ensure deterministic data transfer (maximum delay) can provide reduced latency for models that do not require determinism. See the description of Ensure deterministic data transfer (maximum delay) on the Rate Transition block reference page for more information. 
This parameter is enabled only if Automatically handle rate transition for data transfer is checked.
Parameter: InsertRTBMode 
Type: string 
Value: 'Always'  'Whenever
possible'  'Never (minimum delay)' 
Default: 'Whenever
possible' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No recommendation 
Specify whether the realtime system targeted by the model assigns higher or lower priority values to higher priority tasks when implementing asynchronous data transfers
Default: Off
Realtime system assigns higher priority values to higher priority tasks, for example, 8 has a higher task priority than 4. Rate Transition blocks treat asynchronous transitions between rates with lower priority values and rates with higher priority values as lowtohigh rate transitions.
Realtime system assigns lower priority values to higher priority tasks, for example, 4 has a higher task priority than 8. Rate Transition blocks treat asynchronous transitions between rates with lower priority values and rates with higher priority values as hightolow rate transitions.
Parameter: PositivePriorityOrder 
Type: string 
Value: 'on'  'off' 
Default: 'off' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Enables zerocrossing detection during variablestep simulation of the model. For most models, this speeds up simulation by enabling the solver to take larger time steps.
Default: Use local
settings
Use local settings
Specifies that zerocrossing detection be enabled on a blockbyblock basis. For a list of applicable blocks, see Simulation Phases in Dynamic Systems
To specify zerocrossing detection for one of these blocks, open the block's parameter dialog box and select the Enable zerocrossing detection option.
Enable all
Enables zerocrossing detection for all blocks in the model.
Disable all
Disables zerocrossing detection for all blocks in the model.
For most models, enabling zerocrossing detection speeds up simulation by allowing the solver to take larger time steps.
If a model has extreme dynamic changes, disabling this option can speed up the simulation but can also decrease the accuracy of simulation results. SeeZeroCrossing Detection for more information.
Selecting Enable all
or Disable
all
overrides the local zerocrossing detection setting
for individual blocks.
This parameter is enabled only if the solver Type is
set to Variablestep
.
Selecting either Use local settings
or Enable
all
enables the following parameters:
Time tolerance
Number of consecutive zero crossings
Algorithm
Parameter: ZeroCrossControl 
Type: string 
Value: 'UseLocalSettings'  'EnableAll'  'DisableAll' 
Default: 'UseLocalSettings' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify a tolerance factor that controls how closely zerocrossing events must occur to be considered consecutive.
Default: 10*128*eps
Simulink software defines zero crossings as consecutive if the time between events is less than a particular interval. The following figure depicts a simulation timeline during which Simulink software detects zero crossings ZC_{1} and ZC_{2}, bracketed at successive time steps t_{1} and t_{2}.
Simulink software determines that the zero crossings are consecutive if
dt < RelTolZC * t_{2}
where dt
is the time between zero crossings
and RelTolZC
is the Time tolerance.
Simulink software counts the number of consecutive zero crossings that it detects. If the count exceeds the value of Number of consecutive zero crossings allowed, Simulink software displays either a warning or error as specified by the Consecutive zerocrossings violation diagnostic (see Consecutive zerocrossings violation).
Simulink software resets the counter each time it detects nonconsecutive zero crossings (successive zero crossings that fail to meet the relative tolerance setting); therefore, decreasing the relative tolerance value may afford your model's behavior more time to recover.
If your model experiences excessive zero crossings, you can also increase the Number of consecutive zero crossings to increase the threshold at which Simulink software triggers the Consecutive zerocrossings violation diagnostic.
This parameter is enabled only if Zerocrossing control is
set to either Use local settings
or Enable
all
.
Parameter: ConsecutiveZCsStepRelTol 
Type: string 
Value: any valid value 
Default: '10*128*eps' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the number of consecutive zero crossings that can occur before Simulink software displays a warning or an error.
Default: 1000
Simulink software counts the number of consecutive zero crossings that it detects. If the count exceeds the specified value, Simulink software displays either a warning or an error as specified by the Consecutive zerocrossings violation diagnostic (see Consecutive zerocrossings violation).
Simulink software defines zero crossings as consecutive if the time between events is less than a particular interval (see Time tolerance).
If your model experiences excessive zero crossings, you can increase this parameter to increase the threshold at which Simulink software triggers the Consecutive zerocrossings violation diagnostic. This may afford your model's behavior more time to recover.
Simulink software resets the counter each time it detects nonconsecutive zero crossings; therefore, decreasing the relative tolerance value may also afford your model's behavior more time to recover.
This parameter is enabled only if Zerocrossing control is
set to either Use local settings
or Enable
all
.
Parameter: MaxConsecutiveZCs 
Type: string 
Value: any valid value 
Default: '1000' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specifies the algorithm to detect zero crossings when a variablestep solver is used.
Default: Nonadaptive
Adaptive
Use an improved zerocrossing algorithm which dynamically activates and deactivates zerocrossing bracketing. With this algorithm you can set a zerocrossing tolerance. See Signal threshold to learn how to set the zerocrossing tolerance.
Nonadaptive
Use the nonadaptive zerocrossing algorithm present in the Simulink software prior to Version 7.0 (R2008a). This option detects zerocrossings accurately, but might cause longer simulation run times for systems with strong "chattering" or Zeno behavior.
The adaptive zerocrossing algorithm is especially useful in systems having strong "chattering", or Zeno behavior. In such systems, this algorithm yields shorter simulation run times compared to the nonadaptive algorithm. See ZeroCrossing Detection for more information.
This parameter is enabled only if the solver Type is set to Variablestep
.
Selecting Adaptive
enables
the Signal threshold parameter.
Parameter: ZeroCrossAlgorithm 
Type: string 
Value: 'Nonadaptive'  'Adaptive' 
Default: 'Nonadaptive' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specifies the deadband region used during the detection of zero crossings. Signals falling within this region are defined as having crossed through zero.
The signal threshold is a real number, greater than or equal to zero.
Default: Auto
Auto
The signal threshold is determined automatically by the adaptive algorithm.
String
Use the specified value for the signal threshold. The value must be a real number equal to or greater than zero.
Entering too small of a value for the Signal Threshold parameter will result in long simulation run times.
Entering a large Signal Threshold value may improve the simulation speed (especially in systems having extensive chattering). However, making the value too large may reduce the simulation accuracy.
This parameter is enabled if the zerocrossing Algorithm is
set to Adaptive
.
Parameter: ZCThreshold 
Type: string 
Value: 'auto'  any
real number greater than or equal to zero 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Select constraints on the sample times defined by this model. If the model does not satisfy the specified constraints during simulation, Simulink software displays an error message.
Default: Unconstrained
Unconstrained
Specifies no constraints. Selecting this option causes Simulink software to display a field for entering the solver step size.
Use the Fixedstep size (fundamental sample time) option to specify solver step size.
Ensure sample time independent
Specifies that Model blocks inherit sample time from the context
in which they are used. You cannot use a referenced model that has
intrinsic sample times in a triggered subsystem or iterator subsystem.
If you plan on referencing this model in a triggered or iterator subsystem,
you should select Ensure sample time independent
so
that Simulink can detect sample time problems while unit testing
this model.
Simulink software checks to ensure that this model can inherit its sample times from a model that references it without altering its behavior. Models that specify a step size (i.e., a base sample time) cannot satisfy this constraint. For this reason, selecting this option causes Simulink software to hide the group's step size field (see Fixedstep size (fundamental sample time)).
Specified
Specifies that Simulink software check to ensure that this model operates at a specified set of prioritized periodic sample times. Use the Sample time properties option to specify and assign priorities to model sample times.
Execute Multitasking Models explains how to use this option for multitasking models.
During simulation, Simulink software checks to ensure that the model satisfies the constraints. If the model does not satisfy the specified constraint, then Simulink software displays an error message.
This parameter is enabled only if the solver Type is
set to Fixedstep
.
Selecting Unconstrained
enables
the following parameters:
Fixedstep size (fundamental sample time)
Tasking mode for periodic sample times
Higher priority value indicates higher task priority
Automatically handle rate transitions for data transfers
Selecting Specified
enables the following
parameters:
Sample time properties
Tasking mode for periodic sample times
Higher priority value indicates higher task priority
Automatically handle rate transitions for data transfers
Parameter: SampleTimeConstraint 
Type: string 
Value: 'unconstrained'  'STIndependent'  'Specified' 
Default: 'unconstrained' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  Specified or Ensure sample time
independent 
Specify the step size used by the selected fixedstep solver.
Default: auto
Entering auto
(the default) in
this field causes Simulink to choose the step size.
If the model specifies one or more periodic sample times, Simulink chooses a step size equal to the greatest common divisor of the specified sample times. This step size, known as the fundamental sample time of the model, ensures that the solver will take a step at every sample time defined by the model.
If the model does not define any periodic sample times, Simulink chooses a step size that divides the total simulation time into 50 equal steps.
If the model specifies no periodic rates and the stop
time is Inf
, Simulink uses 0.2 as the step
size. Otherwise, it sets the fixedstep size to
$${h}_{\mathrm{max}}=\frac{{t}_{stop}{t}_{start}}{50}$$
For Sine and Signal Generator source
blocks, if the stop time is Inf
, Simulink calculates
the step size using this heuristic:
Otherwise, the step size is:
where $$Fre{q}_{\mathrm{max}}$$ is the maximum frequency (Hz) of these blocks in the model.
This parameter is enabled only if the Periodic
sample time constraint is set to Unconstrained
.
Parameter: FixedStep 
Type: string 
Value: any valid value 
Default: 'auto' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify and assign priorities to the sample times that this model implements.
No Default
Enter an Nx3 matrix with rows that specify the model's discrete sample time properties in order from fastest rate to slowest rate.
Faster sample times must have higher priorities.
Format
[period, offset, priority]
period  The time interval (sample rate) at which updates occur during the simulation. 
offset  A time interval indicating an update delay. The block is updated later in the sample interval than other blocks operating at the same sample rate. 
priority  Execution priority of the realtime task associated with the sample rate. 
See Specify Sample Time for more details and options for specifying sample time.
Example
[[0.1, 0, 10]; [0.2, 0, 11]; [0.3, 0, 12]]
Declares that the model should specify three sample times.
Sets the fundamental sample time period to 0.1 second.
Assigns priorities of 10, 11, and 12 to the sample times.
Assumes higher priority values indicate lower priorities — the Higher priority value indicates higher task priority option is not selected.
If the model's fundamental rate differs from the fastest rate specified by the model, specify the fundamental rate as the first entry in the matrix followed by the specified rates, in order from fastest to slowest. See Purely Discrete Systems.
If the model operates at one rate, enter the rate as a threeelement vector in this field — for example, [0.1, 0, 10].
When you update a model, Simulink software displays an error message if what you specify does not match the sample times defined by the model.
If Periodic sample time constraint is
set to Unconstrained
, Simulink software
assigns priority 40 to the model base sample rate. If Higher
priority value indicates higher task priority is selected, Simulink software
assigns priorities 39, 38, 37, and so on, to subrates of the base
rate. Otherwise, it assigns priorities 41, 42, 43, and so on, to the
subrates.
Continuous rate is assigned a higher priority than
is the discrete base rate regardless of whether Periodic
sample time constraint is Specified
or Unconstrained
.
This parameter is enabled by selecting Specified
from
the Periodic sample time constraint list.
Parameter: SampleTimeProperty 
Type: structure 
Value: any valid matrix 
Default: [] 
Note:
If you specify

Select the extrapolation order used by the ode14x
solver
to compute a model's states at the next time step from the states
at the current time step.
Default: 4
1
Specifies first order extrapolation.
2
Specifies second order extrapolation.
3
Specifies third order extrapolation.
4
Specifies fourth order extrapolation.
Selecting a higher order produces a more accurate solution, but is more computationally intensive per step size.
This parameter is enabled by selecting ode14x (extrapolation)
from
the Solver list.
Parameter: ExtrapolationOrder 
Type: integer 
Value: 1  2  3  4 
Default: 4 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Specify the number of Newton's method iterations used by the ode14x
solver
to compute a model's states at the next time step from the states
at the current time step.
Default: 1
Minimum: 1
Maximum: 2147483647
More iterations produce a more accurate solution, but are more computationally intensive per step size.
This parameter is enabled by selecting ode14x (extrapolation)
from
the Solver list.
Parameter: NumberNewtonIterations 
Type: integer 
Value: any valid number 
Default: 1 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No impact 
Enable concurrent tasking behavior for model.
Default: On
Enable the model to be configured for concurrent tasking.
Disable the model from being configured for concurrent tasking.
Tip
If the referenced mode has a single rate, you do not need to select this check box to enable concurrent tasking behavior.
To remove this parameter, in the Model Explorer rightclick and select Configuration > Hide Concurrent Execution options.
Dependencies. This parameter check box is visible only if you convert an existing configuration set to one for concurrent execution. To enable this parameter, in the Model Explorer hierarchy pane, rightclick and select Configuration > Show Concurrent Execution options. The Dialog pane is displayed with the Allow tasks to execute concurrently on target check box and a Configure Tasks button.
If this parameter check box is selected when you click the Configure Tasks button, the Concurrent Execution dialog box is displayed.
If this parameter check box is cleared, the following parameters are enabled:
Periodic sample time constraint
Tasking mode for periodic sample times
Automatically handle rate transition for data transfer
Higher priority value indicates higher task priority
To make this parameter check box and button visible
with the commandline information, set the EnableConcurrentExecution
to 'on'
.
By default, this parameter is set to 'off'
.
Parameter: ConcurrentTasks 
Type: string 
Value: 'on'  'off' 
Default: 'on' 
Application  Setting 

Debugging  No impact 
Traceability  No impact 
Efficiency  No impact 
Safety precaution  No recommendation 