SystemModeler Link >

WSMSimulate


simulates a model from to .
  • The refers to the Automatic fully qualified Modelica name.
  • The following options can be given:
WSMInitialValuesAutomaticoverriding initial values
WSMInputFunctionsAutomaticoverriding input values
InterpolationOrderAutomaticcontinuity degree of output between events
MethodAutomaticwhat simulation method to use
WSMParameterValuesAutomaticoverriding parameter values
  • The following adaptive step methods can be used:
"DASSL"DASSL DAE solver
"CVODES"CVODES ODE solver
  • Suboptions for adaptive-step methods are given as Method with possible values:
"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 Runge-Kutta method of order 4
  • Suboptions for fixed-step methods are given as Method with possible values:
"StepSize"10^-3fixed step size
Load Wolfram SystemModeler Link:
Simulate a model during the time interval :
Plot the variables and from the simulation:
Simulate a model with different parameters:
Compare the variable between the simulations:
Simulate a model:
Get simulation results for the variables and :
Plot the variables using the Plot function:
Load Wolfram SystemModeler Link:
In[1]:=
Click for copyable input
 
Simulate a model during the time interval :
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Plot the variables and from the simulation:
In[3]:=
Click for copyable input
Out[3]=
 
Simulate a model with different parameters:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Compare the variable between the simulations:
In[4]:=
Click for copyable input
Out[4]=
 
Simulate a model:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Get simulation results for the variables and :
In[3]:=
Click for copyable input
Out[3]=
Plot the variables using the Plot function:
In[4]:=
Click for copyable input
Out[4]=
Initial values for variables can be set with the WSMInitialValues option:
Parameter values can be set with the WSMParameterValues option:
Simulate a model with given input:
Simulate the model that adds two inputs:
Plot the inputs and the output:
Simulate with a changed initial value for the variable :
Simulate for different initial values for the variable :
Plot the variable from all simulations:
Simulate a model with a given input:
Simulate the model that derives the input:
Plot the input and the output:
Simulate with interpolation orders 1 and 3, and 3 interpolation points:
Show the variable:
Use a fixed-step solver:
Plot the result:
Use an adaptive-step solver:
Show the result in a ParametricPlot:
For stiff problems, use an adaptive-step method:
Simulating with too few interpolation points can give inexact plots:
Increasing the number of points gives a better result:
The default step size for a fixed-step solver might be smaller than needed:
Use a larger step size to speed up computation:
The result is comparable:
Change two parameter values:
Check the parameters in the simulation result:
Do a parameter sweep over a voltage offset:
Plot the voltage for all simulations:
Setting ranges for two parameters simulates once for each position in the ranges:
Calculate the overshoot of the height in a tank system:
Find the maximum peak value:
Get the value of the step sent in to the tank:
Calculate the overshoot:
Show the overshoot:
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:
Find the times at which the signal reaches these values:
Calculate the rise time:
Plot lines at the final value, and when the signal reaches 10% and 90% of the final value:
Calculate the settling time for the height in a tank system:
Find 5% bounds on the final value:
Find the time at which the signal stays within these values:
Plot the bounds and the found settling time:
Change parameter values interactively:
Analyze resonance peaks when varying a parameter:
Simulate with varying spring constant:
Compute from :
Show the resonance peaks:
Calibrate parameters in a model by comparing to measurement data:
Set up a criteria function for model fitting:
Fit parameters to the test data:
Simulate with the fitted parameters:
Show the test data and the calibrated model together:
Simulate a low-pass filter with sound as input:
Define an input sound:
Simulate with given input sound:
Retrieve the output and play both to compare:
Simulate a Newton's cradle:
Fetch trajectories from the result:
Visualize the cradle:
Visualize simulated data with a WaveletScalogram:
Simulate the model:
Pick out the data you are interested in:
Compute the wavelet transform:
Plot the wavelet vector coefficients:
The output from is a WSMSimulationData object:
Use properties to get variable trajectories:
Use WSMSimulateSensitivity to also get sensitivities to parameters:
Plot the capacitor's voltage sensitivity to the frequency of :
Use the Van der Pol model:
Simulate and show in a parametric plot: