WOLFRAM SYSTEMMODELER LINK PACKAGE SYMBOL

WSMSimulationConnection

WSMSimulationConnection[]
represents a connection to a SystemModeler simulation.

DetailsDetails

  • A is typically created by functions such as WSMRealTimeSimulate and WSMRealTimeConnect.
  • In standard output format, status and control buttons for the simulation are displayed.
  • gives a list of possible properties.
  • Simulation properties are obtained from .
  • Properties of the simulation:
  • "StopTime"simulation stop time
    "ModelName"name of simulation model
    "IP"IP address of the simulation
    "Port"port of the simulation
  • Properties related to simulation state:
  • "State"current simulation state
    "Time"current simulation time
    "NumberOfEvents"number of events generated
    "NumberOfEvaluations"number of evaluations performed
  • Possible simulation states from the property are:
  • "Unknown"unknown state
    "NotStarted"initial state, simulation time is 0
    "Running"simulation time is increasing
    "Paused"simulation time is paused
    "Disconnected"the Wolfram Language is disconnected from the simulation
  • Properties related to variable names:
  • "VariableNames"list of all variable names
    "ParameterNames"list of parameter names
    "InputVariables"list of input variables
  • Properties related to simulation control:
  • "Start"start or resume simulation
    "Pause"pause simulation
    "Stop"stop simulation
    "Close"disconnect the Wolfram Language from the simulation
  • Properties related to simulation data:
  • {"v1","v2",}list of variable values
    "SimulationData"WSMSimulationData object
    "Diagram"dynamic diagram of model

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Load Wolfram SystemModeler Link:

In[1]:=
Click for copyable input

Launch a simulation of the model:

In[1]:=
Click for copyable input
Out[1]=

Show a real-time plot of the last 3 seconds of variables through :

In[2]:=
Click for copyable input
Out[2]=

Start the simulation:

In[3]:=
Click for copyable input

Stop the simulation:

In[4]:=
Click for copyable input

Launch a simulation of the model:

In[1]:=
Click for copyable input
Out[1]=

Start the simulation:

In[2]:=
Click for copyable input

Pause the simulation:

In[3]:=
Click for copyable input

Show the simulation time:

In[4]:=
Click for copyable input
Out[4]=

Stop the simulation:

In[5]:=
Click for copyable input

Launch with a simulation time of 20 seconds:

In[1]:=
Click for copyable input
Out[1]=

Check the stop time:

In[2]:=
Click for copyable input
Out[2]=

Dynamically show the value of the variable in the simulation:

In[3]:=
Click for copyable input
Out[3]=

Start the simulation and watch the variable change:

In[4]:=
Click for copyable input