Physical Networks environment and solver configuration

Utilities

Each physical network represented by a connected Simscape™ block diagram requires solver settings information for simulation. The Solver Configuration block specifies the solver parameters 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.

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.

**Start simulation from steady state**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 Initial Conditions Computation. Simulation then starts from this steady state.

**Note**Using the**Initial state**option on the**Data Import/Export**pane of the Configuration Parameters dialog box overrides the**Start simulation from steady state**option.**Consistency tolerance**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, and so on). Decrease the parameter value (that is, tighten tolerance) to obtain 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.**Use local solver**Lets you use a sample-based local solver with a sample time specified by the

**Sample time**parameter. In sample-based simulation, all the Physical Network states, which are otherwise continuous, become represented to Simulink^{®}as discrete states. The solver updates the states once per time step. This option is especially useful for generated code or hardware-in-the-loop (HIL) simulations.**Note**If you use a local solver, simultaneous use of Simulink or Simulink Control Design™ linearization tools is not recommended.**Solver type**Select the solver type used for updating the states:

`Backward Euler`

or`Trapezoidal Rule`

. The**Use local solver**check box must be selected. The default is`Backward Euler`

.**Sample time**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.**Use fixed-cost runtime consistency iterations**Lets you perform transient initialization at a fixed computational cost.

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.

**Nonlinear iterations**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`

.**Mode iterations**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.**Linear Algebra**Specifies how the solver treats matrices. The parameter can have one of two values:

`Sparse`

or`Full`

. The default value of the parameter is`Sparse`

.Your choice of this parameter value,

`Sparse`

or`Full`

, is implemented in both model simulation and code generated from your model.**Delay memory budget [kB]**Specify the maximum memory budget, in kB, allowed for processing delays when simulating models that contain either blocks from the Delays library, or custom blocks using the

`delay`

Simscape language construct. The purpose of this parameter is to protect against excessive memory swapping. If this budget is exceeded, simulation errors out. You can adjust this value based on your available memory resources. The default number is`1024`

kB.**Apply filtering at 1-D/3-D connections when needed**This option is applicable only for models that connect blocks from SimMechanics™ Second Generation library to Simscape blocks, or blocks from other add-on products. Use the Statistics Viewer to determine whether your model has 1-D/3-D connections. For more information, see 1-D/3-D Interface Statistics.

When a SimMechanics block is connected directly to a Simscape network, an additional derivative may be required for the network to be solved. When you select this check box, the solver automatically applies input filtering to the signal entering the Simulink-PS Converter block to obtain this additional derivative. The

**Filtering time constant**parameter provides the time constant for the delay.**Note**This check box is selected by default. If you clear it, and the 1-D/3-D connection requires the additional derivative, the solver issues an error message.**Filtering time constant**This parameter specifies the filtering time constant for when the

**Apply filtering at 1-D/3-D connections when needed**check box is selected. The parameter value applies globally to all connections belonging to the network that includes this Solver Configuration block. The default value is`0.001`

s.

Was this topic helpful?