WOLFRAM

simulates model according to experiment settings.

SystemModelSimulate[model,tmax]

simulates from 0 to tmax.

SystemModelSimulate[model,{tmin,tmax}]

simulates from tmin to tmax.

SystemModelSimulate[model,vars,{tmin,tmax}]

stores only simulation data for the variables vars.

Details and Options

  • The model can have the following forms:
  • SystemModel[]general system model
    StateSpaceModel[]state-space model
    TransferFunctionModel[]transfer function model
    AffineStateSpaceModel[]affine state-space model
    NonlinearStateSpaceModel[]nonlinear state-space model
    DiscreteInputOutputModel[]discrete input-output model
  • SystemModelSimulate returns a SystemModelSimulationData object.
  • The stored simulation variables vars can have the following values:
  • Automaticautomatically choose what to store
    {v1,v2,}store only variables vi
    Allstore all variables
  • SystemModelSimulate[,spec] uses Association spec for initial values, parameters and inputs:
  • "ParameterValues"{p1val1,}parameter pi has value vali
    "InitialValues"{v1val1,}variable vi has initial value vali
    "Inputs"{in1fun1,}input ini has value funi[t] at time t
  • Setting "ParameterValues" or "InitialValues" to {pi->{c1,c2,},} runs simulations in parallel, with pi taking values cj.
  • "InitialValues" corresponds to the start property in the Modelica model.
  • The following options can be given:
  • InterpolationOrder Automaticcontinuity degree of output between events
    Method Automaticwhat simulation method to use
    ProgressReporting $ProgressReportingcontrol display of progress
  • The option Method is supported when model is a SystemModel.
  • Method settings take the form Method->"method" or Method{"method","sub1"->val1,}.
  • The following adaptive step methods can be used:
  • "DASSL"DASSL DAE solver
    "CVODES"CVODES ODE solver
  • Suboptions for adaptive-step methods include:
  • "InterpolationPoints"Automaticnumber of interpolation points
    "Tolerance"10-6tolerance for adaptive step size
  • The following fixed-step methods can be used:
  • "Euler"explicit Euler's method of order 1
    "Heun"Heun's method of order 2
    "RungeKutta"explicit RungeKutta method of order 4
  • Suboptions for fixed-step methods include:
  • "StepSize"10-3fixed step size
  • With Method->{"NDSolve",sub1->val1,}, NDSolve is used as the solver. Method options subi are passed to NDSolve.

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Simulate a model with the time interval of simulation settings from the model:

Out[2]=2
Out[3]=3

Do a parameter sweep over a voltage offset:

Plot the voltage for all simulations:

Out[2]=2

Use the diagram representation of a model as input:

Out[1]=1

Copy and paste the output above:

Out[2]=2

Or use the name string:

Out[3]=3

Scope  (22)Survey of the scope of standard use cases

Models  (5)

Simulate one of the included example models from the thermal domain:

Out[1]=1
Out[2]=2

Simulate a NonlinearStateSpaceModel and plot simulation results:

Out[1]=1
Out[2]=2

Simulate a TransferFunctionModel with a UnitStep as input:

Out[1]=1
Out[2]=2

Do a parameter sweep in an AffineStateSpaceModel:

Out[1]=1
Out[2]=2

Simulate a DiscreteInputOutputModel:

Out[1]=1
Out[2]=2

Plot all simulation results:

Out[3]=3

Simulation Time  (4)

Simulate with settings from the model:

Out[2]=2
Out[3]=3

Simulate from time 0 to 5:

Out[1]=1
Out[2]=2

Simulate for an explicit time interval:

Out[1]=1
Out[2]=2

Use a Quantity to specify the time interval:

Out[1]=1
Out[2]=2

Variables, Parameters and Inputs  (8)

Initial values for variables can be set using "InitialValues":

Out[2]=2
Out[3]=3

Parameter values can be set using "ParameterValues":

Out[1]=1
Out[2]=2

Simulate a model that adds two inputs together:

Plot the inputs and the output:

Out[2]=2

Simulate for different initial values for the variable x:

Plot the variable x from all simulations:

Out[2]=2

Simulate a model with default parameters:

Set a parameter in the simulation:

Compare the variable capacitor1.v^(') between the simulations:

Out[3]=3

Do a parameter sweep over a voltage offset:

Plot the voltage for all simulations:

Out[2]=2

Setting ranges for two parameters simulates once for each position in the ranges:

Out[2]=2

Simulate a model with a TimeSeries as input:

Define a time series object:

Simulate the model:

Plot the input and the output:

Out[3]=3

Simulation Results  (5)

Simulate a model and plot the variables x1 and x2:

Out[3]=3

Simulate a model:

Get simulation results for the variables x and x':

Out[2]=2

Plot the variables using the Plot function:

Out[3]=3

Simulate a model and find the maximum of a variable:

Get the value of the variable angle1v:

Find the maximum value of the angle:

Out[3]=3

Run a simulation and plot in a single call:

Out[1]=1

Specify arguments to SystemModelSimulate:

Out[2]=2

Store only selected variables:

Out[1]=1

Only the given variables are saved:

Out[2]=2

Generalizations & Extensions  (1)Generalized and extended use cases

Debug messages are collected in the message group "WSMDebug":

Out[2]=2

Turn on debug messages for initialization:

Out[4]=4

Turn off all debug messages for "WSMDebug":

Options  (10)Common values & functionality for each option

InterpolationOrder  (1)

Simulate with interpolation orders 1 and 3, and 3 interpolation points:

Show the x variable:

Out[3]=3

Method  (8)

Use a fixed-step solver:

Out[2]=2

Plot the result:

Out[3]=3

Use an adaptive-step solver:

Out[1]=1

Show the result in a ParametricPlot:

Out[2]=2

For stiff problems, use an adaptive-step method:

Out[2]=2

Simulating with too few interpolation points can give inexact plots:

Out[2]=2

Increasing the number of points gives a better result:

Out[4]=4

The default step size for a fixed-step solver might be smaller than needed:

Out[1]=1

Use a larger step size to speed up computation:

Out[2]=2

The result is comparable:

Out[3]=3

Let an adaptive solver choose the solver steps:

Out[1]=1

Use NDSolve for simulating a model:

Out[1]=1

The result is a SystemModelSimulationData object containing the simulation results:

Out[2]=2

Pass options to NDSolve:

Out[1]=1

The accuracy is reduced because of the options:

Out[2]=2

ProgressReporting  (1)

Control progress reporting with ProgressReporting:

Out[2]=2

Applications  (11)Sample problems that can be solved with this function

Calculate the overshoot of the height in a tank system:

Out[2]=2

Find the maximum peak value:

Out[4]=4

Get the value of the step sent in to the tank:

Calculate the overshoot:

Out[6]=6

Show the overshoot:

Out[7]=7

Calculate the rise time for the height in a tank system:

Get the required values at 10% and 90% by looking at the steady-state value for height:

Out[3]=3

Find the times at which the signal reaches these values:

Out[4]=4

Calculate the rise time:

Out[5]=5

Plot lines at the final value, and when the signal reaches 10% and 90% of the final value:

Out[6]=6

Calculate the settling time for the height in a tank system:

Find 5% bounds on the final value:

Out[3]=3

Find the time at which the signal stays within these values:

Out[4]=4

Plot the bounds and the found settling time:

Out[5]=5

Change parameter values interactively:

Out[2]=2

Simulate a rolling wheel for different starting inertias along the wheel axis:

Fetch the trajectories for the wheel:

Plot the trajectories:

Out[3]=3

Analyze resonance peaks when varying a spring constant:

Compute TemplateBox[{{H, (, {ⅈ,  , omega}, )}}, Abs] from :

Show the resonance peaks:

Out[3]=3

Calibrate parameters in a model by comparing to measurement data:

Set up a criteria function for model fitting:

Fit parameters to the test data:

Out[4]=4

Simulate with the fitted parameters:

Show the test data and the calibrated model together:

Out[6]=6

Filter sampled data from a Tinker Forge Weather Station:

Time shift and retrieve the magnitude of the data:

Run the time series through a lowpass filter:

Out[5]=5

Simulate a lowpass filter with sound as input:

Simulate with given input sound:

Out[2]=2

Retrieve the audio for input and output:

Out[3]=3

Simulate a Newton's cradle:

Fetch trajectories from the result:

Visualize the cradle:

Out[3]=3

Visualize simulated data with a WaveletScalogram:

Pick out the data you are interested in:

Compute the wavelet transform:

Plot the wavelet vector coefficients:

Out[4]=4

Properties & Relations  (3)Properties of the function, and connections to other functions

The output from SystemModelSimulate is a SystemModelSimulationData object:

Out[2]=2

Use properties to get variable trajectories:

Out[3]=3

Use SystemModelSimulateSensitivity to also get sensitivities to parameters:

Plot the capacitor's voltage sensitivity to the frequency of "sineVoltage1":

Out[2]=2
Out[3]=3

Use SystemModelParametricSimulate for a function that can be evaluated for different values:

Out[1]=1

Compute solutions for different values of the frequency parameter:

Out[2]=2

Plot the solutions over time:

Out[3]=3

Neat Examples  (1)Surprising or curious use cases

Simulate a Van der Pol model and show in a parametric plot:

Out[3]=3
Wolfram Research (2018), SystemModelSimulate, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemModelSimulate.html (updated 2022).
Wolfram Research (2018), SystemModelSimulate, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemModelSimulate.html (updated 2022).

Text

Wolfram Research (2018), SystemModelSimulate, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemModelSimulate.html (updated 2022).

Wolfram Research (2018), SystemModelSimulate, Wolfram Language function, https://reference.wolfram.com/language/ref/SystemModelSimulate.html (updated 2022).

CMS

Wolfram Language. 2018. "SystemModelSimulate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/SystemModelSimulate.html.

Wolfram Language. 2018. "SystemModelSimulate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/SystemModelSimulate.html.

APA

Wolfram Language. (2018). SystemModelSimulate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SystemModelSimulate.html

Wolfram Language. (2018). SystemModelSimulate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SystemModelSimulate.html

BibTeX

@misc{reference.wolfram_2025_systemmodelsimulate, author="Wolfram Research", title="{SystemModelSimulate}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/SystemModelSimulate.html}", note=[Accessed: 24-July-2025 ]}

@misc{reference.wolfram_2025_systemmodelsimulate, author="Wolfram Research", title="{SystemModelSimulate}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/SystemModelSimulate.html}", note=[Accessed: 24-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_systemmodelsimulate, organization={Wolfram Research}, title={SystemModelSimulate}, year={2022}, url={https://reference.wolfram.com/language/ref/SystemModelSimulate.html}, note=[Accessed: 24-July-2025 ]}

@online{reference.wolfram_2025_systemmodelsimulate, organization={Wolfram Research}, title={SystemModelSimulate}, year={2022}, url={https://reference.wolfram.com/language/ref/SystemModelSimulate.html}, note=[Accessed: 24-July-2025 ]}