Initial Values of Variables

1 Point


2 MyPoints

A Modelica variable is either statically allocated and instantiated or is dynamically instantiated. The start value of a variable is the default initial value of the variable. A start value can be specified for the Points in MyPoints. On the other hand, since x, y, and z are parameters, it is not very relevant to specify start values since they are constant. However, we do that anyway.



3 Flatten MyPoints


4 Simulation of MyPoints


Try to plot the constant parameter point1.x:




5 Using Modifiers to Set Parameter Values of MyPoints

Instead of specifying the value of parameters in point1 in MyPoints this can be done using modifiers in MyPoints2Inst. This can be done in two different ways, which is shown in the classes MyPoints2Inst and MyPoints2Inst2 below.




Flatten it to observe the result:



Here is another example using nested modifiers



Flatten that one too:



6 Arrays

The class Arrays below contains a few declarations with different of combinations of array dimension descriptors and modifiers.