2.5 Basics of Component Modeling in WSM
63
numeric values. In this case, the variables will get the values according to their order
when they are declared. For example:
CylinderVolume(0.5, 12.0); // radius=0.5, length=12.0
CylinderVolume(12.0, 0.5); // radius=12.0, length=0.5
CylinderVolume
(length=12.0,radius=0.5);
// radius=12.0, length=0.5
More complete information about the functions can be found in [4].
Let’s turn to component modeling. We assemble the circuit from the finished
components, setting the same initial values for the mass, stiffness, and initial values
of the velocity and displacement.
Consider the rules for creating a diagram of the component model. To do this, we
need to find suitable components, drag the found components into the diagram area,
and connect all the components together using the Connection Line Tool.
That is, we need the availability of ready-made components and connecting interfaces that provide connection to other components. It will show how easy it is to add
connecting interfaces using the Connection Line Tool. Also, certain parameters can
be set for the components, which makes their further use more flexible.
The Modelica Connection Line Tool is a connector class, which is a special
type of class that serves to communicate between components. A connector, unlike
model or block types, cannot have equations and contains only variables involved
in relationships. Common syntax for defining a connector:
end ConnectorName;
connector ConnectorName
"Description of the connector"
// Variables are declared here.
If you plan to use a connector to create directional links, you must declare variables
with input or output attributes to declare input and output variables, respectively.
For non-directional links, i.e., for physical modeling, there are two types of
variables.
The first type is “potential” variables or contacts. Typical examples of potential
variables are temperature, voltage, and pressure. Changes in these variables usually
lead to dynamic behavior in the system. These variables implement the first Kirchhoff
rule.
The second type is “pass-through” variables or streams. Flow variables are usually
a flow of some conservative value, such as mass, momentum, energy, and charge.
These flows are usually the result of some difference in all variables in the component
model. For example, the current flowing through the resistor is through the voltage
Précédent

- 76/274

Suivant