Main Content

Configure Simulation Conditions

Select solver, set initial conditions, pick input data set, set step size

After you build a model in Simulink®, you can configure the simulation to run quickly and accurately without making structural changes to the model.

The first step in configuring your simulation is to select a solver. By default, Simulink automatically selects a variable-step solver. You can fine tune the solver options or select a different solver in the Solver Pane of the Configuration Parameters dialog box.

Sometimes, a simulation can slow down or stall. Use the Solver Profiler to identify bottlenecks in the simulation and get recommendations to improve the solver performance.

Functions

expand all

openDialogOpen configuration parameters dialog
closeDialogClose configuration parameters dialog
Simulink.BlockDiagram.getAlgebraicLoopsIdentify and analyze algebraic loops in a model
solverprofiler.profileModelProgrammatically analyze solver performance for model using Solver Profiler

Model Settings

expand all

Start timeSimulation start time
Stop timeSimulation stop time
TypeChoice of variable- or fixed-step solver
SolverSolver that computes states and outputs for simulation

Step Size and Error Tolerance

Max step sizeMaximum step size for variable-step solver
Min step sizeMinimum step size for variable-step solver
Initial step sizeSize of first time step for variable-step solver
Number of consecutive min stepsNumber of steps less than or equal to minimum step size allowed before minimum step size violation occurs
Relative toleranceRelative tolerance for solver tolerance calculation
Absolute toleranceAbsolute tolerance for solver tolerance calculation
Auto scale absolute toleranceOption to scale absolute tolerance based on state values
Shape preservationOption to preserve shape of states using derivative information at each time step

Zero-Crossing Detection

Zero-crossing controlOption to control how zero-crossing detection is enabled in the model
AlgorithmAlgorithm for zero-crossing detection with variable-step solver
Time toleranceDefinition of consecutive zero crossings
Signal thresholdState value at which adaptive zero-crossing algorithm can stop bracketing
Number of consecutive zero crossingsThreshold for issuing diagnostic due to consecutive zero crossings

Solver Computation Options

Integration methodIntegration for nonadaptive odeN variable-step solver (Since R2020a)
Maximum orderOrder of numerical differentiation formulas used for ode15s solver
Solver reset methodOption to specify whether solver recomputes Jacobian matrix during solver reset
Solver Jacobian MethodMethod implicit solvers use to compute Jacobian matrix
Extrapolation orderExtrapolation order for ode14x fixed-step solver
Number of Newton's iterationsNumber of Newton's method iterations used by ode14x and ode1be solvers
Daessc modeMode of operation for daessc solver

Tasking and Sample Time Options

Automatically handle rate transition for data transferOption to ensure integrity of data transfer between different sample times in deployed code
Allow multiple tasks to access inputs and outputsOption to treat root-level input and output ports as part of each connected task in rate-based model (Since R2021b)
Higher priority value indicates higher task priorityPriority ordering for real-time system targets
Deterministic data transferDeterministic data transfer behavior for automatically inserted Rate Transition blocks

Step Size

Fixed-step size (fundamental sample time)Step size for fixed-step solver

Zero-Crossing Detection

Enable zero-crossing detection for fixed-step solverOption to use zero-crossing detection with fixed-step solver (Since R2022a)
Zero-crossing controlOption to control how zero-crossing detection is enabled in the model
Maximum number of bracketing iterationsMaximum number of iterations performed when locating zero crossing (Since R2022a)
Maximum number of zero-crossings per stepMaximum number of zero crossings to locate in a single time step (Since R2022a)

Solver Computation Options

Solver Jacobian MethodMethod implicit solvers use to compute Jacobian matrix
Extrapolation orderExtrapolation order for ode14x fixed-step solver
Number of Newton's iterationsNumber of Newton's method iterations used by ode14x and ode1be solvers

Tasking and Sample Time Options

Periodic sample time constraintOption to specify constraints on model sample times
Sample time propertiesDiscrete sample time periods, offsets, and priorities
Treat each discrete rate as a separate taskOption to enable multitasking execution
Allow tasks to execute concurrently on targetEnable concurrent tasking behavior for model
Automatically handle rate transition for data transferOption to ensure integrity of data transfer between different sample times in deployed code
Allow multiple tasks to access inputs and outputsOption to treat root-level input and output ports as part of each connected task in rate-based model (Since R2021b)
Higher priority value indicates higher task priorityPriority ordering for real-time system targets
Deterministic data transferDeterministic data transfer behavior for automatically inserted Rate Transition blocks
Algebraic loopDiagnostic behavior when algebraic loop detected during compilation
Minimize algebraic loopDiagnostic behavior when the software is unable to resolve artificial algebraic loops
Block priority violationDiagnostic behavior when the software detects block priority specification error
Min step size violationDiagnostic behavior when minimum step size violation occurs
Consecutive zero-crossings violationDiagnostic behavior when zero-crossing violation occurs
Automatic solver parameter selectionDiagnostic behavior when the software changes a solver parameter value
State name clashDiagnostic behavior when more than one state has same name

Topics

Solvers in Simulink

State Information

Solver Profiler

Algebraic Loops

Featured Examples