Tutorials: Tutorial 17 - Getting Started With Modelica Edition
Tutorials: Tutorial 17 - Getting Started With Modelica Edition
Objective
This tutorial gives an introduction to the SimulationX Modelica Edition, Opening Modelica
explaining the first steps from opening existing models and packages to files & packages
modeling including result interpretation. For a better illustration of the process, a
simple one mass oscillator will be built up using elements from the Modelica
Standard Library. Modeling with
Modelica Standard
Library
Before we start
Ensure you have addressed at least one entry in the Modelica search path. It can Editable Modelica
be changed via the menu Extras Options Directories. To have the Modelica code created
Standard Library units available you should furthermore add the path of the automatically
Modelica Standard Library into the Modelica search path.
Versatile analysis
possibilities
Workflow
Result Window
Result
Manager
Model Explorer
Output
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
Page 3 of 11
3rd: Define
Library Bar
settings
1st: Right-click on
the desired example
2nd: Open as
SimulationX
Model (Copy)
With the help of the Library Bar settings you can define your specific standard actions. Therewith, it
is possible to open Modelica examples as SimulationX model via double-click as you might know
from Dymola®. Furthermore, you can decide whether name or comment of the model or even both
shall be displayed in the library tree.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 4 of 11
The definition of the properties and parameters of the sliding mass has to be carried out in three
steps:
1. Open the property window via double-click on the element
2. Set the mass in the tab Parameters to 100 kg
3. Switch to the tab General and change the name to Mass
... as seen in figure 5.
The next step is to set the properties and parameters of the spring damper. Therefore, the spring
constant and the damping constant have to be defined including their specific quantities.
1. Open the property window of the element springDamper1
2. Open the Attribute Window and change the quantity with the help of the drop-down
menu to Linear Stiffness. Set the value to 10000 N/m. Equivalent quantities can be chosen
via the drop-down menu
3. Set the quantity of the damping constant to Linear Damping, the value to 100 Ns/m
4. Change the name of the element to SpringDamper
1st: Open
Property
Window
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 5 of 11
Before connecting the elements it is useful to label the pins via the menu View Pin Labels.
Afterwards, the connections can be drawn via left-click at the pin flange_b of the element Mass and
moving the mouse with pressed mouse button to flange_a of the element SpringDamper.
SpringDamper and Restraint are connected in the same way.
Finally, a source to activate the mechanical system is needed. Choose the element ConstantForce
from Mechanics.Translational.Sources, set its parameter Nominal Force to 10 kN and change its
name to Force. To change the given quantity of the parameter use the drop-down menu at the
right-hand side of the Property Window.
Now the model of the one mass oscillator is finished and ready for simulation.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 6 of 11
For a simple demonstration of the possibility of textual modeling we will rotate the element
Restraint. Therefore you just have to change the rotation angle of the placement annotation from
90 to 0 degree as shown in figure 10. After clicking at the Diagram View the clockwise rotation of
the element Restrain is visible.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 7 of 11
1st: Open
Property Dialog
2nd: Set
Simulation time
In order to save space results are not logged automatically. Instead you choose them explicitly
before starting the simulation. Therefore select the element Mass in the Diagram View and activate
the protocol attribute of the absolute velocity v in the Model Explorer.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 8 of 11
Afterwards, right-click on the element Mass and select Results (transient) absolute velocity of
component v as shown in figure 13. A Result Window showing the velocity v of the Mass as a
function of time will be displayed.
2nd: Select
1st: Activate
To add a second result activate the protocol attribute of the absolute position of the center of
component s in the Model Explorer and open the Result Window via drag and drop of the
activation button into the Structure View. To display both results in one common window just drag
and drop the output quantity s – Mass into the Result Window of v – Mass and adjust the window
size.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 9 of 11
Figure 14: Ready for simulation including results velocity and position
Analysis
To display both output quantities in one chart select s – Mass and drag it into the chart of the
velocity v – Mass. By left-click Options Properties Tab: Y-Axes Common Axes you can display
both characteristics on common axes.
For indicating the absolute velocity of the Mass as a function of its position click Options y(x)-
Chart and change the axes. The described plots are shown in figure 16.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 10 of 11
Via the menu View Measure Bar you can measure all kinds of charts by mouse click.
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB
Page 11 of 11
Opening Models
In SimulationX you have several options for opening models. The most obvious method for opening
a model is via the menu File Open or the folder symbol. A second option is to drag the file from
the Windows explorer into the SimulationX Diagram View. The third way to open a model is the
Task Pane which shows a list of the models that were modified recently.
One fact all options have in common is that the model is opened in the same view it was saved
including all result windows.
Open Model
via Task Pane
ITI Headquarters Webergasse 1 ⋅ 01067 Dresden ⋅ Germany ⋅ T +49 (0) 351 26050 0 ⋅ F +49 (0) 351 260 50 155 ⋅ [email protected]
SimulationX For your local representative please visit www.simulationx.com/global
ITI and SimulationX are registered trademarks of ITI GmbH Dresden. © ITI GmbH, Dresden, Germany, 2010. All rights reserved.
® Modelica is a registered trademark of the Modelica Association. For further information please visit www.modelica.org/documents
® Dymola is a registered trademark of Dynasim AB