Main Content

Solver data inconsistency

Description

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.

Category: Diagnostics

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
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
Efficiencynone
Safety precautionNo impact

Related Topics