WSMModelData
WSMModelData["mmodel"]
gives a diagram representation of the model "mmodel", usable as input to other functions.
WSMModelData["mmodel","property"]
gives the specified "property" for the model "mmodel".
Details and Options
- WSMModelData["mmodel","Properties"] gives a list of possible properties.
- Properties related to the whole model: »
-
"Description" top-level description of model "Diagram" diagram view of model "Icon" icon view of model "ModelicaText" show Modelica model code "ModelName" fully qualified path of model "LocalPlotNames" names of plots saved locally in model "PlotNames" names of plots, including inherited "SourceFile" file where the model is saved "Summary" model summary data - "ModelicaText" creates a cell with style "Program" containing the textual form of "mmodel".
- With a text-based interface, "ModelicaText" returns the textual form of "mmodel" as a string.
- WSMModelData[{"mmodel","c1","c2",…}, "Diagram"] shows the diagram for component "c1.c2...ci" in "mmodel".
- WSMModelData["mmodel",{property,options}] accepts the following options for property "Diagram" and "Icon":
-
Frame True show frame FrameTicks False show frame ticks GridLines None what grid lines to show PlotRange Automatic plot range in mm PlotRangePadding Automatic padding in mm - GridLines->Inherited inherits the grid defined in the model diagram. »
- PlotRange->Automatic specifies a plot range that encloses the primitives drawn in the diagram.
- PlotRange->Inherited inherits the page size specified in the model diagram. »
- Properties related to equations and variables: »
-
"SystemEquations" differential and algebraic equations "InitialEquations" initial value equations "StateVariables" differentiated variables "AlgebraicVariables" non-differentiated variables "SystemVariables" state and algebraic variables "InputVariables" variables specified as inputs "OutputVariables" variables specified as outputs "ParameterNames" parameters "DiscreteVariables" variables changing only at events - "SystemEquations" gives equations depending on t.
- WSMModelData["mmodel","SystemEquations",t] gives equations depending on t.
- WSMModelData[…] contains Missing[type,content] for any parts of equations that cannot be represented.
- "InputVariables" are distinct from "SystemVariables", and "OutputVariables" are a subset of "SystemVariables".
- "DiscreteVariables" are a subset of "SystemVariables", and are given in a form suitable as a setting for the DiscreteVariables option to NDSolve.
- Properties related to values: »
-
"ParameterValues" parameter rules {p1->val1,…} "InitialValues" initial value rules {v1->val1,…} "GroupedInitialValues" initial values grouped by state, input, and output - For variable and parameter lists, WSMModelData["mmodel",{prop,patt}] returns the elements of prop whose Modelica form match the string pattern patt.
- Properties related to the structure of the model:
-
"BaseClasses" classes the model extends "Components" model components "Connections" model connections "Connectors" model connector components "LocalComponents" components defined locally in model - Properties related to relations with other models:
-
"ExtendingClasses" classes that build upon this model "InstantiatingClasses" classes that use this model as a component - The shortest unique model name mmodel can be used where WSMNames["*.mmodel"] gives a unique match.
- The following options can be given:
-
Method Automatic methods for equation processing - Possible settings for "opti" in Method->{"opt1"->val1} include:
-
"Elimination" All eliminate simple equations "ReduceIndex" True reduced index of DAEs in balanced models "StartTime" 0 simulation start time
Examples
open allclose allBasic Examples (4)Summary of the most common use cases
Load Wolfram System Modeler Link:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-3qjmkz
Show a model represented by a diagram:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-ckywz8

Use the diagram representation as input:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-3hage


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-b6izoh

Get the differential equations for a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-d9znhd

Scope (30)Survey of the scope of standard use cases
General Properties (12)
Show a list of possible properties:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-g14mpi

Get the description of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-cz7biy


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-dcrpac


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-n2duia


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-fllke4

Get the diagram of a component in a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-oqskcd

Increase the PlotRangePadding for a diagram:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-rbh5co

Show the diagram of a model without a frame, using the page size from the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-hltvch


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-4lg7hc

Show the text view of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-dzjcz3
Get the path of the file containing a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-wzyhhm

Get the names of saved plots in the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-iaz2x6

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-pgei9z

Simulate and show a saved plot:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-qilkkl


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-9isyqm

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-bahuzv

There are no plots saved locally in the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-77mkv9

The saved model comes from the base class:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-rtqela


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-cjkxen

Retrieve the model name of a diagram representation:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-d655vc

Variables and Equations (9)
Get the system equations of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-72ee5

Get the initial equations of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-fw3v6y

Get all state variables of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-dhoyio

Get a list of all algebraic variables in the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-lmeh03

Get a list of all system variables in the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-d12m7a

Get a list of all input variables in the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-tqsj2b

Get a list of all output variables in the model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-p7rcfu

Get the discrete variables of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-yu6pt

Get all parameter names of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-hd4drc

Initial and Parameter Values (3)
Get all parameter values of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-cmvnhe

Get all initial values of a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-fd8olg

Get initial values grouped by state, input, and output:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-rcrppa

Naming (2)
By default, equations use t as the time variable:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-cngju5

Get the differential equations depending on a chosen variable:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-gy68i2

Get parameter values matching a pattern:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-r5qdu

Structural Properties (4)
Get the classes a model builds on:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-jf0xe0

Get the components and connections in a DC motor model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-mth9xq

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-z98ph0


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-xiy7bl

Get the components locally declared in a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-itc8r4

"Components" includes inherited components:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-ma9zle

Get the connectors in a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-fpf8ro

Options (3)Common values & functionality for each option
Method (3)
Use a custom start time in initial equations:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-q9xgje

The Method option "Elimination" can be used to eliminate redundant equations:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-rcavqz

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-ewdp7r

Elimination can greatly reduce the number of equations:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-durr3

Disable index reduction with the method option "ReduceIndex":

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-nolh3i

Applications (4)Sample problems that can be solved with this function
Solve equations using NDSolve:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-bhs4h4

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-b1t7s
Construct initial equations from an initial values list:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-cxjd59

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-i5owp


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-clkap2

Solve equations using DSolve:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-b6jqus
Get the equations and system variables:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-l8at9q


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-jc01kp


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-e00uct

Combine the equations and replace all parameters with their default values:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-czbn56

Solve the system and plot the result:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-fk1rfk


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-gk3iqo

Find an equilibrium point for a model:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-j5qzr7

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-fjqrd5

Set derivatives to zero and solve:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-ib2tmk

WSMFindEquilibrium gives the same result:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-nrxxrd

Use the differential equations to study the behavior of a damped pendulum:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-rfsk2

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-cfxf1o

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-hrjws5

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-clhqzc

Properties & Relations (3)Properties of the function, and connections to other functions
Compare the solutions from WSMSimulate and NDSolve:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-henk5h

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-pi9ke

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-ghtb0l

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-ddbt0s
Solve using NDSolve:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-bl02j5
Solve using WSMSimulate:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-h9cvuq

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-eakxc7

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-j8t3th

A model is represented by its diagram:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-bkk3gf

The diagram representation evaluates to WSMModelData["modelname"]:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-gmrltu

The diagram representation can be used directly as input in other functions:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-f6gdao


https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-nwc40

A diagram of a component may be different than a diagram of the component class:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-5kdhjo

The motor class itself does not have parameters set:

https://wolfram.com/xid/0g0htzbt3k4oefob7r6l4iid1ya-vzgg7o
