WSMLink`
WSMLink`

WSMParametricSimulateValue

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

WSMParametricSimulateValue["mmodel",v,{p1,p2,}]

simulates "mmodel" for the variable v with parameters pi.

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

simulates "mmodel" for multiple variables vi.

WSMParametricSimulateValue["mmodel",vars,tmax,]

simulates from 0 to tmax.

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

simulates from tmin to tmax.

Details

  • WSMParametricSimulateValue 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.
  • WSMParametricSimulateValue takes the same options as WSMSimulate.

Examples

open allclose all

Basic Examples  (4)

Load Wolfram SystemModeler 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 z with respect to the initial value of y:

Plot the solutions for several different values of the parameter:

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

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  (3)

Optimize parameters for maximizing a throw by a trebuchet:

Retrieve a parametric function for the thrown distance, varying release time and rope length:

Maximize the throwing distance, constraining parameters to reasonable ranges:

Simulate using the optimal throwing parameters:

Show the distance until the first bounce:

Plot the trajectory of the thrown object using a stored plot:

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:

Fit model parameters to mean of many measurements:

Create parametric functions for concentration variables based on parameters k1, k2 and k3:

Define a fitting function that evaluates at a time and parameter set:

Define the measurement data:

Show the data and its distribution:

Compute the mean of the measurements at each time point:

Compute the standard deviation of measurements at each time point:

Construct the data to fit against from the mean of measurements:

Weight each time point based on the standard deviation:

Fit parameters against the data:

Extract the best-fitting parameters:

Show the found fit together with all the measured data:

Properties & Relations  (2)

WSMParametricSimulate works like WSMParametricSimulateValue but returns a list of rules:

WSMParametricSimulateValue returns a single parametric function:

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%: