Documentation Center

  • Trial Software
  • Product Updates

Diagnostics Pane: Solver

Solver Diagnostics Overview

Specify what diagnostic actions Simulink® software should take, if any, when it detects an abnormal condition with the solver.

Configuration

Set the parameters displayed.

Tips

  • To open the Diagnostics: Solver pane, in the Simulink Editor, select Simulation > Model Configuration Parameters > Diagnostics. The Solver pane appears.

  • The options are typically to do nothing or to display a warning or an error message.

  • A warning does not terminate a simulation, but an error does.

See Also

Algebraic loop

Select the diagnostic action to take if Simulink software detects an algebraic loop while compiling the model.

Settings

Default: warning

none

When the Simulink software detects an algebraic loop, the software tries to solve the algebraic loop. If the software cannot solve the algebraic loop, it reports an error and the simulation terminates.

warning

When Simulink software detects an algebraic loop, it displays a warning and tries to solve the algebraic loop. If the software cannot solve the algebraic loop, it reports an error and the simulation terminates.

error

When Simulink software detects an algebraic loop, it terminates the simulation, displays an error message, and highlights the portion of the block diagram that comprises the loop.

Tips

  • An algebraic loop generally occurs when an input port with direct feedthrough is driven by the output of the same block, either directly, or by a feedback path through other blocks with direct feedthrough. An example of an algebraic loop is this simple scalar loop.

  • When a model contains an algebraic loop, Simulink software calls a loop-solving routine at each time step. The loop solver performs iterations to determine the solution to the problem (if it can). As a result, models with algebraic loops run slower than models without them.

  • Use the error option to highlight algebraic loops when you simulate a model. This causes Simulink software to display an error dialog (the Diagnostic Viewer) and recolor portions of the diagram that represent the first algebraic loop that it detects. Simulink software uses red to color the blocks and lines that constitute the loop. Closing the error dialog restores the diagram to its original colors.

  • See Algebraic LoopsAlgebraic Loops for more information.

Command-Line Information

Parameter: AlgebraicLoopMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
Debuggingerror
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Minimize algebraic loop

Select the diagnostic action to take if artificial algebraic loop minimization cannot be performed for an atomic subsystem or Model block because an input port has direct feedthrough.

When you set the Minimize algebraic loop occurrences parameter for an atomic subsystem or a Model block, if Simulink detects an artificial algebraic loop, it attempts to eliminate the loop by checking for non-direct-feedthrough blocks before simulating the model. If Simulink cannot minimize the artificial algebraic loop, the simulation performs the diagnostic action specified by the Minimize algebraic loop parameter.

Settings

Default: warning

none

Simulink takes no action.

warning

Simulink displays a warning that it cannot minimize the artificial algebraic loop.

error

Simulink terminates the simulation and displays an error that it cannot minimize the artificial algebraic loop.

Tips

  • If the port is involved in an artificial algebraic loop, Simulink software can remove the loop only if at least one other input port in the loop lacks direct feedthrough.

  • Simulink software cannot minimize artificial algebraic loops containing signals designated as test points (see Working with Test PointsWorking with Test Points).

Command-Line Information

Parameter: ArtificialAlgebraicLoopMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Block priority violation

Select the diagnostic action to take if Simulink software detects a block priority specification error.

Settings

Default: warning

warning

When Simulink software detects a block priority specification error, it displays a warning.

error

When Simulink software detects a block priority specification error, it terminates the simulation and displays an error message.

Tips

  • Simulink software allows you to assign update priorities to blocks. Simulink software executes the output methods of higher priority blocks before those of lower priority blocks.

  • Simulink software honors the block priorities that you specify only if they are consistent with the Simulink block sorting algorithm. If Simulink software is unable to honor a user specified block priority, it generates a block priority specification error.

Command-Line Information

Parameter: BlockPriorityViolationMsg
Type: string
Value: 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Min step size violation

Select the diagnostic action to take if Simulink software detects that the next simulation step is smaller than the minimum step size specified for the model.

Settings

Default: warning

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

Command-Line Information

Parameter: MinStepSizeMsg
Type: string
Value: 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Sample hit time adjusting

Select the diagnostic action to take if Simulink software makes a minor adjustment to a sample hit time while running the model.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

Tips

  • Simulink software might change a sample hit time if that hit time is close to the hit time for another task. If Simulink software considers the difference to be due only to numerical errors (for example, precision issues or roundoff errors), it changes the sample hits of the faster task or tasks to exactly match the time of the slowest task that has that hit.

  • Over time, these sample hit changes might cause a discrepancy between the numerical simulation results and the actual theoretical results.

  • When this option is set to warning, the MATLAB® Command Window displays a warning like the following when Simulink software detects a change in the sample hit time:

    Warning: Timing engine warning: Changing the hit time for ...

Command-Line Information

Parameter: TimeAdjustmentMsg
Type: string
Value: 'none' | 'warning'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Consecutive zero-crossings violation

Select the diagnostic action to take when Simulink software detects that the number of consecutive zero crossings exceeds the specified maximum.

Settings

Default: error

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

Dependency

This diagnostic applies only when you are using a variable-step solver and the zero-crossing control is set to either Enable all or Use local settings.

Command-Line Information

Parameter: MaxConsecutiveZCsMsg
Type: string
Value: 'none' | 'warning'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionwarning or error

See Also

Unspecified inheritability of sample time

Select the diagnostic action to take if this model contains S-functions that do not specify whether they preclude this model from inheriting their sample times from a parent model.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • Not specifying an inheritance rule may lead to incorrect simulation results.

  • Simulink software checks for this condition only if the solver used to simulate this model is a fixed-step discrete solver and the periodic sample time constraint for the solver is set to ensure sample time independence

  • For more information, see Periodic sample time constraintPeriodic sample time constraint.

Command-Line Information

Parameter: UnknownTsInhSupMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Solver data inconsistency

Select the diagnostic action to take if Simulink software detects S-functions that have continuous sample times, but do not produce consistent results when executed multiple times.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • Consistency checking can cause a significant decrease in performance (up to 40%).

  • Consistency checking is a debugging tool that validates certain assumptions made by Simulink ODE solvers. Use this option to:

    • Validate your S-functions and ensure that they adhere to the same rules as Simulink built-in blocks.

    • Determine the cause of unexpected simulation results.

    • Ensure that blocks produce constant output when called with a given value of t (time).

  • Simulink software saves (caches) output, the zero-crossing, the derivative, and state values from one time step for use in the next time step. The value at the end of a time step can generally be reused at the start of the next time step. Solvers, particularly stiff solvers such as ode23s and ode15s, take advantage of this to avoid redundant calculations. While calculating the Jacobian matrix, a stiff solver can call a block's output functions many times at the same value of t.

  • When consistency checking is enabled, Simulink software recomputes the appropriate values and compares them to the cached values. If the values are not the same, a consistency error occurs. Simulink software compares computed values for these quantities:

    • Outputs

    • Zero crossings

    • Derivatives

    • States

Command-Line Information

Parameter: ConsistencyChecking
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
Efficiencynone
Safety precautionNo impact

See Also

Automatic solver parameter selection

Select the diagnostic action to take if Simulink software changes a solver parameter setting.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

When enabled, this option notifies you if:

  • Simulink software changes a user-modified parameter to make it consistent with other model settings.

  • Simulink software automatically selects solver parameters for the model, such as FixedStepSize.

For example, if you simulate a discrete model that specifies a continuous solver, Simulink software changes the solver type to discrete and displays a warning about this change at the MATLAB command line.

Command-Line Information

Parameter: SolverPrmCheckMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Extraneous discrete derivative signals

Select the diagnostic action to take when a discrete signal appears to pass through a Model block to the input of a block with continuous states.

Settings

Default: error

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This error can occur if a discrete signal passes through a Model block to the input of a block with continuous states, such as an Integrator block. In this case, Simulink software cannot determine with certainty the minimum rate at which it needs to reset the solver to solve this model accurately.

  • If this diagnostic is set to none or warning, Simulink software resets the solver whenever the value of the discrete signal changes. This ensures accurate simulation of the model if the discrete signal is the source of the signal entering the block with continuous states. However, if the discrete signal is not the source of the signal entering the block with continuous states, resetting the solver at the rate the discrete signal changes can lead to the solver being reset more frequently than necessary, slowing down the simulation.

  • If this diagnostic is set to error, Simulink software halts when compiling this model and displays an error.

Dependency

This diagnostic applies only when you are using a variable-step ode solver and the block diagram contains Model blocks.

Command-Line Information

Parameter: ModelReferenceExtraNoncontSigs
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

State name clash

Select the diagnostic action to take when a name is used for more than one state in the model.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

Tips

  • This diagnostic applies for continuous and discrete states during simulation.

  • This diagnostic applies only if you save states to the MATLAB workspace using the format Structure or Structure with time. If you do not save states in structure format, the state names are not used, and therefore the diagnostic will not warn you about a naming conflict.

Command-Line Information

Parameter: StateNameClashWarn
Type: string
Value: 'none' | 'warning'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

SimState interface checksum mismatch

Use this check to ensure that the interface checksum is identical to the model checksum before loading the SimState.

Settings

Default: warning

none

Simulink software does not compare the interface checksum to the model checksum.

warning

The interface checksum in the SimState is different than the model checksum.

error

When Simulink detects that a change in the configuration settings occurred after saving the SimState, it does not load the SimState and reports an error.

Command-Line Information

Parameter: SimStateInterfaceChecksumMismatchMsg
Type: string
Value: 'warning' | 'error' | 'none'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

SimState object from earlier release

Use this check to report that the SimState was generated by an earlier version of Simulink.

Settings

Default: error

warning

Simulink will restore as much of this SimState as possible.

error

When Simulink detects that the SimState was generated by an earlier version of Simulink, it does not attempt to load the object.

Command-Line Information

Parameter: SimStateOlderReleaseMsg
Type: string
Value: 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Save and Restore Simulation State as SimState

Was this topic helpful?