WSMParameterValues
WSMParameterValues
is an option for functions such as WSMSimulate that specifies values for parameters.
Details and Options
- Using WSMParameterValues for a simulation does not recompile the model.
- WSMParameterValues takes the following values:
-
{p1c1,…} set parameters pi to ci {p1{c1,c2,…},…} run simulations in parallel, with pi taking values cj - Each pi can be either a string or DotName.
Examples
open allclose allBasic Examples (4)
Scope (11)
Simulate (6)
WSMParameterValues is used to set values for parameters in simulation:
WSMParameterValues can be used together with WSMInitialValues:
If a list is given for WSMParameterValues, multiple simulations are run in parallel:
Sweeps with multiple parameters changing can be done with lists of equal length:
Simulate all combinations of a parameter and an initial value:
Create Models (5)
Create a model with one parameter depending on another:
Create a model with a parameter equal to an expression:
Create the Modelica string for a model with parameter values:
Give parameter values for a TransferFunctionModel:
Give parameter values for a StateSpaceModel:
Applications (1)
A real pendulum with length 10 and starting angle is measured to follow this function:
Simulate for a range of different gravitational constants:
Save the angles of the pendulum in the simulations:
The constant 9.82 is closest, so reiterate around that point:
A gravitational constant of 9.82 is closest to the measured one:
Properties & Relations (1)
Initial values for variables can be set with the WSMInitialValues option: