60
2 Description of the Wolfram SystemModeler
We write the code on Modelica, providing the ability to change parameters such
as spring stiffness and resistance coefficient and initial conditions—the offset from
the equilibrium position and the initial velocity. To do this, we need to introduce into
consideration concepts such as the type of data on the level of variability.
In the Modelica language, the principle of variability takes place; that is, all
data has its own level of variability. By variability, data is divided into variables,
parameters, and constants.
Variables. Used for time-dependent data, that is, their value changes during the
execution of a computational experiment; a set of variables describes the state of the
object being modeled. Variable declaration is as follows:
Real x;
Variables of the same type can be grouped together using the following syntax:
Real x, y;
A declaration may also be followed by a description, for example:
Real alpha "angular acceleration";
Parameters get their value before performing a computational experiment and do
not change during it, often used to configure objects of the same class. Parameters
are declared using the parameter keyword:
parameter Real x;
Constants. Constants, like parameters, are initialized before performing a computational experiment and do not change during it, but unlike parameters, their value
cannot be “set” manually. Constants are declared using the constant keyword:
constant Real x;
Précédent

- 73/274

Suivant