Getting Started with Model Simulation and Analysis
System modeling functionality is included in the Wolfram Language, allowing simulation and analysis of real-world phenomena in many domains.
The full Wolfram SystemModeler product also includes dedicated graphical user interfaces for model creation, exploration, simulation and analysis.
SystemModeler comes with bundled examples from many domains and of varying complexity. All the bundled examples can be explored and simulated using the SystemModelExamples command. Evaluate the cell below to create the interactive example browser.
System models in the Wolfram Language are represented with a SystemModel. Models are available either from other functions like the SystemModelExamples above or referring to them by their name as a string.
The resulting object can be copy-pasted, used in inputs to other functions and queried for properties.
SystemModelSimulate runs a simulation of a model created in the Model Center and returns a SystemModelSimulationData object. SystemModelPlot is used to visualize results from that simulation.
simulate the model
object containing simulation results
show stored plot "MyPlot" from the SystemModelSimulationData sd
plot variables vi
Basic Simulation and Plotting
To simulate a model, use the command SystemModelSimulate with the model as the argument.
The output from SystemModelSimulate is a SystemModelSimulationData object. This object can be used in SystemModelPlot to plot variables from the simulation. For many example models, there are stored plots defined by the model creator. These can be listed using the "PlotNames" property of the simulation result.
Such a plot can easily be shown in SystemModelPlot.
Plot two variables using SystemModelPlot.
Simulate again, changing two parameters using "ParameterValues" and compare a result variable between the simulations.
Multiple simulations for a number of values of a parameter are automatically done in parallel. Simulate a bouncing ball with different amounts of bounciness "e".
By retrieving the simulation results as data, results can be visualized and analyzed in many ways—for example, by plotting the results from a Chua circuit on a ParametricPlot.
A Lorenz attractor makes for a beautiful simulation result with ParametricPlot3D.
In addition to driving simulations of models from the Wolfram Language, it is also possible to work with the model more directly. SystemModel is used to retrieve information about models, and FindSystemModelEquilibrium and SystemModelLinearize are used to obtain equilibrium points and linear state-space representations.
retrieve information about model
find equilibrium points for model
get a linear state-space representation of model
Equations from Model
Retrieve information about a model with SystemModel. First, get an overview of the model information.
There are a large number of properties of SystemModel that can be used to get information about the model.
Equilibrium Points and Linear Representation
Use FindSystemModelEquilibrium to find an equilibrium point for a model of a mixing tank.
The function SystemModelLinearize gives a linear state-space representation of a model at an equilibrium point. The result is a Wolfram Language StateSpaceModel.