| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simscape |
| Contents | Index |
| Learn more about Simscape |
| On this page… |
|---|
It is possible to choose any variable-step or fixed-step solver for models containing Simscape blocks. However, implicit solvers, such as ode14x, ode23t, and ode15s, are a better choice for a typical model. In particular, for stiff systems, implicit solvers typically take many fewer timesteps than explicit solvers, such as ode45, ode113, and ode1.
When you first create a model, the default Simulink solver is ode45. To select a different solver, follow a procedure similar to that in Modifying Initial Settings.
If you do not modify the default solver and your system is stiff, your performance may not be optimal. To alert you to a potential issue, the system issues a warning when you use an explicit solver in a model containing Simscape blocks. You can turn off this default warning or changed it to an error for a particular model, by following these steps:
From the top menu bar in the model window, select Simulation > Configuration Parameters. The Configuration Parameters dialog box opens.
In the left pane of the Configuration Parameters dialog box, select Simscape.

Select the desired option from the Explicit solver used in model containing Physical Networks blocks drop-down list:
warning — Makes the system issue a warning upon simulation if the model uses an explicit solver. This is the default option, designed to alert you to a potential issue if you use the default solver.
error — Makes the system issue an error upon simulation if the model uses an explicit solver. If your model is stiff, and the use of explicit solvers undesirable, you may choose to select this option to avoid troubleshooting errors in the future.
none — Turns off issuing a warning or error upon simulation with explicit solver. For models that are not stiff, explicit solvers can be effective, often taking fewer timesteps than implicit solvers. If you work with such models and use explicit solvers, select this option to turn off the warning upon simulation.
Click OK.
If you use an explicit solver, you may need to provide time derivatives of some of the input signals. By default, needed input derivatives are provided by filtering the input through a low-pass filter. The derivative of the filtered input can then be computed by the Physical Networks simulation engine.
You can control the way you provide time derivatives for each input signal by configuring the Simulink-PS Converter block connected to it:
Double-click the Simulink-PS Converter block to open its dialog box.
Click the Derivatives tab.

To avoid filtering the input signal, set Input derivatives parameter to First derivative of input user-provided.
When you select this option, a second Simulink input port appears on the Simulink-PS Converter block, to let you connect the signal providing input derivatives. Input filtering is then turned off.
If you cannot provide the first derivative of the input signal as an additional input signal to the Simulink-PS Converter block, leave the Input derivatives parameter set to No user-input provided derivatives. In this case, however, it is important to set the appropriate Input filtering time constant parameter value for your model.
The filter time constant controls the filtering of the input signal. The filtered input follows the true input but is smoothed, with a lag on the order of the time constant chosen. You should set the time constant to a value no larger than the smallest time interval of interest in the system. The trade-off in choosing a very small time constant is that the filtered input signal will be closer to the true input signal, at the cost of increasing the stiffness of the system and slowing down the simulation.
Because input filtering can appreciably change the input signal and drastically affect simulation results if the time constant is too large, a warning is issued when input filtering is used. The warning indicates which Simulink-PS Converter blocks have their input signals filtered. You can turn off this warning (or change it to an error) by changing the preferences on the Simscape pane of the Configuration Parameters dialog box:
From the top menu bar in the model window, select Simulation > Configuration Parameters. The Configuration Parameters dialog box opens.
In the left pane of the Configuration Parameters dialog box, select Simscape.

Select the desired option from the Input filtering used in model containing Physical Networks blocks drop-down list:
warning — Makes the system issue a warning upon simulation if the model uses input filtering. The warning contains a list of Simulink-PS Converter blocks that use input filtering. This is the default option.
error — Makes the system issue an error upon simulation if the model uses input filtering. If you select this option and use an explicit solver, you have to provide first derivative of the input signal as an additional input signal to each Simulink-PS Converter block. For details, see the Simulink-PS Converter block reference page.
none — Turns off issuing a warning or error upon simulation when the model uses input filtering.
Click OK.
![]() | How Simscape Simulation Works | Troubleshooting Simulation Errors | ![]() |

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 |