WSMLink`
WSMLink`

WSMParametricSimulate

WSMParametricSimulate is being phased out in favor of SystemModelParametricSimulate, which was introduced experimentally in Version 11.3.

WSMParametricSimulate["mmodel",{v1,v2,},{p1,p2,}]

simulates "mmodel" for variables vi with parameters pi.

WSMParametricSimulate["mmodel",vars,tmax,]

simulates from 0 to tmax.

WSMParametricSimulate["mmodel",vars,{tmin,tmax},]

simulates from tmin to tmax.

Details and Options

  • WSMParametricSimulate gives results in terms of WSMParametricFunction objects.
  • The "mmodel" refers to the fully qualified Modelica name.
  • The shortest unique model name mmodel can be used where WSMNames["*.mmodel"] gives a unique match.
  • WSMParametricSimulate takes the same options as WSMSimulate.

Examples

open allclose all

Basic Examples  (4)

Load Wolfram System Modeler Link:

Get a parametric solution for z with parameter a:

Evaluating with a numerical value of a gives an approximate function solution for z:

Evaluate at a time t=10:

Plot the solutions for several different values of the parameter:

Get a parametric solution for the z with respect to the initial value of y:

Get the parametric function for z:

Plot the solutions for several different values of the parameter:

Show the sensitivity of the variable z to the parameter a:

Get the parametric function for z:

The sensitivity with respect to increases with time:

Options  (1)

Method  (1)

Use Method to choose the underlying solver:

Use the DASSL solver:

Use ParametricNDSolve as the solver:

ParametricNDSolve is often faster than other solvers:

Applications  (1)

Calibrate parameters in a model by comparing to measurement data:

Compute a parametric function for the inertia variable measured:

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:

Properties & Relations  (2)

WSMParametricSimulateValue works like WSMParametricSimulate but returns just a parametric function:

WSMParametricSimulate returns a list of rules:

WSMSimulateSensitivity can be used to easily compute parameter sensitivity:

Show the sensitivity of a signal to relative changes in a parameter:

Plot bounds for y and z when varying a by 10%: