Documente Academic
Documente Profesional
Documente Cultură
Objective
This tutorial gives an introduction to SimulationX, explaining the first steps from opening existing models and packages to 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. Workflow The following steps have to be carried out
Get to know the Graphical User Interface of SimulationX Open examples of the Modelica Standard Library Create a simple model of a one mass oscillator Run a simulation and analyze the results Open the generated model
Opening Modelica files & packages Modeling with Modelica Standard Library Editable Modelica code created automatically Versatile analysis possibilities
Result Window
Diagram View
Library Bar
Task Pane
Page 2 of 9
With the help of the Library Bar settings you can define your specific standard actions. Therewith, it is possible to open Modelica examples in the Diagram View via double-click. Furthermore, you can decide whether name or comment of the model or even both shall be displayed in the library tree.
Page 3 of 9 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 4.
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. Set the value to 10000 N/m. Equivalent quantities can be chosen via the drop-down menu 3. Set the value of the damping constant to 100 Ns/m 4. Change the name of the element to SpringDamper The element fixed1 is edited in the following way: 1. Turn the element by clicking on the red arrow and moving the mouse with pressed mouse button 2. Change the name to Restraint 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 sales@simulationx.com 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, 2012. 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 9 Visualization of the Modelica Code A useful feature of SimulationX is the Text View option allowing you to edit the Modelica Code. Open the Text View by right click on the tab of the Diagram View and select New Text View. A second view named Model1*:2 shows the Modelica code of the model. SimulationX provides the parallel display of both, the Diagram and the Text View, via clicking at one of the tabs and selecting New Vertical Tab Group. The main steps are shown in figure 7, the result in figure 8.
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 to 0 degree as shown in figure 9. 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 sales@simulationx.com 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, 2012. 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 9
Saving the model When saving your model you can choose between the three file types SimulationX Model (*.ism), SimulationX Project (*.isx) and Modelica File (*.mo) via a drop-down menu. In general, models are saved including all data, comments and results, but you have several options for reducing the required disk space, e. g. by saving the model without results or compressing them (figure 10).
ITI Headquarters Webergasse 1 01067 Dresden Germany T +49 (0) 351 26050 0 F +49 (0) 351 260 50 155 sales@simulationx.com 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, 2012. 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 9
In order to save space and speed up the simulation, 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. Afterwards, right-click on the element Mass and select Results (transient) absolute velocity of component v as shown in figure 12. A Result Window showing the velocity v of the Mass as a function of time will be displayed.
ITI Headquarters Webergasse 1 01067 Dresden Germany T +49 (0) 351 26050 0 F +49 (0) 351 260 50 155 sales@simulationx.com 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, 2012. 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 9
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. Via Extras Options Tab: Modelica you have the additional possibility of setting the check on Switch on recording of all result variables, but this option is only valid for models opened from the library bar.
ITI Headquarters Webergasse 1 01067 Dresden Germany T +49 (0) 351 26050 0 F +49 (0) 351 260 50 155 sales@simulationx.com 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, 2012. 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 9
Figure 13: Ready for simulation including results velocity and position
Now the model can be simulated. Start the simulation using either the start icon in the toolbar, pressing F5 or use the menu Simulation Start. After having finished the simulation run, detailed information concerning the computation time, computed steps etc. are displayed in the output window (figure 14).
Analysis To display both output quantities in one chart select s Mass and drag it into the chart of the velocity v Mass. To display both characteristics on a common axis, left-click View Property Bar, select the Panel and set Y-Axis Common Axis to true. For indicating the absolute velocity of the Mass as a function of its position, click Options y(x)Chart to change the axes. The described plots are shown in figure 15.
ITI Headquarters Webergasse 1 01067 Dresden Germany T +49 (0) 351 26050 0 F +49 (0) 351 260 50 155 sales@simulationx.com 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, 2012. 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 9
Via the menu View Measure Bar you can measure all kinds of charts by mouse click.
Opening Models
In SimulationX you have two 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. One fact both options have in common is that the model is opened in the same view it was saved including all result windows. Further customizing options concerning the opening actions and creation of models and types can be found via Extras Options Tab: Modelica.
ITI Headquarters Webergasse 1 01067 Dresden Germany T +49 (0) 351 26050 0 F +49 (0) 351 260 50 155 sales@simulationx.com 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, 2012. 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.