64
2 Description of the Wolfram SystemModeler
difference on the two sides of the resistor. These variables implement the second
Kirchhoff rule.
Example of declaring a connector that can serve to connect hydraulic components:
connector Liquid
Modelica.SIunits.Pressure p; // Pressure
flow Modelica.SIunits.VolumeFlowRate q;
// Volume flow rate
end Liquid;
More details about the description of connectors in the Modelica language can be
found in [4].
So let’s continue the creation of the component model. Create a new model, and
open an empty layer in the Diagram View. Note that you need to go from Text to
Diagram View.
To view the package structure of the built-in Modelica library, you need to use
the Class Browser window.
Double-clicking on the package name will open its hierarchical structure and
display the contents in the Class Browser window. Double-clicking on the model
name will open the model in the Class Window. Additional information about models
in the Modelica libraries is integrated into packages and models and can be displayed
by right-clicking on any of the packages or models in the Class Browser window
and then choosing View Documentation from the pop-up menu. This way you can
get information about any component from the Libraries Modelica built-in library.
In addition to the built-in library Libraries Modelica and the library of Examples,
the Class Browser window displays the latest models created by you and recently
used components.
Open the Modelica Standard Library, and find the Mechanics.Translation
Library, as shown in Fig. 2.40a.
Double-clicking on the Class Documentation button will open a window with full
information on the model or package, as shown in Fig. 2.40b. On the other hand,
Fig. 2.41 presents a window with documentation on the entire package of mechanical
components of the built-in library Libraries Modelica.
Find the Fixed component in the Components section, and drag it onto the
diagram layer, as shown in Fig. 2.42.
To make the component model diagram visually match the physical description
of the model, you can rotate the Fixed component by right-clicking the component
and selecting it, and then rotate it with the Rotate Right function (or simply press
Ctrl + R), as shown in Fig. 2.43.
If everything was done correctly, then as a result you will see a component rotated
90
◦ , i.e., modeling in this case the side mounting to the wall, as shown in Fig. 2.44.
The next step is to add components to simulate the spring and damper. You can
use two different components; however, there is a component in the library that
2 Description of the Wolfram SystemModeler
difference on the two sides of the resistor. These variables implement the second
Kirchhoff rule.
Example of declaring a connector that can serve to connect hydraulic components:
connector Liquid
Modelica.SIunits.Pressure p; // Pressure
flow Modelica.SIunits.VolumeFlowRate q;
// Volume flow rate
end Liquid;
More details about the description of connectors in the Modelica language can be
found in [4].
So let’s continue the creation of the component model. Create a new model, and
open an empty layer in the Diagram View. Note that you need to go from Text to
Diagram View.
To view the package structure of the built-in Modelica library, you need to use
the Class Browser window.
Double-clicking on the package name will open its hierarchical structure and
display the contents in the Class Browser window. Double-clicking on the model
name will open the model in the Class Window. Additional information about models
in the Modelica libraries is integrated into packages and models and can be displayed
by right-clicking on any of the packages or models in the Class Browser window
and then choosing View Documentation from the pop-up menu. This way you can
get information about any component from the Libraries Modelica built-in library.
In addition to the built-in library Libraries Modelica and the library of Examples,
the Class Browser window displays the latest models created by you and recently
used components.
Open the Modelica Standard Library, and find the Mechanics.Translation
Library, as shown in Fig. 2.40a.
Double-clicking on the Class Documentation button will open a window with full
information on the model or package, as shown in Fig. 2.40b. On the other hand,
Fig. 2.41 presents a window with documentation on the entire package of mechanical
components of the built-in library Libraries Modelica.
Find the Fixed component in the Components section, and drag it onto the
diagram layer, as shown in Fig. 2.42.
To make the component model diagram visually match the physical description
of the model, you can rotate the Fixed component by right-clicking the component
and selecting it, and then rotate it with the Rotate Right function (or simply press
Ctrl + R), as shown in Fig. 2.43.
If everything was done correctly, then as a result you will see a component rotated
90
◦ , i.e., modeling in this case the side mounting to the wall, as shown in Fig. 2.44.
The next step is to add components to simulate the spring and damper. You can
use two different components; however, there is a component in the library that
