| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simscape |
| Contents | Index |
| Learn more about Simscape |
Utilities
Each physical device represented by a connected Simscape block diagram requires global environment information for simulation. The Solver Configuration block specifies this global information and provides parameters for the solver that your model needs before you can begin simulation.
Each topologically distinct Simscape block diagram requires exactly one Solver Configuration block to be connected to it.

When this box is selected, the solver attempts to find the steady state that would result if the inputs to the system were held constant for a sufficiently large time, starting from the initial state obtained from the initial conditions computation. For more information , see Computing Initial Conditions. Simulation then starts from this steady state.
This parameter affects the nonlinear solver used for computing initial conditions and for transient initialization. It determines how accurately the algebraic constraints are to be satisfied at the beginning of simulation and after every discrete event (for example, a discontinuity resulting from a valve opening, a hard stop hitting the stop, and so on). Decreasing the parameter value (that is, tighter tolerance) results in a more reliable time simulation. Increase the parameter value (that is, relax the tolerance) if solving for initial conditions failed to converge, or to reduce the computation time. The default value is 1e-9, which is applicable to most cases.
Lets you use sample-based local solver with a sample time specified by the Sample time parameter, described below. In sample-based simulation, all the Physical Network states, otherwise represented as continuous, become discrete states. The solver updates the states once per time step. This option is especially useful for code generation, or hardware-in-the-loop (HIL) simulations.
This option makes it possible to perform simulations with a predictable (and typically nearly-fixed) run time per unit of simulated time. In order to achieve this fixed-cost behavior, select Use fixed-cost runtime consistency iterations as well as Use local solver. Also, the fixed-cost behavior is only obtained if you use a fixed step solver for the entire model, by using the Solver options parameters on the Solver pane of the Configuration Parameters dialog box. In the typical case of a model with no continuous states outside the Physical Networks parts, select Fixed-step under Type and discrete (no continuous states) under Solver. Otherwise, the software may automatically change the solver for a model with no continuous states to either Fixed-Step Discrete or Variable-Step Discrete, depending on whether the solver type choice in Configuration Parameters is Fixed-step or Variable-step, and will issue a warning when making the change. Note that Variable-Step Discrete solver may take additional steps beyond the ones specified by the Sample Time parameter, and is therefore not a good choice for fixed-cost simulation.
Select the solver type used for updating the states: Backward Euler or Trapezoidal Rule. The Use local solver check box must be selected. Backward Euler is stable and has good (first-order) local accuracy, but typically gives a computed solution which has numerical damping compared to the true solution. Trapezoidal Rule has better (second order) local accuracy and does not suffer from numerical damping, but is only marginally stable, so that fast dynamics that are damped quickly in the actual system may be damped only slowly in the Trapezoidal Rule simulation. Trapezoidal Rule is slightly less efficient. The default is Backward Euler because it is more robust to increasing the time step for stiff systems, which are typically encountered in physical modeling.
Specify the sample time for the local solver. The Use local solver check box must be selected. The sample time must be positive. The default is .001 s.
The trade-off in choosing a sample time is simulation speed versus accuracy, stability, and robustness. A larger sample time will result in faster simulations (less real time per unit of simulated time), but also a less accurate and less robust simulation. If simulation fails or results look unphysical, try a smaller sample time. Models with friction or hard stops are particularly difficult for the sample-based solver, and may not work at all or may require a very small choice of sample time. Also, for Trapezoidal Rule, ringing becomes more of a problem as the sample time is increased.
It is possible to perform multirate simulations using the local solver option. This means having more than one Solver Configuration block in the model, with different sample times (or having a sample-based Simulink block in the model with a different sample time from the Solver Configuration block). To avoid Simulink errors in sample time propagation, The MathWorks recommends that you select the Automatically handle rate transition for data transfer check box on the Solver pane of the Configuration Parameters dialog box.
Lets you perform transient initialization at a fixed computational cost for real-time simulation. If you select this check box, you can specify the maximum number of nonlinear and mode iterations for transient initialization. If the system does not converge upon reaching these numbers, it ignores the failure and goes to the next step. If you clear the check box, the system uses a more robust and time-consuming algorithm, and errors out if it fails to reach convergence at the time of transient initialization.
Specify the maximum number of Newton iterations at the time of transient initialization. The Use fixed-cost runtime consistency iterations check box must be selected. The default number is 3.
Specify the maximum number of mode iterations at the time of transient initialization. The Use fixed-cost runtime consistency iterations check box must be selected. The default number is 2. Only one major mode update per step is performed when using local solvers, therefore this parameter is not available if the Use local solver check box is selected.
Specifies how the solver treats matrices. The parameter can have one of two values: Sparse or Full. Sparse provides faster results. Full is used for code generation. The default value of the parameter is Sparse.
The block has one conserving port. You can add this block anywhere on a physical network circuit by creating a branching point and connecting it to the only port of the Solver Configuration block.
![]() | Simulink-PS Converter | Switch | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |