WSMInitialValues

WSMInitialValues
is an option for functions such as WSMSimulate that specifies initial values for variables.

DetailsDetails

  • Setting WSMInitialValues->{v1->a1,} sets initial values vi to ai in the simulation or model.
  • WSMInitialValues corresponds to the start property in the model.
  • Using WSMInitialValues for a simulation does not recompile the model.
  • Setting WSMInitialValues->{vi->{a1,a2,},} runs simulations in parallel, with vi taking initial values aj.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Load Wolfram SystemModeler Link:

In[1]:=
Click for copyable input

Simulate with default initial values:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=

Modify x to have initial value 3:

In[4]:=
Click for copyable input
In[5]:=
Click for copyable input
Out[5]=

Simulate with a range of initial values:

In[1]:=
Click for copyable input

Vary the initial angles of the balls in the cradle:

In[2]:=
Click for copyable input

The angles of the first and last ball in the cradle for different initial angles:

In[3]:=
Click for copyable input
Out[3]=

Create a model with a start value for a variable:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input