SystemModelSimulationData

SystemModelSimulationData[]

represents simulation data from functions such as SystemModelSimulate etc.

Details and Options

  • SystemModelSimulationData provides ways of summarizing, exploring and extracting simulation results.
  • SystemModelSimulationData is generated by SystemModelSimulate and SystemModelSimulateSensitivity.
  • A SystemModelSimulationData[] object sim can be used to retrieve properties through sim["property"].
  • sim["Properties"] gives a list of available properties.
  • For simulations with dynamic graphics, sim["Diagram",t] returns Graphics at time t.
  • Dynamic graphics for component "c1.c2..." are shown with sim["Diagram",{"c1","c2",},t].
  • Properties of the simulated model: »
  • "Descriptions"variable and parameter descriptions
    "Model"SystemModel object of the simulated model
    "ModelName"fully qualified name of the model
    "ParameterNames"parameter variables in the simulation data
    "PlotNames"names of plots in model
    "StateVariables"continuous state variables in the simulation data
    "VariableNames"time-dependent variables in the simulation data
  • For variable and parameter lists, sim[{property,patt}] returns the elements of property whose names match the string pattern patt.
  • Properties specific to the simulation: »
  • "SimulationInterval"simulation interval {tmin,tmax}
    "SimulationLength"simulation length tmax-tmin
    "NumberOfEvents"number of events in the simulation
    "Events"time points where events occurred
    "Samples"time points when variables were sampled
  • Properties related to values of variables and parameters: »
  • {v1,v2,}simulation for v1, v2,
    {p1,p2,}parameter value for p1, p2,
    "RawData",{v1,v2}time-value pairs for v1, v2,
    "Audio",{v1,v2}Audio object for v1, v2, ...
  • Simulation results for variables vi are returned as functions that can be evaluated for any time t. »
  • Simulation results can be evaluated at a point t with sim[{v1,v2,},t].
  • In sim["RawData",{v1,}], events are indicated by duplicate time-value pairs at the same time point.
  • Complete lists of simulation results and parameter values: »
  • "VariableValues"simulations {v1->f1,}
    "ParameterValues"parameters {p1->c1,}
  • Lists of simulation results from sim can be evaluated at a point t with sim["VariableValues",t].
  • Variables depend on parameters vi[t,pj]; the sensitivity of a variable to a parameter pj is the partial derivative pjvi[t,pj]. Sensitivities can be computed using SystemModelSimulateSensitivity. »
  • Sensitivities can be accessed using {{vi,pi},}.
  • Properties related to sensitivities include:
  • "SensitivityNames"variable parameter sensitivities
    "SensitivityValues"sensitivities {{vi,pi}->gi,j,}
  • The option TargetUnits controls the unit of simulation results:
  • Noneno unit (default)
    "Unit"unit defined in model
    "DisplayUnit"display unit defined in model
    unitexplicit unit
    {unitt,unit}units for time and data

Examples

open allclose all

Basic Examples  (2)

Simulate a model:

Get all variable names in the model:

Get the trajectory of one variable:

Get trajectories for all variables:

Show the simulation interval:

Simulate a model:

Get all variable names in the model:

Plot simulation results using SystemModelPlot:

Alternatively, extract the data and use other plotting functions:

Scope  (21)

Model Properties  (8)

Get a list of all possible properties of a simulation data object:

Simulate a model:

Get all variable names in the model:

Get all parameter names in the model:

Simulate a model:

Get names of stored plots in model:

Show a stored plot:

Simulate a model:

Get variable names matching a pattern:

Get parameter names matching a pattern:

Get the state variables from a simulation:

Plot the sensitivity of the state variable with respect to a parameter:

Simulate a model:

Show the full name of the model that was simulated:

Plot variables and use a short model name as a label:

Get descriptions for variables and parameters in a simulation:

Get the model that was simulated:

Show the name of the model:

Simulation Properties  (4)

Show the time interval of a simulation:

Use the simulation interval property to specify a plot interval:

Show the length of a simulation between 2 and 7 seconds:

Simulate a model with events:

Study the complexity by looking at the number of events during simulation:

Get the time points of all the events:

Use time points when variables were sampled to retrieve values that are not interpolated:

Retrieve the sample points:

Retrieve a variable at these sample points:

Variables and Parameters  (7)

Pick out variables and parameters:

Get the functions for two variables:

The values of two parameters:

Retrieve simulation results with units:

Use the base unit from the model:

Use the display unit defined in the model:

Retrieve raw data from a simulation:

Retrieve the time-value pairs for a loss power variable:

Find the point where the variable is the largest:

Show the largest point on the complete variable trajectory:

Simulate a model with arrays:

Retrieve the 2×2 matrix v.x as a vector-valued function:

Plot the elements of the vector:

Retrieve the two elements of vector v[1].x:

Use variable and parameter rules to get data:

Pick out simulation trajectories for two variables:

Get replacement rules for all parameters in the model:

Simulate with sensitivities:

Get simulation and sensitivity values:

Find the nominal value of the parameter:

Plot the variation for :

Retrieve audio from a model of a "middle A" sine wave:

Simulate for one second:

Retrieve the Audio for the output:

Dynamic Diagrams  (2)

Show the dynamic model diagram at time 2:

Show an animation of the diagram over the complete simulation:

Show the diagram while controlling a few options:

Show the dynamic model diagram for a component at time 2:

Show an animation of the component diagram over the complete simulation:

Options  (1)

Target Units  (1)

Produce raw data with the units defined in the model:

Produce raw data with a specific canonical unit:

Applications  (9)

Show the events in a simulation of a bouncing ball:

Show the event times in a plot of the height:

Compute the inverse function to an InterpolatingFunction from SystemModelSimulationData:

Pick out one InterpolatingFunction and compute its inverse:

Plot the result:

Find maxima in a simulation:

Plot a variable:

Search for the highest points:

Show the results:

Analyze several variables:

Use several simulations:

Calculate a number of metrics for simulation data:

Plot the function:

Calculate the 1-norm TemplateBox[{f, 1}, Norm2]=int_0^3TemplateBox[{{f, (, t, )}}, Abs]dt:

The 2-norm TemplateBox[{f, 2}, Norm2]=int_0^3TemplateBox[{{f, (, t, )}}, Abs]^2dt:

The RMS-norm TemplateBox[{f}, Norm]_(RMS)=sqrt(1/3 int_0^3TemplateBox[{{f, (, t, )}}, Abs]^2dt):

Simulate bouncing balls dropped from different heights:

Animate the balls and their heights in a plot:

Visualize with ParametricPlot3D:

Filter simulation data with LowpassFilter:

Extract the raw data of a variable:

Create a TimeSeries and plot together with the lowpass filtered signal:

Properties & Relations  (1)

SystemModelSimulationData can be created in SystemModeler and imported into the Wolfram Language:

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

Text

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

CMS

Wolfram Language. 2018. "SystemModelSimulationData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SystemModelSimulationData.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_systemmodelsimulationdata, author="Wolfram Research", title="{SystemModelSimulationData}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/SystemModelSimulationData.html}", note=[Accessed: 11-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_systemmodelsimulationdata, organization={Wolfram Research}, title={SystemModelSimulationData}, year={2018}, url={https://reference.wolfram.com/language/ref/SystemModelSimulationData.html}, note=[Accessed: 11-December-2024 ]}