Beruflich Dokumente
Kultur Dokumente
by
Copyright ESI ITI GmbH, 2016
Der Inhalt dieses Handbuches sowie die Rechte an der zugehrigen SimulationX-Software
sind Eigentum der ESI ITI GmbH Dresden und urheberrechtlich geschtzt. Die Vervielfl-
tigung, Verarbeitung auf elektronischen Systemen und Verbreitung des Handbuches oder
der Software beziehungsweise von Teilen davon bedrfen der Zustimmung der ESI ITI
GmbH.
The contents of this manual and the rights to the SimulationX software described therein
are the property of ESI ITI GmbH Dresden, Germany, and are protected by copyright. Any
reproduction, transmission, or electronic processing of the manual or the software or
parts thereof in any manner whatsoever is prohibited.
Use of ESI ITI software is governed exclusively by the terms of contract for software
licensing (GTC Software) of the ESI ITI GmbH. Attention is called to the stipulations
on limited liability contained therein. ESI ITI and SimulationX are a registered trademarks
of ESI ITI GmbH. Any other trademark and product names given in the manual are the
property of their respective owners.
www.simulationx.com
Table of Contents
Using the manuals and the context-sensitive online help you will quickly
understand the comprehensive software package. To facilitate your search for
information as efficiently as possible, the manuals are structured into these parts:
Finally, you will become familiar with the TypeDesigner an excellent and
powerful tool for creating your own element types. Based on the Modelica
language, you can describe completely new types by yourself, extend an existing
element type or create a Compound type by grouping an existing model structure
together.
SimulationX 3 I
User Manual About the Manuals
Legend:
Warning
Hint or Tip
Example or Action
italic Instruction
II SimulationX 3
Table of Contents
Table of Contents
About the Manuals I
Table of Contents III
1 Introduction 1-1
1.1 Fields of Application 1-1
1.2 Solution Concept 1-1
1.3 Scope of Computation 1-2
1.4 Modelica 1-3
1.5 Software Development 1-3
2 Installation 2-1
2.1 Installation - Overview and Basics 2-1
2.1.1 Hard and Software Conditions for SimulationX 2-1
2.1.2 Requirements of Code Export and external Solver 2-1
2.2 SimulationX - Editions 2-3
2.2.1 All editions Overview 2-3
2.2.2 Evaluation version 2-3
2.2.3 The Student Edition 2-4
2.2.4 The Viewer Edition 2-4
2.2.5 The Analyzer Edition 2-4
2.2.6 The Professional Edition 2-4
2.2.7 Change edition 2-4
2.3 Installing SimulationX 2-5
2.3.1 Installation 2-6
2.3.2 Reinstall or Update 2-9
2.4 First start of the program 2-10
2.4.1 SimulationX - Evaluation-version 2-11
2.4.2 Student or Viewer Edition 2-14
2.4.3 Analyzer or Professional Edition 2-14
2.4.4 Migrate Settings from previous Versions 2-14
2.5 Hints for Administrators 2-15
2.5.1 Installation in the Batch Processing (without user Interaction) 2-15
2.5.2 Installations for Program Protection 2-16
2.5.2.1 Hardware Protection (Key / Dongle) 2-16
2.5.2.2 Software protection with license file 2-19
SimulationX 3 III
User Manual About the Manuals
IV SimulationX 3
Table of Contents
SimulationX 3 V
User Manual About the Manuals
VI SimulationX 3
Table of Contents
6 Analysis 6-1
6.1 Transient Simulation in the Time Domain 6-1
6.1.1 Simulation Settings 6-3
6.1.1.1 General settings 6-3
6.1.1.2 Reset Points 6-7
6.1.1.3 Save Model Initialization 6-8
6.1.1.4 Tracing 6-11
6.1.1.5 Solver Settings 6-13
6.1.1.6 Settings for Symbolical Analysis 6-14
6.1.2 Workflow of the Calculation over Time 6-15
6.1.2.1 Global Symbolic Analysis 6-16
6.1.2.2 Calculation of Consistent Initial Values 6-17
6.1.2.3 Homotopy 6-20
6.1.2.4 Time Steps 6-30
6.1.2.5 Events 6-30
6.1.3 Available Solvers 6-32
6.1.3.1 BDF and MEBDF Solver 6-33
6.1.3.2 Fixed Step Solver 6-36
6.1.3.3 CVODE 6-38
6.1.4 Performance Analyzer 6-41
6.1.4.1 Output 6-41
6.1.4.2 Result Interpretation 6-42
6.1.4.3 Handling 6-42
6.2 Animation of Results 6-42
6.2.1 Record a Animation 6-45
6.2.2 Play back the Animation 6-45
6.2.3 Saving of 3D Animations for external Presentation 6-45
6.3 Periodic Steady-State Simulation 6-46
6.3.1 Basics of the Steady State Simulation 6-48
6.3.1.1 Periodic Steady State of a System 6-48
SimulationX 3 VII
User Manual About the Manuals
VIII SimulationX 3
Table of Contents
SimulationX 3 IX
User Manual About the Manuals
X SimulationX 3
Table of Contents
SimulationX 3 XI
User Manual About the Manuals
XII SimulationX 3
Table of Contents
SimulationX 3 XIII
User Manual About the Manuals
9 Interfaces 9-1
9.1 Data formats 9-1
9.1.1 Text Format 9-1
9.1.1.1 Save File 9-1
9.1.1.2 Load File 9-2
9.1.2 IEEE-Binary Format 9-4
9.1.2.1 Save File 9-4
9.1.2.2 Load File 9-5
9.1.3 ITI-Binary Format (*.rfb) and ITI-ASCII Format (*.rfu) 9-7
9.1.4 XML-Format 9-7
9.1.5 DIAdem-Headerformat 9-7
9.2 Interfaces to MS Office, Data Exchange 9-7
9.3 COM Interface 9-7
9.3.1 Classes 9-9
9.3.1.1 Application 9-9
9.3.1.2 Documents (Document) 9-9
9.3.1.3 SimObjects (SimObject) 9-10
9.3.1.4 Connections (Connection) 9-11
9.3.1.5 Parameters (Parameter) 9-11
9.3.1.6 Curves (Curve) 9-11
9.3.1.7 Results (Result) 9-12
9.3.1.8 Selection 9-13
9.3.1.9 ResultWindows (ResultWindow) 9-14
9.3.1.10 NaturalFrequencies 9-15
9.3.1.11 InputOutputAnalysys 9-17
9.3.2 Examples 9-18
9.3.2.1 VBScript Example 9-18
9.3.2.2 Jscript Example 9-19
9.3.2.3 ITI-Script Example 9-20
9.3.3 Code Export via COM Interface 9-21
9.4 Co-Simulation Interface 9-27
9.4.1 Co-Simulation with SimulationX Coupling Element 9-27
9.4.1.1 Description of Communication Protocol 9-27
9.4.1.2 Using Coupling Element in SimulationX 9-29
XIV SimulationX 3
Table of Contents
SimulationX 3 XV
User Manual About the Manuals
XVI SimulationX 3
Table of Contents
SimulationX 3 XVII
User Manual About the Manuals
XVIII SimulationX 3
Table of Contents
12 Definitions 12-1
13 Bibliography 13-1
14 Index 14-1
SimulationX 3 XIX
User Manual About the Manuals
XX SimulationX 3
by
Introduction
Fields of Application
1 Introduction
The software offers sophisticated modeling tools, which permit to image all the
physical-technological relationships in the form of compounded elements. It makes
the software versatile and suitable for new fields of application, and this reflects
the objective of the ESI ITI team to provide you with all the prerequisites and tools
to implement your special know-how in customized models which suit your tasks
best. But there are also general fields of application, which incorporate more than
fifteen years of experience in modeling and simulation, i.e. libraries, sample
models, reference applications and the ESI ITI support team and our partners.
Engineering such as automotive, power transmission and fluid dynamics belongs
to the classical fields of application of the ESI ITI simulation software. The
program is typically used in machine and plant construction, in shipbuilding and
tracked vehicle manufacture and in the aerospace industry. Other applications are
microsystem engineering, planning of off-shore plants, optimization of magnetic
drives, thermal and energy management, fuel cells etc.
The program package supports the overall design process both horizontally and
vertically. By having integrated the modeling and computation of submodels of
various kinds in a common environment, the comprehensive system simulation of
complex components, machines, vehicles and plants becomes possible. Universal
data interfaces, COM programming and cosimulation modules ensure the optimal
further use of calculated data, the CAD connection and connection to CAE tools.
With data bases for parameters, models and variants and optimized interfaces the
step is made from system research to the design with data of real components.
SimulationX 3 1-1
User Manual 1. Introduction
Modelica language provides the modeler with a high degree of freedom for the
description of his systems and processes.
The complexity of model descriptions sets high standards for the computational
tasks during simulation. SimulationX implements a number of analytical and
numerical methods, which lead to a high performance also for sophisticated
models. In several compilation runs the system of differential algebraic equations
(DAE) is subject to a global symbolic analysis, reduction, and simplification. The
resulting compact equation system is handed over to a powerful solver. By default,
the BDF method is used, which ensures a good performance also for stiff systems,
as they often arise from heterogeneous models. The applications to be examined in
industrial practice virtually always contain nonlinearities and in particular
discontinuities. SimulationX considers discontinuities with adjustable precision.
With computation in the time domain (transient simulation) the entire behavior of a
system within a time interval can be examined. Inputs by the system and initial
values defined by the user will be taken into account.
1-2 SimulationX 3
Modelica
For the Steady-State Simulation, for instance, of torsion vibration applications the
tool ITI-STAT has already been offered by ESI ITI. An even more powerful and
more universal analysis procedure has been developed which is now offered as an
option in SimulationX.
On the basis of the functional structure of the model and additional local error
probabilities, SimulationX can generate a model for reliability analysis.
Due to the common model basis the analysis types can be combined in a suitable
way. In addition extensive parameter studies can be made more efficiently with the
Variants Wizard.
1.4 Modelica
Since the language Modelica has already been used for model description in the
SimulationX libraries, SimulationX supports the full language scope of Modelica.
As a SimulationX user you can now benefit from the Modelica standard libraries in
addition to the scope of performances available so far. As a modeling expert you
can draw on extensive language constructs like arrays and records for complex
models to be developed anew.
The models of the standard libraries were tested individually and with regard to
their interaction in complex applications. In the test the solver methods were
subjected to partially extreme requirements. Since the tasks of the user become
more and more demanding, perfecting our software is our daily challenge. Your
experiences, criticism and proposals are welcome. Call our service, we gladly help
you in finding solutions to your issues. Information about our workshops and
trainings is offered in Internet.
SimulationX 3 1-3
User Manual 1. Introduction
ESI ITI wishes you success for your work with SimulationX and a lot of fun with
the simulation.
Dresden, 2016
1-4 SimulationX 3
by
Installation
Installation - Overview and Basics
2 Installation
2.1 Installation - Overview and Basics
The program was developed for Windows operating systems.
If you intend to purchase a new system, ESI ITI recommends a system with
performance parameters that are suitable for tasks in the CAE area. Processor
speed and main memory configuration are the decisive components for this (as a
rule, the more GHz and MB the better).
SimulationX 3 2-1
User Manual 2. Installation
Ext. CE CE Ext. CE CE
Solver for for Solver for for
x86 x64 x86 x64
Microsoft Visual C/C++ 6.0 x x x
Microsoft Visual C/C++ .Net x x x
Microsoft Visual C/C++ .Net x x x
2003
Microsoft Visual C/C++ 2005 x x x x x x
Microsoft Visual C/C++ x x x
Toolkit 20031
Microsoft Visual C/C++ 2008 x x x x x x
Microsoft Visual C/C++ 2008 x x x
Express Edition1
Microsoft Visual C/C++ 2010 x x x x x x
Microsoft Visual C/C++ 2010 x x x3 x3 x x3
Express Edition2
Microsoft Visual C/C++ 2012 x x x x x x
Microsoft Visual Studio x x x x x x
Express 2012 for Windows
Desktop2
Microsoft Visual Studio x x x x x x
Express 2013 for Windows
Desktop2
Microsoft Visual C/C++ 2013 x x x x x x
Microsoft Visual Studio x x x x x x
Community 2013
Microsoft Visual Studio 2015 x x x x x x
Visual C++ 2015 Build Tools x x x x x x
1
free but not more available
2
free, available on www.microsoft.com
Table 2.2: Requirements for external Solvers and code generation during Code Export
2-2 SimulationX 3
We recommend to install the Microsoft Visual Studio 2015 due to the integrated
C/C + + compiler that can be used in SimulationX 64bit without any effort for
additional installation steps.
2.2 SimulationX - Editions
2.2.1 All editions Overview
There is a SimulationX product DVD available for all editions. The respective
edition is activated by selection during the first start of SimulationX.
Edition
Program Function Student Viewer Analyzer Professional
File new x x
File open x x x
File open (encrypted) x x x x
File save x x x
File save (encrypted) x x x
Side preview x x x
Print x x x x
Load user-defined x x x x
Types
Create/Edit user- x x
defned Types
Edit Models x x
(Structure)
Edit Parameters x x x
Control Elements / x x
Momentary Displays
Database Connection x License License
Computation x x License License
3D view x x License License
Script editor x x
Table 2.3: Available (x) Functions in the Editions
SimulationX 3 2-3
User Manual 2. Installation
2-4 SimulationX 3
Installing SimulationX
Click on Edition change to and select an edition for the next program start.
Please mind that Analyzer and Professional Editions need appropriate license code
or key. Table 2.3 gives an overview of the program functions available in the
individual editions.
SimulationX 3 2-5
User Manual 2. Installation
By clicking the other buttons, you can view the documents from the DVD, perform
the identification of your computer or read the ESI ITI software contract. The
identification of your computer in order to request a license file is described in
section 2.5.2.2.
Additional you can install options and plugins by this site.
2.3.1 Installation
After the language selection dialog the Installation Wizard starts and looks for
prerequisites that need to be installed in order to run SimulationX correctly.
2-6 SimulationX 3
Installing SimulationX
In order to continue with the installation, accept the license agreement by clicking
on Next.
The following dialog gives you different options for installing SimulationX:
Complete All features and modules that are available are installed.
The documentation and samples are copied to your hard
drive. To install special modules with prerequisites like the
Isight interface you need to choose the Customized
installation.
When you are installing to a 64bit system SimulationX
will be installed in a 64bit version. When you want to use
the 32 bit version on 64 bit systems please select
Customized here and choose the 32 bit version in the
following dialog.
SimulationX 3 2-7
User Manual 2. Installation
2-8 SimulationX 3
Installing SimulationX
For all modules and features, which are needed, the option Install on a local hard
drive is to choose. When you chose a custom setup, you will be able to select the
target folders for 32 and 64 bit components of SimulationX. The other setup types
will use the default location in Program Files and/or Program Files (x86)
under ESI Group\SimulationX X.Y where X and Y represent the major and
minor product version.
After the selection of the shortcut folder and if you want to install desktop and start
menu shortcuts for all users or the current user only, the installation wizard is
ready to go.
If you have purchased a Professional or Analyzer license with a license file you
have to identify your computer first. The identification is described in section
2.5.2.2.
SimulationX 3 2-9
User Manual 2. Installation
You can use the "Fix SimXLauncher" option to repair the file associations of
SimulationX models (.ism) and SimulationX Projects (.isx) with the
SimXLauncher. The SimXLauncher allows the user to set the SimulationX version
(if multiple versions are installed) that should be used to open SimulationX files.
2.4 First start of the program
When SimulationX is started on your computer for the first time, the program
displays the dialog for edition selection (see Figure 2.12).
2-10 SimulationX 3
First start of the program
Select the desired edition here and click Start. See also Section 2.2.2 to 2.2.6.
After the information that devices with a non-permanent MAC address (e.g. PDAs)
are to be disconnected from the computer, the request dialog (see Figure 2.13)
appears.
Please add your desired test period, planned application fields and personal data.
If an email client has been installed on your system, you can transmit the data
directly. By clicking the Generate button an email is created which you only
need to send (s. Figure 2.14).
SimulationX 3 2-11
User Manual 2. Installation
If your request is received and agreed by ESI ITI, they will email the license file to
you.
The license file can be used after a click on the button Search (cf. Figure 2.12).
Consider please that the license file assigned by ESI ITI works only with the
computer, by which it were requested!
No other installations (drivers, services, etc.) will be required.
Upon each further program start the dialog in Figure 2.15 is displayed with the
end of the test period. During the test period you can change your license file to a
newer one (e.g. with other or more libraries, modules ...). In order to do that, click
the Update... button and select the newer license file. This will update the
existing license file to the newer one.
2-12 SimulationX 3
First start of the program
When the test period has elapsed, a corresponding note appears and the start dialog
is displayed as shown in Figure 2.12. Although the license is expired, you can
request another testing period or still use the program as a Student or Viewer
Edition.
Please note that the license file which ESI ITI provides will only work with the
computer which has requested it!
SimulationX 3 2-13
User Manual 2. Installation
When you purchased a license with hardware key/dongle in the meantime, install
the SimulationX copy protection software first from the product DVD please.
These can be found in the Dongle directory on the DVD. For this purpose the
"SentinelProtectionInstaller.exe" has to be started (for 64-bit systems you use
"SDD_USB_x64_Installer.exe"). The installation is described in detail in
section 2.7.
2-14 SimulationX 3
Hints for Administrators
SimulationX 3 2-15
User Manual 2. Installation
Example:
The automatic installation can be started by the command line dialog (click on
Start/Run):
This can be done after the successful installation of SimulationX. To do this there
are administrative privileges required.
2-16 SimulationX 3
Hints for Administrators
choosing the ITI Software Setup entry in the SimulationX startmenu entry
choosing the SimulationX V.V entry of the desired SimulationX version in
the Programs dialog of the Control Panel
At each item of the bullet list the SimulationX maintenance dialog appears. Now
choose the Install Dongle Software radio button (see Figure 2.19) and press
Next.
Make sure that USB keys are NOT PLUGGED IN while the driver is installed.
AFTER the installation, the key is to be plugged in.
Now the installation of the driver starts. After the Welcome, License
acceptations and Destination selection, select Complete as setup type (cf.
Figure 2.20).
To save disk space, the installation can also be customized. Select the option
"Custom" for this. Next the components which can be installed are to be selected.
SimulationX 3 2-17
User Manual 2. Installation
Please, deactivate the components which are not necessary for your key:
a key for parallel interface does not need a USB-System-Driver
a USB-key does not need a Parallel-System-Driver
Click on the hard-disk icon and select the menu entry This feature will not be
available (cf. Figure 2.21).
2-18 SimulationX 3
Hints for Administrators
If you have to change the standard ports use the following procedure:
Server (computer with attached key)
Change the following options in the file sntlconfigsrvr.xml (default path is
C:\Program files (x86)\Common files\SafeNet Sentinel\Sentinel Protection
server\WinNT)
<ConfigurePort>: new port number for communication
<ConfigureLicenseMonitorPort>: new port number for monitoring
Client (user computer with SimulationX) Change the following options in the
file sntlconfig.xml (default path is the SimulationX program directory)
<ServerPort>: new port number for communication
Make sure that the given ports are unused and that client and server have identical
numbers assigned.
After you transmitted the data to ESI ITI the ITI team will provide the license file
for your computer after your authorization has been verified.
Save the license file on the computer to a directory where all users have write
permission (the license file will consistently be updated).
By default the license file should be saved to the directory "C:\Documents and
Settings\All Users\User Data\ESI Group\SimulationX 3.8".
Furthermore it is possible to place the license file in a network directory on a
server. To do this, start the program CIPro.exe provided on the installation DVD.
Provided by a UNC target path for the license file (e.g. \\server\share\path) it
identifies the respective server and transmits this information to ESI ITI.
After receiving the license file from ESI ITI make sure, it is stored in the exact
location specified earlier and not renamed. The file path is part of the license.
Continue with section 2.8.
SimulationX 3 2-19
User Manual 2. Installation
2-20 SimulationX 3
SimulationX the Licensing
Install all components of the software package according to 2.2.6, 2.2.7 and 2.5.2.
With the first start of SimulationX-Professional Edition or SimulationX-Analyzer
Edition select the connection to your local key (cf. 2.7). Switch off the opening of
the connection dialog with each program start (cf. 2.7).
Install the program SimulationX according to 2.3 on all work stations in which
SimulationX is to run. For this purpose you can use the installation in the batch
processing (cf. 2.5.1).
SimulationX 3 2-21
User Manual 2. Installation
The user selects the connection to the network key with the first start of
SimulationX (cf. 2.7). If only one key is available in the network, it is
recommended to switch off the connecting dialog with each program start (cf. 2.7).
2 Keys on
a computer
For this task you need one other Professional Edition license which includes
Planar Mechanics and Power Transmission (2D),
MBS Mechanist (3D),
Power Transmission (1D),
Electronic (analog) and Magnetics
2-22 SimulationX 3
Selection of a Hardware key / Dongle
Hydraulics and
System Analysis
Because in one key always exactly the same module combination (a function
range) can be saved, ESI ITI supplies two keys for this application.
You install the software in the network according to 2.6.2. Thereby it is irrelevant
whether both keys are plugged in on a computer or on different computers. It is
only important that they are visible in the network.
The user selects the connection to the desired network key when starting
SimulationX (cf. 2.7). With the option "Show this dialog with program start" the
user can decide whether the program is to ask with each start or whether a
preferred setting should be applied up to cancellation (checkmarks to be removed).
The connection can be changed at any time over the menu "Extras/Options" on the
page Licensing through clicks on the control New Connection.
Searching for available keys can be repeated at any time. Click on the appropriate
control in the field Searching available keys. Searching can be done by means
of using host names or by means of IP addresses. Select the appropriate variant
with the radio buttons Hostname based... and IP addresses based...
If you are not sure, which selection is applicable for your system, select the
standard setting Hostname based selection.
SimulationX 3 2-23
User Manual 2. Installation
In the field In the network available keys all available keys are indicated in a tree
structure. The local computer is marked by a red circle.
If you click in the tree structure on a SimulationX key (characterized by the key
Ident of the form <letter><number>- > X ###), important contents of this key are
indicated in the field Selected key. If required license (Analyser and/or
Professional) is currently available, the button Activate this key is enabled.
If you click on this button, the key just selected in the tree is declared as the
Current connection. I.e., when starting SimulationX will use a license of the
current connection (concrete computer, concrete key).
Searching for keys in the network is done over so-called broadcast calls realized
under the slogan: Hello Sentinel ' Im calling - who will answer me. It could
happen that in the network available keys do not indicate all actually existing
keys. A most frequent cause for it is a prohibition of broadcasts in your network. In
this case you cannot select the desired key in the tree structure, as described above.
You have to do the connection manually. For it you click the Button in the
2-24 SimulationX 3
Selection of a Hardware key / Dongle
field current connection. Thereupon the dialog boxes Host and Key are
released for editing. Register the name of the computer and the identity of the key
into the appropriate fields. The selection in the tree structure and clicking the
switching surface this key activate are void.
If SimulationX is used in the batch processing (e.g. over COM) the checkmark
should generally be removed, since always a defined license is to be worked with.
If you click on OK button SimulationX will start. You can also continue to work
in the dialog Options.
You can execute this operation locally by yourself fast and comfortably. You
may order and acquire an update version, ESI ITI will send the update code (a text
file, e.g. by email). After receiving the update code from ESI ITI, please proceed
the following:
1. Store the update code on your hard disk.
2. Start SimulationX (e.g. as a student edition if the validity time of the key has
terminated).
3. Open the dialog Options in the menu Extras Options.
4. Activate the page Licensing.
5. Check in the left upper corner that the correct key used for the update
(cf. Figure 2.29).
If this is not the case (e.g. because you started the Student Edition), select
"Professional (with Dongle)" with Edition Change to first.
Select the key to be updated with New key connection now (the display in
the left upper corner will appear only after a program restart). Open the file
dialog by clicking on the button Update key.
6. Select the stored file (see 1.) and acknowledge the dialog with Open.
SimulationX 3 2-25
User Manual 2. Installation
The key update is accomplished. Before the key update the consistency of the
codes is checked in order to detect data loss with code transfer. In addition it is
examined whether the code is intended for the selected key. The update procedure
is terminated with a message (success or error).
Only one key can be plugged in for updating otherwise an error occurs.
The license file must be added to the management once in particular during the
first start of SimulationX with a license file.
2-26 SimulationX 3
Selection a license file
SimulationX 3 2-27
User Manual 2. Installation
In the section Administrated licenses all license files are listed which you want
to use with SimulationX. For a better transparency every license file can be given a
self-explanatory name.
The license file management must contain one entry at least - you got at least
one license file from ESI ITI which has to be added here.
When you selected a line in the list of managed licenses with a mouse click you
can delete this selected license from the management by clicking the button
Delete selected license. The license file itself will not be deleted by this action.
Editing of the managed license files (e.g. change of the name) is not possible. For
such a purpose delete the file from the management and add it anew.
Highlight a line in the list of the managed license files with a mouse click. In the
dialog area Content of the selected license the most important information -
total number of licenses, available licenses, period of validity, current users,
network ability and validity details (see Table 2.4) - of the highlighted license file
is displayed.
Click Open License Viewer to open the License Viewer dialog of the selected
license file. You get comprehensive information about the license file here.
The button Use this license file is enabled if the highlighted license file is a
valid license file. Clicking this button sets the license file to be the current one and
it will be used at the start of SimulationX.
2-28 SimulationX 3
Specialties for network licenses
If it is not desired that the selection dialog is opened upon every start of
SimulationX (e.g. in the case of a single-user license) remove the tick at "Show
this dialog upon program start". If the dialog is to be shown again open the options
dialog via the menu Extras Options. Go to Licensing. Here you can tick
"Show startup dialog for license selection" again.
Any information in this dialog is user-related. This means that every user of this
computer manages his license files himself.
2.9 Specialties for network licenses
2.9.1 Network licenses with Hard Key
If you have ESI ITI SimulationX network licenses it may happen, that all licenses
are used by other colleagues and you want to know who is currently using the
licenses.
If you have a hard key for license protection, there is the following possibility:
On the computer, where the key is connected to, a license monitor is running (in
addition to the license server). You can connect to the license monitor (see Figure
2.32) using your web browser and entering the address
http://ComputerWithKey:6002
where ComputerWithKey is the name or the IP address of the machine where the
key is connected to.
By clicking on a key number you can retrieve further information about this key (s.
Figure 2.33). It is an unsigned Java applet of the Safenet Inc. (safety set acc).
SimulationX 3 2-29
User Manual 2. Installation
2-30 SimulationX 3
Specialties for network licenses
The edit box will be enabled when you have clicked the edit button and
confirmed warning message.
Attention! Please choose the license renewal interval only as large as necessary
for proper program operation.
Please preconceive that lost licenses can be reused only after a timeout. This
timeout is 150% of the renewal interval.
Entering a license renewal interval = 0 means that default value shall be used.
The default values for the license renewal interval are as follows:
1 Lic. = 4 sec
5 Lic. = 20 sec
10 Lic. = 41 sec
20 Lic. = 84 sec
50 Lic. = 214 sec
100 Lic. = 440 sec
500 Lic. = ca. 40 min
1000 Lic. = ca. 87 min
2000 Lic. = ca. 190 min
How can a suitable license renewal interval be estimated? Assume that the
message traveling time between the license server and a remote computer is p
seconds. The license will have q modules (the number of modules can be counted
in the license viewer), for each a license request will be sent by the remote
computer. All license requests must be processed within the license renewal
interval, i.e.
license renewal interval > p*q seconds.
If more than one license is administrated by the license server, the renewal interval
should be multiplied by the number of licenses.
SimulationX 3 2-31
User Manual 2. Installation
License entries for libraries and options of active users still remain after an
(abnormal) end of the program.
License entries of inactive users remain the Professional, respectively the
Analyzer module.
Both situations can be cleared up.
License entries of active users that are inactive can be deactivated using the
License Viewer.
To realize this, open the License Viewer either from the license selection
dialog of the respective license (cf. 2.8) or for the current license file using
the menu Extras Options Licensing.
Select the entry you want to deactivate and click Deactivate. The entry is
shown within brackets and can now be used again.
Please pay attention that only entries are deactivated which are really not
in use!
2-32 SimulationX 3
Specialties for network licenses
This procedure is only possible if no other user is active. The cleanup button
is enabled; if there are only inactive users (entries in brackets in
Figure 2.35). Click the button to open the license files Cleanup dialog
(see Figure 2.36).
As the number of active and inactive users changes from time to time the
button "Refresh" can be used to get the current number. The "License
Viewer" button opens the license viewer for the current license file.
When you are sure that all inactive users that are shown in the dialog can be
removed, use the Delete all inactive users from license file button. After
that the licenses can be used again.
SimulationX 3 2-33
User Manual 2. Installation
This license files not only can manage multiple users at once, but can also release
unused modules and libraries.
When using such a file SimulationX lets the user decide which modules are to be
used before starting. That way it is possible, that they are still available to
subsequent users.
Add missing modules adds as few missing modules as possible until there are no
conflicts left. In many cases this solution is not unique. Is not satisfactory your
selection, you can still change the selection as required.
2-34 SimulationX 3
Managing license configurations
Remove conflicting modules removes the modules, which require other modules,
which are currently not checked or unavailable.
To speed up finding the modules you need, you can enter parts of the module
name, its description or the type ID of a component it contains in the search text
field to filter the list by these criteria.
After you are done with the configuration, SimulationX starts in the usual manner.
Additionally the user can decide if he wants to decide on which modules to use on
every launch or if the dialog is to be skipped in the future.
2.11 Managing license configurations
All relevant settings made by the user regarding the license can be exported to a
file and be imported in several ways. That is information on:
the edition (see 2.2)
the dongle in use
the license file in use
skipping the license file/dongle/module selection dialogs at program start
license usage log
the selected modules
To create such a file open the settings dialog via the menu Extras/Options. On the
page License click the button Save as XML .... After confirming the message box
summarizing the settings to be exported, the file location is chosen.
SimulationX 3 2-35
User Manual 2. Installation
Local licenses on the client computer are managed through the CodeMeter control
center. The licenses there are labeled CmContainer.
2-36 SimulationX 3
Working with Codemeter Licenses
or in the network. CodeMeter Runtime installation programs are available for both
32-bit and 64-bit Windows.
Alternatively, the CodeMeter Runtime also can be downloaded from our Customer
Center (https://www.simulationx.com/customer-center.html), for example, for an
installation on a server.
The CodeMeter network server runs in the background and must be started
manually upon the installation. To do that, go to
http://localhost:22350/ConfigServer.html and tick the checkbox Run network
server.
SimulationX 3 2-37
User Manual 2. Installation
The user receives a CmDongle from ESI ITI. This can be used immediately.
The user then imports the license information from the file and transfers it onto the
CmDongle through the CodeMeter Control Center.
Based on the provided information, ESI ITI generates a license file and sends it
over to the user.
The user then imports the license information from the file and transfers it into the
container file through the CodeMeter Control Center.
2-38 SimulationX 3
Working with Codemeter Licenses
Overview of the status display in the control center and the taskbar:
Color State
Grey No CmContainer is connected, or CodeMeter License Server
is not started.
Green An activated CmContainer is connected.
SimulationX 3 2-39
User Manual 2. Installation
By navigating to the Home page and clicking on the computer name, you can also
visit configuration pages of other computers in your network.
For more information see the Help page of the CodeMeter WebAdmin.
2-40 SimulationX 3
Working with Codemeter Licenses
The CmFAS Assistant helps you request, update and verify licenses.
When you request a license, a WibuCmRaC file is generated which you then need
to send to support@itisim.com.
Base on this file, ESI ITI will generate a WibuCmRaU update file and sends it
back to you via email. Through the Import function, you can then transfer the file
into the CmContainer.
Upon the successful update, a confirmation is sent to ESI ITI inlcuding the file
support@itisim.com.
SimulationX 3 2-41
User Manual 2. Installation
The WebAdmin GUI helps you manage your licenses. The tab Content shows all
existing containers and the content of each license.
2-42 SimulationX 3
Working with FlexLM licenses
When starting SimulationX for the first time you have to choose the edition and
license medium. Whether you are planning to use a Professional or Analyzer
Edition, select the appropriate entry with CmContainer.
The licenses are addressed in the CodeMeter Control Center as container. In the
following dialog (cf. Figure 2.47) select an available container and activate it for
SimulationX to use it.
By default only the local machine is searched for any CodeMeter containers. To
search for containers on a different machine, simply enter its name and click Start
searching now. For an overview over all containers in the entire network simply
leave the text field empty.
For troubleshooting when using CodeMeter licenses please refer to the section
11.2.
SimulationX 3 2-43
User Manual 2. Installation
When starting SimulationX for the first time you have to choose the edition and
license medium you wish to use.
Figure 2.49: Both Professional and Analyzer Edition of SimulationX are available for
being licensed with FlexLM.
The next dialog determines the location of the license within the network. Choose
the option Specify the License Server System and enter the name of the license
server.
Figure 2.50: The FlexNet License Finder helps locating a SimulationX license in the
network.
2-44 SimulationX 3
To prevent entering this information on every start of SimulationX create a file
containing the following information:
If the above key does not exist, or the string value is empty, then
2. Check the command line parameters, which were passed along to
SimulationX when it was started. If the parameter /config:"Path\Filename"
was given, use this path to load the configuration file.
This option enables users to place shortcuts on their Desktop or Start Menu
SimulationX 3 2-45
User Manual 2. Installation
In any other case, the license configuration source is not changed during the
runtime of SimulationX.
2.14.1.2 Write-protection
Depending on the source of the configuration there come along user rights for
changing the settings:
2-46 SimulationX 3
License Configuration (for Administrators)
User Documents No
Public Documents No
HKEY_CURRENT_USER Yes No
So if the user is allowed to change the licensing settings, he or she can change the
edition and the license medium or add modules. Conversely using a write-
protected configuration file referenced under the HKEY_LOCAL_MACHINE key
is the only way to keep the user from changing these settings.
The user is notified about the inability to store modified settings in write-protected
files just before trying to write them to the file system. The modified settings are
still kept in the memory of SimulationX and the user is allowed to change these
settings further. They are just not stored but reset after a restart of SimulationX.
This is relevant when the configuration dialogs are suppressed at startup, but there
are problems obtaining a valid license from the configured medium or when trying
to load corrupt configuration files.
SimulationX 3 2-47
User Manual 2. Installation
2-48 SimulationX 3
by
Getting Started
Working with Sample Models
3 Getting Started
In this chapter, we want to make it easy for you to begin working with
SimulationX. The focus will be on using the provided example models, although
the instructions still apply generally. The structure of a model will be explained
step-by-step using the example Two-Mass-Oscillator.
For many actions there are several different ways to carry them out. In this
introduction only one method will be demonstrated and used. In chapter 5
Modeling you can read in detail about the modeling process. The terms used in
the following chapter can be found in chapter 12 Definitions.
The welcome page when starting SimulationX enables direct access to the
examples.
You are able to see examples which contain elements not included in your licensed
libraries using the Viewer Edition. Switching into the Viewer edition is described
in section 2.2.8.
SimulationX 3 3-1
User Manual 3. Getting Started
After opening, the model structure and a model description will appear on the
screen, as well as some result window with previously calculated curves.
Additionally, data sheets, basic data and explaining illustrations are contained
within the examples.
3-2 SimulationX 3
Working with Sample Models
In order to save simulation results for later display, you should activate the
protocol attribute for the desired result variables.
SimulationX 3 3-3
User Manual 3. Getting Started
The work with result windows is described in detail in section 7.3 "Result
Windows".
You can display several result curves in one window using Drag-and-Drop. A y(x)
plot is possible by clicking on the button within the result window.
3.2 Creating your own Model
In the following sections, the simple model Two-Mass Oscillator will be
developed. The individual steps are explained, and references are provided to more
detailed explanations in following chapters.
When creating your own model, you should always start with a new
file (button or menu File New). Then proceed as follows:
On the left side of the screen you will see the library bar (Figure 3.3). Sub-libraries
can be opened by clicking on the arrow. Using Drag-and-Drop, the elements can
be placed in the diagram view (more information in section 5.2.3).
The elements of the model are still movable, i.e. they can be shifted, turned and
tilted. Select an element by clicking on it. It can be shifted by dragging it across the
work space with the mouse, or using the arrow keys. Using the tools you
can rotate the element, and using the element can be horizontally or
vertically tilted. In this way you can move the element to the desired position and
orientation for the following connections.
3-4 SimulationX 3
Creating your own Model
Within the General tab of the property dialog, it is possible to enter comments
for the element, or change the position and orientation of the label (s. Figure 3.4).
Task:
From the library Linear Mechanics, select two masses (mass1, mass2) and a
spring-damper element (springDamper1) and place these in the diagram view.
element connectors
Figure 3.5: Model
SimulationX 3 3-5
User Manual 3. Getting Started
Please note the fact that only elements within the same physical domain can be
connected (e.g. mechanical spring not compatible with hydraulic throttle). In this
case, no connection structure at the other element occurs.
You can do this by using the property dialog of an element (double click on it) or
by using the Model Explorer. After clicking on an element, its parameters appear
in the Model Explorer.
tree
view
3-6 SimulationX 3
Creating your own Model
After clicking on an element, all parameters are available to be edited in the top
part of the Model Explorer (s. Figure 3.7), and in the lower part the result
variables are available.
Please note that a dot is always used as the decimal separator (no comma!).
Protocol attributes ( ) for the result variables can also be activated via the
Model Explorer, so that they can be plotted during or after the simulation.
Activate protocol attributes for the following result variables:
mass1 Displacement.x
mass2 Displacement.x
springDamper1 Internal Force.Fi
springDamper1 Displacement Difference.dx
SimulationX 3 3-7
User Manual 3. Getting Started
We will limit the following analysis to simulation in the time domain. Figure 3.8
shows the dialog for the simulation control.
The simulation can be started using the menu Simulation Start or with the
button in the tool bar. The computation takes place up to the given stop time.
The preset value is 1 second.
Using the button you can end the simulations run. The button resets the
model to the start.
In order to modify the value for the stop time, open the dialog for the simulation
control (menu Simulation Properties).
Select the element mass1 in the diagram view by clicking with the mouse. In the
Model Explorer the available result variables will be indicated. Click the protocol
attribute for the displacement of mass1 with the left mouse button and pull it via
Drag-and-Drop into the diagram view. After releasing the mouse button, the result
window becomes visible.
Plotting multiple result variables within the same result window is also possible.
3-8 SimulationX 3
Creating your own Model
Task:
Plot the result variable mass2.x in the existing result window as well.
Select the element mass2 in the diagram view and drag the protocol attribute
for the displacement using Drag-and-Drop into the existing result window. It will
be displayed as a second curve.
Two result variables can also be plotted in a y(x) diagram. In the following, the
displacement different should be plotted as a function of the internal force.
First the simulation should be reset, and subsequently the protocol attributes for the
result variables displacement difference (dx) and internal power (Fi)
activated. Create a result window in which both of the selected result variables are
plotted. After a new simulation run, switch into the y(x) representation using the
button in the result window tool bar.
SimulationX 3 3-9
User Manual 3. Getting Started
At this point you can reset the simulation with the button , make parameter or
structural changes in the model, and start the simulation again. When resetting the
simulation, all result curves will be removed.
Note: If you freeze the result curve with the button before resetting, then the
original curve remains visible in the window. The effect of parameter changes can
be seen by direct comparison after running the simulation again.
Figure 3.12: SimulationX model of a simple powertrain for the steady state simulation
The model parameters you need to modify are collected in Table 3.2.
The following value of the excitation torque is input in the properties dialog
of source1:
3-10 SimulationX 3
Creating your own Model
The torque source source2 serves for the compensation of the average drive torque
of source1. This makes sure that the mean angular velocity of the drive train keeps
constant and a steady state solution is possible. You do not need to modify the
parameter Torque of source2. The employed harmonic balance algorithm
calculates the necessary compensation torque by itself.
Before running the steady state simulation you should activate the protocol
attributes of the result variables of interest. The procedure to activate protocol
variables is briefly described in section 3.1.2. For the current application example
the following result variables are needed:
the acceleration torque Ta of inertia1,
the angular velocity om of inertia1.
Set the multiple-choice box in the toolbar to Steady State and open the
Property Dialog for the steady state simulation by clicking on the symbol in
the toolbar or by clicking on Steady State Settings in the Simulation menu.
In this example you only need to set some parameters on the System page of the
property dialog for the Steady State Simulation. This page is shown in Figure
3.14.
SimulationX 3 3-11
User Manual 3. Getting Started
When choosing the angular velocity inertia1.om as the reference quantity, the
angle inertia1.phi is automatically selected by default as Period Variable.
You can retain the default value 4 for the Period of the period variable since the
excitation torque is 4 -periodic in inertia1.phi. You can also keep the values for
the Fundamental Order and the Maximal Order.
The fundamental order 0.5 is assigned to the oscillation with the given period
length 4 the oscillation of first order then has the period length 2 and so on.
After entering all required Simulation parameters you may start the steady state
simulation by pressing the button or by clicking on Start in the Simulation
menu.
You can already watch the evolving results during the simulation. Open the
context menu of intertia1 with a right mouse click on intertia1 and select in the
3-12 SimulationX 3
Creating your own Model
submenu Results (Steady State) the item Angular Speed om (see Figure 3.15). This
opens the steady state result window intertia1.om (see Figure 3.16).
Figure 3.15: Selection of a recorded result variable for the steady state simulation
When the result window opens, the Spectra representation of the signal is shown.
With the checkboxes , individual curves of the result window may be switched
on or off. For the angular speed of rotational masses the Fluctuation Coefficient is
shown by default. Alternatively, you may select the Amplitude, Excitation, Phase,
Real Part, or Imaginary Part representation.
SimulationX 3 3-13
User Manual 3. Getting Started
The tabs Spectra Signal at the lower right corner switch the result window
from Spectra view to Signal view and back.
The multiple choice box in the upper right corner offers the representation of the
Deflection, Deflection+Mean Value, and Fluctuation. The default representation
for the angular speed of rotational masses is the fluctuation.
With the slider, the reference value for which the signal is plotted over the period
variable can be changed. Alternatively, you may input the desired value into the
text field and then click the button Apply or press the Return button.
3-14 SimulationX 3
ITI SimulationX for Complete System Modeling and Analysis
SimulationX 3 3-15
User Manual 3. Getting Started
3-16 SimulationX 3
by
2 3 4
7
SimulationX 3 4-1
User Manual 4. Graphical User Interface (GUI)
Further customizations can be made via the menu View. Here you can change to
full-screen mode which uses the whole screen for the display of the document
window.
4.2 Operating
4.2.1 Menu Bars and Toolbars
The menu bars and toolbars (1) permit access to all tools and commands of
SimulationX. You can change the layout, the position and the contents of toolbars.
You can add buttons to the toolbars and change the assigned icon for any button.
How to add a new toolbar
1. In the menu Extras click Customize.
2. In the dialog field Customize select the tab Toolbars.
3. Select New.
4. In the dialog field New toolbar enter a name for Toolbar.
5. Click OK.
How to add a button to the toolbar
1. In the menu Extras click Customize.
2. In the dialog field Customize select the tab Toolbars.
3. Select the toolbar you wish to adapt and activate it.
4. Select the tab Commands.
5. In Categories go to the category which contains the command that you
want to add to the toolbar.
6. In Commands select an element.
7. Under Commands drag the element from the dialog field Customize to
the desired toolbar.
8. When the mouse shows a plus sign (+) drops the element on the toolbar.
How to change icons for toolbar buttons
1. In the menu Extras click Customize.
2. In the dialog field Customize select the tab Toolbars.
4-2 SimulationX 3
Operating
3. Select the toolbar with the icon you want to change and activate it.
4. With the dialog field Customize open click the button you want to
change. A black square or rectangle indicates that the button has been
marked for editing.
5. Select the tab Commands.
6. Select Change selection.
7. Select "Change icon" and subsequently select the desired icon in the
submenu. If the available icons do not suit your preferences you can
customize a selected icon of the system.
How to edit icons
1. In the menu Extras click Customize.
2. In the dialog field Customize select the tab Toolbars.
3. Select the toolbar with the icon you want to change and activate it.
4. With the dialog field Customize open click the button you want to
change. A black square or rectangle indicates that the button has been
marked for editing.
5. Select the tab Commands.
6. Select Change selection.
7. Select Change icon.
8. In the dialog field Icon editor customize the icon for the selected button.
Favorites
The favorites bar can extend the library bar or even replace it if configured
accordingly. The folder Favorites which used to be part of the library bar in
SimulationX up to version 3.7 has been moved to the new favorites bar. Favorites
can be set as usual by dragging and dropping individual types or entire packages.
The favorites bar can be enabled or disabled from the View menu.
SimulationX 3 4-3
User Manual 4. Graphical User Interface (GUI)
SimulationX Libraries
How to exclude a library from the automatic loading at the program start:
1. In the menu Extras click Options.
2. In the dialog field Options select the tab Libraries & Add-ons.
3. Remove the selection mark for the library which you want to exclude from the
automatic loading at the program start.
4-4 SimulationX 3
Operating
User-defined types
New groups, element types or other Modelica classes are created by first selecting
in the tree view of the library bar the group which is to contain the newly to be
created type. The desired type can be added via the context menu then. For further
SimulationX 3 4-5
User Manual 4. Graphical User Interface (GUI)
editing the TypeDesigner is opened (see section 8.2) or, in the case of a newly
created group, a corresponding dialog field is displayed.
For the elements of the Modelica Standard Library in contrast the name of the type
is displayed instead of the comment.
By the button you can change the display of the symbols and the behavior
when double-clicking on them.
In the toolbar of the library bar there is an input field for the search for element
types. After the button Search has been pushed the program starts searching the
tree view for the input character string starting with the currently selected element
type. In the search both the name and the comment of the types are included. When
the search has been successful the found entry is selected. By pushing the Search
button again the search can continue.
By the button the view of the library bar can be adjusted by sorting or
filtering.
The icons of the element types in the tree view can be highlighted specifically by
an additional marking:
4-6 SimulationX 3
Operating
The following commands are available via a context menu for the selected entry of
the tree view. The icons given at the edge inform to which element types the
respective command can be applied on principle. The applicability of a command
can depend on further conditions which will be mentioned specifically in the text.
New...
Use this command to create a new type of the specified Modelica class. The
commands Model, Connector, Block, Function and Package are
available to create user-defined types. The newly created type is opened for editing
in TypeDesigner. Name and comment and, if required, the respective target
directory have to be input in a dialog field for a newly created group. This can be
edited like a Modelica package in TypeDesigner later.
Delete
Use this command to delete the selected type including the types contained in it.
Note that the file or the directory where the respective type is stored will also be
deleted then. A corresponding warning has to be confirmed prior to the deletion. If
the type is to be removed from the tree view only temporarily, the command
Unload can be used.
Duplicate.
SimulationX 3 4-7
User Manual 4. Graphical User Interface (GUI)
This function creates a copy of the selected type. In the following dialog is type-
name and target package of the copy can be specified. If the destination is the same
package is assigned to another name.
Open
Select this command to edit the model of the selected type in the TypeDesigner,
diagram view, text view, 3D view or to open the documentation view. As long as
the diagram view is open the respective type remains blocked for further editing.
Modelica Standard Library types can be opened but not stored.
Not all features are available for any type.
New Version...
Use this command to create a new version of the selected type. The newly created
version substitutes the basic type in the library view. The basic version remains
available though. Models which use a type for which several versions are available
use the respective current version by default. However use of a certain version can
also be demanded. The consistent use of versions can help in ensuring the
reproducibility of computation results because models can be developed in this
way which remains unaffected from later changes to the basic types.
New Derivative...
With this command you can create a derivative of the selected type. Derivatives
permit the extension of existing element types by, for instance, an additional
connector or parameter. However you cannot change the behavior of the element
fundamentally with a derivation.
Reload
Use this command to load anew a group of element types starting with the selected
type. This can be necessary if you have modified a mo-file outside SimulationX
and want to apply these changes in SimulationX. Note that all opened models must
4-8 SimulationX 3
Operating
be closed before you execute this command. Model changes can be stored in this
process.
Unload
To save storage space or to reduce the size of the library bar you can unload
individual types or groups of types. In contrast to deletion files or directories will
not be deleted in this process. The respective types will be available again upon
restart or execution of the command Reload. Note that all opened models must
be closed before you execute this command. Model changes can be stored in this
process.
SVN Update
Use this command to update your local copy of a particular package or type (see
section 4.2.3).
SVN Commit
Use this command to submit all changes made to the package or type to the
repository (see section 4.2.3).
TortoiseSVN
This context menu holds additional options for version management. See section
4.2.3 for more details.
Expand/Collapse
Use this command to expand or collapse the tree view for the selected entry.
Samples
This command initiates a search for examples in the Sample Browser containing
the selected type.
Help
Use this command to open the Help for the selected type. Alternatively, press F1.
Drag-and-Drop
Element types can be copied or shifted within the library bar and in the tree view
of the model explorer by Drag-and-Drop. Types of the Modelica Standard Library
cannot be shifted. Protected types are excluded from Drag-and- Drop operations as
a matter of principle. To copy or shift such a type you have to remove the
password protection in TypeDesigner first.
Caution:
The Shifting of element types can cause models which use these types to be no
longer loadable. Therefore you should use this option only in rare cases.
SimulationX 3 4-9
User Manual 4. Graphical User Interface (GUI)
At the bottom of the library bar a preview picture and some useful information
regarding the entry which you selected in the tree view are displayed in a small
separate window area. Via a hyperlink the directory which contains the file
belonging to the respective type can be opened in Windows Explorer.
Requirements
- Microsoft Windows OS (Windows Vista or later), 32 or 64 bit
- TortoiseSVN must be installed
Settings
Version management with Subversion SVN can be enabled on the Storing page in
the Options dialog (under Extras in the menu bar). The context menu in the
SimulationX library bar provides the following commands for the work with SVN:
SVN Update
Use this command to update your local copy of a particular package or type. Files
from the repository that are newer than your local copies are downloaded to your
computer. Changes you may have made already in your local copy will not get
lost. The program tries to merge your changes with the version from the repository.
Occurring conflicts are flagged up. Once the update process is complete,
SimulationX reloads the affected types.
SVN Commit
Use this command to submit all changes made to the package or type to the
repository. All modified files are listed in a window. You can add comments to the
revised version (log entry) in order to track the version history later.
4-10 SimulationX 3
Operating
Difference
This command looks for changes in your local copy compared to the latest version
in the repository. Differences between both files are shown and highlighted in a
separate window.
Show Log
Use this command to view the version history. A separate window shows all
exchanges for a particular package or type including all comments.
Add
Use this command to add a type or package to the repository. That requires the
superordinate type or package to be part of the repository already. If that is not the
case, new types and packages can be included in the version management by
clicking Add to Existing Repository or Add to Existing Repository.
Remove
This command removes the selected type or package from the repository. All
associated files remain on your local drive. Deleting a type removes all associated
files from your local drive and the repository.
Revert
This command undoes all local changes and updates your local copy with a version
from the repository, the basis for your changes. All changes in the selected file that
were not submitted to the repository get lost.
Resolve conflict
During the update process, merging various changes may cause conflicts. These
conflicts must first be resolved. This can be done manually or through the
corresponding tool in TortoiseSVN. Once all necessary changes are applied, you
can update the files status with this command.
SimulationX 3 4-11
User Manual 4. Graphical User Interface (GUI)
The Text View can be used for displaying and editing the Modelica code.
The Documentation View shows the content of the model Online Help. This view
serves for model documentation.
4-12 SimulationX 3
Operating
Several views with different settings can simultaneously be opened for a model.
Right mouse click on a tab opens a popup menu with the following commands:
For the splitting in Figure 4.3 a new vertical tab group was added.
All settings made are stored together with the model. The views have equal priority
(e.g. only 3D view). This means that animations are also possible without 3D view.
In the properties dialog of the model in the register 3D Settings (dx9) settings to
the representation (colors, grid and other things) can be specified. The button
Save As Default can be used to fix the settings.
SimulationX 3 4-13
User Manual 4. Graphical User Interface (GUI)
Settings are stored and are available after a restart of SimulationX again.
For a selected element (e.g. Mass1) or a connection the parameters and result
variables are listed in tabular form, see (2) and (3).
If no model elements have been marked the general parameters and result variables
of the model will be displayed.
1 2
4 3
The Model Explorer windows can be arranged freely within the SimulationX
workspace. You can also hide views that are not needed.
The tree views, just like the library bars, come with options for sorting and
filtering. Use this feature to hide entries that you do not need.
4-14 SimulationX 3
Operating
These are the following for parameter tables and result variable tables:
SimulationX 3 4-15
User Manual 4. Graphical User Interface (GUI)
All columns can be shown with ascending/descending sorting order. To this end
click on the corresponding column header and the sorting will proceed. ( -
ascending; - descending).
The current value of a result variable cannot be changed. However, the unit of
measurement, in which the variable should be shown, can be changed.
Hint:
You can also use the TypeDesigner to add or to remove parameters or variables.
4-16 SimulationX 3
Operating
SimulationX 3 4-17
User Manual 4. Graphical User Interface (GUI)
4-18 SimulationX 3
by
Modeling
Modeling in SimulationX
5 Modeling Fundamentals
5.1 Modeling in SimulationX
SimulationX offers various ways to create models:
Physical object-oriented models
Signal-oriented models
Equation- and algorithm-based models
Thus, users can apply the best suiting modeling approach to their component and
system models and can combine the different approaches within the same
simulation model, so that every component is modeled in the way suiting it best.
The benefits and application areas of each modeling approach are explained in the
sequel.
F F F F
element element
Node
In a connection resides a set of potential quantities, which are identical for all
element connectors connected to it. Such potential quantities are, e.g.,
SimulationX 3 5-1
User Manual 5. Modeling Fundamentals
The flow quantities are quantities, for which certain balance equations must be
fulfilled. For instance, forces or torques at connections in mechanics must balance
to zero. The same must hold for currents in electronics and flow quantities in other
physics.
The potential quantities as well as the balance equations for flow quantities, which
belong to a physical domain, are defined in the connections.
5-2 SimulationX 3
Creating Models
Signal-oriented models are the appropriate way to model control systems and can
be used as auxiliary structures for computing dependencies in physical libraries.
Figure 5.3 shows a sample for signal-oriented structures.
The working with algorithms and equations is not covered in this chapter of the
manual. Please refer to chapter 8 for an in-depth introduction into this matter.
SimulationX 3 5-3
User Manual 5. Modeling Fundamentals
Following functions in the "File" menu are for the handling of SimulationX
models available:
creates a new document
opens an existing SimulationX model
Close closes the current document window (model)
saves the current model
Save as displays a dialog box for the Save options
generates a print preview
opens the Windows Print dialog box
Send Message generates a message with the model as an attachment
Please note the instructions in section 10.5, "Conversion of models for use in
SimulationX 3.7".
5-4 SimulationX 3
Creating Models
When storing models you can select the additionally following options:
The file format SimulationX Project permits accelerated saving and loading of
models containing large amounts of binary data, such as recorded results,
animation and CAD data, or graphics in the diagram view. The SimulationX
project is structured as a ZIP archive. Both, the text-formatted model as well as the
embedded data, can be accessed directly. For instance, the recorded simulation
results can now be extracted, evaluated, or processed in other programs without
involving SimulationX. Additionally SimulationX Project data contain a preview
picture of the model, which can be displayed in the Windows Explorer and in the
dialogs for opening and storing files. To make possible the search for models in the
Windows Explorer additional information like idents of the used element types in
the model will be stored in the data file.
It is possible to prevent imported CAD data from being saved. In this case the
triangular meshes, which define the body shape, are replaced by simple cuboids.
The imported mass and inertia data is not removed and remains intact within the
model.
SimulationX 3 5-5
User Manual 5. Modeling Fundamentals
These SimulationX libraries are developed and maintained by ITI, and are based
on know-how from numerous engineering projects and applications. They are well
validated and tested and the handling of the elements from these libraries is set up
such, that they provide a maximum in comfort and easiness of use. For all
SimulationX libraries the customer can obtain full technical and modeling support.
5-6 SimulationX 3
Creating Models
The SimulationX libraries are all based on the modeling approaches introduced in
section 5.1.
The SimulationX libraries cannot be modified by the user, but they can be used as
starting point for custom model object development either by forming compound
models or by extending the functionality of the library elements (see section 8.2.3).
SimulationX 3 5-7
User Manual 5. Modeling Fundamentals
The size of an element can only be adjusted if the following conditions are met:
Vector graphics are used for the symbol of the element type instead of
bitmaps.
Instead of proprietary SimulationX ports Modelica compatible Connectors
are used exclusively.
For restoring the standard size chose Reset Transformation in the context menu
of the element.
These elements can also rotate. Click on the element. Then touch with the cursor
on the red arrow and rotate it.
5-8 SimulationX 3
Creating Models
Element
Element connector
Element connection
There are different types of connectors, such as mechanical (linear and rotary),
hydraulic, and electrical connectors, as well as signal inputs and outputs. Only
SimulationX 3 5-9
User Manual 5. Modeling Fundamentals
connectors of the same type can be connected to each other. Each connector
possesses an unambiguous name with respect to the corresponding element. These
names can be made visible via the menu View Pin Labels or by using the
button .
To place a new element using drag-and-drop into the diagram view, proceed as
follows:
1. Find the corresponding element type in the tree view of the library bar.
2. Click with the left mouse button on the entry in the tree and keep the mouse
button pressed.
3. With the left button pressed move the mouse pointer to the position where the
new element is to be inserted.
4. When releasing the mouse button the element is created at the desired place in
the model.
You can modify the positioning of elements by using the following options and
commands:
Snap to grid
Rotate left
5-10 SimulationX 3
Creating Models
Rotate right
Mirrored horizontal
Mirrored vertical
Dragging them with the mouse can change the position of the elements.
To place several elements of one type into the diagram view, you can repeat step
1-4 several times or use the drag-and-drop copy.
2. Press the left mouse button and move the mouse pointer to the target connector
of the new connection, while pressing the left mouse button.
You can abort the creation of a new connection at any time by releasing the mouse
button over an empty region in the diagram view or by using the Escape key.
SimulationX 3 5-11
User Manual 5. Modeling Fundamentals
These nodes can be replaced in an arbitrary way with the mouse. This results in a
changed connection routing. Via the context menu of the selected node it is
possible to add or delete nodes of the connection. Also the Auto Routing can be
deactivated.
By clicking on a connection line, the mouse pointer shows you in which direction
you can move the selected connection line.
To improve the clarity of the model, you can branch connections. So, you can
create connections between free connectors and existing connections in both
directions.
5-12 SimulationX 3
Creating Models
For shifting a connection: mouse click on a), keep it pressed and drag to
somewhere for disengaging (see b). Then move with the mouse pointer to a
connector of the target element (c) and release mouse button.
a) b) c)
Alternatively you can select the connection, and use the Del key for disengaging.
The connection will be deleted completely.
By using the option "Separate" in the properties dialog of an element you can also
disengage the element.
The dynamic visualization for connection lines gives you an improved model
overview. The settings for the visualization are done by the properties dialog of a
connection (see section 6.2). The current state or the exceeding of
minimum/maximum of certain variables like pressure or temperature can be color-
marked. Even video recording is possible.
SimulationX 3 5-13
User Manual 5. Modeling Fundamentals
2. An element can be added to the current selection by pressing the Shift key and
clicking with the mouse on the element. The removal of an element from the
selection is performed in the same way.
5-14 SimulationX 3
Creating Models
You can abort a started drag-and-drop operation at any time by pressing the
Escape key before releasing the mouse button.
On the property page Labels within the dialog Options (menu Extras
Options Labels) you can choose between four different display modes for
Elements. Per default the name of the element is displayed.
The following entries can be entered in the format field when using a free label:
SimulationX 3 5-15
User Manual 5. Modeling Fundamentals
The comment of
the element is
used.
The main
parameter is used.
If the current selection in the diagram view is changed, the property window is
automatically closed.
5-16 SimulationX 3
Parameters and Results
There is a toolbar on the bottom of the property window, which offers the
following functions:
By a click on the button Open a dialogue is shown for opening a file with
parameters.
A click on the button Save as - opens the dialogue for storing files.
By a click on the button Excel the appropriate support for exporting data
to Microsoft Excel opens
Through a click on the button Help the online help for the component is
displayed.
A click on the button Keep opened prevents the automatic closing of the
dialog window when another component is selected. The property window
now remains open even if the current selection is changed. The properties
of the currently selected components are shown. This display mode is valid
until the window is closed or the button is pressed again.
Clicking the Backward button opens the property window of the previously
edited component.
For returning to the component, which was edited before clicking the
Backward button, the button Forward can be used.
SimulationX 3 5-17
User Manual 5. Modeling Fundamentals
The location of the toolbar can be changed by clicking with the right mouse button
on it. It can be either placed on bottom (default) or on top of the property window.
Properties belonging together are shown on the same page in the dialog. A
particular page is displayed by clicking on the corresponding tab. With the key
combinations Ctrl+Tab and Ctrl+Tab+Shift you can move to the next or previous
page respectively.
The size of the property window can be adjusted. There is a minimum size, which
depends on the maximum number of entries on the pages. Position and size are
saved, so the window is shown at the same place and with the same size, when you
open it again.
Changes to the properties of the component are taken over immediately. To revoke
a change use the command Undo in the menu Edit, the undo button in the
tool bar, or the corresponding key combination (Ctrl+Z).
If the window is not unpinned, the keys RETURN and ESCAPE cannot be used to
close it, but instead have the following functions:
RETURN Apply most recent change
ESCAPE Undo most recent change
If an error message pops up, it can be closed by hitting ESCAPE. To undo the most
recent change, hit ESCAPE again. The window cannot be closed until the error has
been corrected.
Default entries for parameters and units in the property window are shown in blue.
A reset to default values is possible by the context menu entry Reset to Default
on the respective input box.
The property window supports the selection of several components. In this case
only those properties are displayed, which are present in all selected components.
5-18 SimulationX 3
Parameters and Results
The buttons in the properties dialog let you access parameters and result variables.
You can also use the Model Explorer and right-click on a line where you can select
Edit attributes.
The attributes dialog gives the possibility to enter additional information for the
control of the GSA (global symbolic analysis) as well as the solver.
The button to open the properties dialog for individual parameters and variables
shows an icon for a variables file type and variability. A small arrow on the right
side of the button opens additional options for parameter editing.
The variables properties are visualized in line with the symbols used in the
TypeDesigner and other GUI elements.
SimulationX 3 5-19
User Manual 5. Modeling Fundamentals
Attribute Meaning
min, max extreme values of the parameter / the variable (result
quantity)
start start value (initial value );
if fixed == true , the computation starts with this value
fixed true: the solver must use the start value
false: the solver can use the start value, but it can also be
changed
notFixed the state can be changed while an initial value computation
after an event iteration, although in contrast of physical
reasons (e.g., displacement or velocity branches);
(only of interest in state variable)
nominal scaling factor for the solver, if the parameter or variable is a
state
(nominal value, e.g., in Hydraulics: nominal value of the
pressure = 1 bar; the values depends on the specific task and
usually the user can ignore it)
stateSelect specification whether a variable (preferably) should become
a state or not (never, avoid, default, prefer, always)
5-20 SimulationX 3
Parameters and Results
5.3.2 Parameters
For the parameterization of model components special controls are used, whose
functionality is described in the sequel. The label of the controls consists of a
name, unique within the component, and a comment. The name can be referenced
in expressions and algorithms. While the comment is language dependent, the
name remains the same in each language version of SimulationX. This enables the
exchange of models between different language versions, whereby the comments
are shown in the current language.
Comment and physical quantity can be changed using the attributes dialog (see
section 5.3.1).
If a parameter was modified, but the changes have not yet been applied, this state
will be shown through an asterisk (*) in the title bar.
SimulationX 3 5-21
User Manual 5. Modeling Fundamentals
Parameters in SimulationX may contain not only simple numerical values. The
"Editbox for functional expressions" allow you to enter:
Mathematical expressions
With few exceptions, each parameter input can be a mathematical function.
The range of possible notations is shown in section 10.4.2 and 8.2.7.
Examples for the use of mathematical functions
- sum, difference 5.23*mass1.x-50+function1.y
- product, quotient 0.01*gravity*CarMass.m/2
- relative deviation 2*(ctr1.x-ctr2.x)/(ctr1.x+
ctr2.x)
- weighted mean (a*x1+b*x2)/(a+b)
- logarithmic function a*ln(x+b) or a*log(x+b)
- power function 0.31*CarMass.v^2/2
- trigonometric function 230*cos(2*pi*50*time)
- exponential function 1-exp(-time/10ms)
- characteristic curve curve1.curve(ctr1.x)
- square root 0.01*sqrt(k)
- absolute value abs(x)
Logical terms
Each parameter entry can be linked to logical conditions. The logical
condition is written in brackets. If the condition is fulfilled (true) the
expression in brackets receives the value 1, and otherwise 0.
See also section 10.4.2, 10.4.6 and 10.4.9. Complex relationships can be
built up through the linkage of logical expressions in mathematical formulas
or parameter entries, as following examples show.
5-22 SimulationX 3
Parameters and Results
More information about namespaces, identifiers and usable functions can be found
in section 10.4.
When using expressions, the selection box is disabled (the background becomes
gray). The result of an expression will always be interpreted as a value in the
corresponding SI base unit, as long as the expression itself does not contain the
desired unit explicitly. For more information about units see section 5.3.2.1.
Hint:
An expression, which is not shown completely due to its length, can also be
completely shown as a tool tip. For this move the mouse pointer over the input
field.
If the input field contains a simple number and another unit of measurement is
chosen, the number is converted to the new unit. Thus, the value used during
simulation does not change.
SimulationX 3 5-23
User Manual 5. Modeling Fundamentals
You can suppress this conversion by pressing the Shift key during the selection of a
new unit. The value of the parameter changes according to the selected unit.
5.3.2.3 Constants:
pi 2*arccos(0) == 3.14159265358979...
e exp(1) == 2.71828182845905...
If the pin is stuck the value is obligatory. The solver will not modify it.
If there is no value given (the input field is empty) the value is interpreted as free
and the solver will choose it appropriately.
The initial value input field accepts only constant expressions.
5-24 SimulationX 3
Parameters and Results
iSim
counter of simulation run 0
(increased by every
simulations run)
nSim
name of simulation empty
(used by the variant wizard)
SimulationX 3 5-25
User Manual 5. Modeling Fundamentals
and text fields can be used to add or remove cells. This option
is only available if transposing the matrix does not violate the dimension
conditions. The tabulator key can speed up the process of entering an entire matrix:
The cursor then jumps from one cell to the next one or to the beginning of a new
row. If there is no row, a new one is created and the cursor moves to its beginning.
5-26 SimulationX 3
Parameters and Results
Copying the marked table area to the clipboard allows other programs to use it as
well. If necessary, table dimensions are extended automatically when a table with a
variable number of columns and rows is pasted. Copy and paste functionality is
available from both the tool bar and the context menu which can be opened with
the right mouse click on the highlighted area.
Clicking on the row or column header selects the entire row or column. The
context menu also indicates whether the values in a row or column are strictly
increasing or decreasing. It also lets you sort the matrix in ascending or descending
order.
For numerical parameters (integer and real), values are shown in a diagram on the
right. Except for one-dimensional matrices (vectors), there are several diagram
types available:
Bar diagram
Open, closed or filled curve
Point cloud
3D surface
SimulationX 3 5-27
User Manual 5. Modeling Fundamentals
5-28 SimulationX 3
Parameters and Results
After this setup is done, the file is initially parsed. On the next page you can
specify the exact range of cells just like on the XML import page.
When you import MATLAB files, you must select the variables containing
the desired data. It is only possible such matrices whose dimensions and
type match the edited parameter. Not only are dimensions of the actual
variables checked, but also the transposed. Though you can exclude those
variables that do not meet these criteria from the import.
When importing from Excel files, again the desired cell range has to be
selected along with the correct spread sheet and table.
SimulationX 3 5-29
User Manual 5. Modeling Fundamentals
If multiple tables are to be imported for 3-dimensional arrays, you can choose a
manual table by table setup or let the assistant do it the automated way.
The parameter data can also be visualized in a diagram. In addition, data points can
conveniently be changed by drag and drop.
5-30 SimulationX 3
Parameters and Results
SimulationX 3 5-31
User Manual 5. Modeling Fundamentals
Attention must be paid to the headers of each column in the text file. They must
have exactly the same names for all imported files.
Variable forces/torques can be modeled best with the elements External Force or
External Torque from the library Mechanics, respectively.
M iKupplung = k0 ( + a 3 ) (5.1)
the following entry will be found in the parameter dialog box for the External
Torque:
k0 * ((self.ctr1.phi - self.ctr2.phi) + a * (self.ctr1.phi - self.ctr2.phi)^3) (5.2)
or alternatively:
k0 * (self.dphi + a * self.dphi^3) (5.3)
Figure 5.17: External Torque with parameter input for the torque characteristics given as
a formula
The variables k0 and a here are user-defined variables, created beforehand in the
parameters dialog of the model. The deformation of the connected inertias can be
accessed from the element via the parameters self.ctr1.phi and
5-32 SimulationX 3
Special Topics
The External Torque element with this parameter input is connected between two
rotary inertias (cf. Figure 5.18).
The parameters given for each of the rotating inertias are the inertia of one
coupling half. Furthermore, the deformations (angle, angular velocity, angular
acceleration) of the coupling halves are also calculated at the rotating inertias
Please refer also to the sample file Mechanics/NonlinearCoupling.ism.
In SimulationX you can best describe relations given point-by-point with the
element Curve (from the library Signal Sources). Select the Input X option in the
list box and enter the points or load them from the medium (cf. Figure 5.20)
SimulationX 3 5-33
User Manual 5. Modeling Fundamentals
5-34 SimulationX 3
Special Topics
The output variable of the Curve (Curve1 at Figure 5.20) is the coupling torque. It
is put between the coupling halves with the External Torque (Coupling). The
parameters for the External Torque are given with the signal input in1, which
refers to the quantity applied at the signal input Curve1.x.
The coupling halves are modeled with rotating inertias (J1 and J2). The inertia
parameters are defined with the moment of inertia. The motion quantities of the
coupling are also calculated at the inertias.
If you perform a simulation run and represent the torque over the differential angle,
you will obtain the characteristics entered for the range that is covered during the
calculation (cf. Figure 5.22).
SimulationX 3 5-35
User Manual 5. Modeling Fundamentals
Therefore, if you want to work with variable stiffnesses in the spring element, you
have to use the so-called effective stiffness keff, since it is likewise defined as the
quotient of torque (or force) and deformation ( or x):
T ( )
keff ( ) = . (5.7)
The effective stiffness thus corresponds to the slope of a straight line passing
through the working point and the zero point of the T--characteristic curve (cf.
Figure 5.23). By all means, keff can be a function here. It does not have to be
constant. For example, the following effective stiffness would be obtained for the
torque in the coupling with the relation given in (5.1):
keff =
TiKupplung
=
(
k0 + a 3 )
. (5.8)
(
keff = k0 a 1 + a 2
)
If the expression k 0 a (1 + a 2 ) is given as the parameter input for the stiffness of a
spring element, the nonlinear relation will be precisely described. No integration
over the parameter is required. Initial values for the simulation start (integration
constants such as (5.10) do not have to be known.
where k is the derivative of the torque T with respect to the angle . Thus, the
stiffness corresponds to the slope of the tangent at the working point of the T--
characteristic curve (Figure 5.23).
5-36 SimulationX 3
Special Topics
Figure 5.23: Stiffness k and effective stiffness keff for nonlinear torque-deformation
characteristic curves T()
T = k d + T0 . (5.10)
If you want to directly transpose the above integration formula, you have to
integrate over the differential angle . section 5.4.1.2 already tells you how this
angle is obtained. This is also shown in Figure 5.24. The integration takes place in
the signal block Integral y over x of the Special Signal Blocks library. The torque
applied at the output is once more put between the inertias of the coupling halves
(J1 and J2) by means of the External Torque (coupling).
Figure 5.24: Model structure of a coupling with nonlinear stiffness integration of the
stiffness over the angle
SimulationX 3 5-37
User Manual 5. Modeling Fundamentals
In general, however, the integration during the simulation is made over time. You
can also put down the integral for the torque for this. The torque is obtained from
(5.10) as the integral over time (5.13), by inserting (5.12).
d = dt , (5.12)
where is the velocity. The simulation model then looks like the one shown in
Figure 5.25.
Figure 5.25: Model structure of a coupling with nonlinear stiffness integration of the
stiffness over time
The Integrator of the Linear Signal Blocks library is required for the integration
over time.
Remarks:
In the integration the internal torque of the spring for the starting point of the
simulation must be known and entered (not necessary if the effective stiffness is
used; cf. (5.7)). However, the simulation often begins in the undeformed state,
for which reason the internal torque at the beginning of the simulation, and thus
the integration constant, are zero.
The External Torque (coupling in Figure 5.24 and Figure 5.25) is assigned as
in1 for the signal applied at the input.
If the relation given as a derivative can be completely integrated, then the
stiffness k can be converted to an effective stiffness keff, for example according
to (5.13).
5-38 SimulationX 3
Special Topics
k eff =
k d bzw.
(5.13)
k eff =
k dx
x
Solution 3: Is the internal torque on the angle phi derived, we get the actual
stiffness. In this case, it must be integrated and provide solutions
according to Figure 5.24 or Figure 5.25.
SimulationX 3 5-39
User Manual 5. Modeling Fundamentals
Both the result curves (cf. Figure 5.26) and the dynamic behavior of all three
modeling possibilities are identical. Thus, all of these types of modeling are
equivalent in terms of their results. You can choose any model, depending entirely
on what you prefer or need to use.
Figure 5.26: Identical results of different modeling variants of nonlinear relations in the
element
The solutions presented here are exemplary. Of course, other solutions arise using
the TypeDesigner or use of the functionality of Modelica.
5-40 SimulationX 3
Special Topics
The characteristic curves dialog offers a comfortable adjusting and editing of:
Sampling points (as table or graphically interactively)
Interpolation/Approximation
Kinds of continuation
Units
If there is more than one characteristic (such as in curve families, curve sets or
hysteresis curves), the dialog contains a table, where each column represents a
curve (1st column represents x-values, 2nd to n-th column represents values of the
function).
SimulationX 3 5-41
User Manual 5. Modeling Fundamentals
Tool bar:
The tool bar on top of the characteristic curve dialog offers access to the following
functions:
Load characteristic sets
Save entered characteristic set
Print characteristic set
Insert row (after selected one)
Delete row (selected one)
Properties dialog of characteristic set
Reset characteristic curve to standard values
Toggle Markers for sampling points
Show all axes (for curve sets only; separately axis for each row)
Characteristics and curve sets can be stored in the mentioned formats and can be
also printed (see also section 7.1). For editing the characteristic in the table, the
following keyboard commands are available:
Tab Moves cursor to the next cell
Shift+Tab Moves cursor to the previous cell
ESC Cancels the current editing procedure and closes the
curve dialog
Enter Terminates the current editing procedure
Cursor up/down Moves the cursor upward and downward within a
column
Cursor left/right Moves the cursor to the left and to the right within a line
You can add or delete rows of the table using the buttons for 'Inserting' and
'Deletion' in the tool bar. A row is marked by a mouse click on the first column of
this row (row gets a frame). If you move the cursor by using the Tab-key behind
5-42 SimulationX 3
Special Topics
the last column of the table, a new column is added automatically. The current
characteristic curve is plotted in the preview, where the point marked in the table is
also marked in the diagram.
Shift Mouse can be moved only in y direction, the x value
remains constant
Ctrl Mouse can be moved only in x direction, the y value
remains constant
The point worked on in the preview is marked in the table too.
SimulationX 3 5-43
User Manual 5. Modeling Fundamentals
Linear interpolation:
The given sampling points are connected with straight lines.
Spline interpolation:
The sampling points are connected by splines (polynomials). This results in a
smooth curve with continuous first and second time derivative. The third time
derivative of the curve is discontinuous at the sampling points. The first derivative
of the curve (e.g. the preset velocity if the curve is used as preset displacement) is
piecewise quadratic. The second derivative (e.g. the preset acceleration if the curve
is used as preset displacement) is piecewise linear.
5-44 SimulationX 3
Special Topics
Hyperbolic approximation:
The curve is approximated by hyperbolas. The transitions between adjacent
hyperbola sections are continuously differentiable. The transition uses the same
distance from the sampling point for left- and right-sided approximation. This
distance value is half the minimum of the interval lengths of the two adjacent
intervals. Such for the greater interval the hyperbola is continued by a straight line
till the next hyperbola section is hit. If the curve is non-periodically continued
these straight lines are also applied for the boundary intervals from the boundary
point to at least the interval center point.
The permissible deviation of the function values from the hyperbola vertices is
determined by the parameter Approximation Tolerance. In the example a value of
1000 is chosen. In simple words, the greater the value of the approximation
tolerance is the greater the deviation distance gets. There is a maximum possible
deviation to still meet the above requirements for the hyperbola sections. Thus an
extremely large value of the approximation tolerance will not change the resulting
curve any longer.
If straight lines are used the first derivative (e.g. the preset velocity if the curve is
used as preset displacement) is constant. The second derivative (e.g. the preset
acceleration if the curve is used as preset displacement) of the straight line sections
is zero. The time derivatives for the hyperbola sections are not zero and
continuous. The transition of the first derivative is continuous at the sampling
points. The transition of the second derivative between adjacent hyperbola sections
or a hyperbola section and its adjacent straight line is discontinuous.
If the sum of the adjacent slopes at a sampling point vanishes the principal axis of
the corresponding hyperbola are parallel to the x- and y-axis of the curve with the
vertex of this hyperbola being vertically aligned with this sampling point.
SimulationX 3 5-45
User Manual 5. Modeling Fundamentals
The permissible deviation from the sampling points is determined by the parameter
Approximation Tolerance. In the example a value of 1000 is chosen. The distance
between the data value and the center point of the corresponding circle is equal to
the radius of the circle and the approximation tolerance. There is a maximum
possible distance to meet the requirements for adjacent circular arcs. Thus an
extremely large value of the approximation tolerance will not change the resulting
curve any longer.
If straight lines are used the first derivative (e.g. the preset velocity if the curve is
used as preset displacement) is constant. The second derivative (e.g. the preset
acceleration if the curve is used as preset displacement) of the straight line sections
is zero. The time derivatives for the circular arcs are not zero and continuous. The
transition of the first derivative is continuous at the sampling points. The transition
of the second derivative between adjacent circular arcs or a circular arc and its
adjacent straight line is discontinuous.
5-46 SimulationX 3
Special Topics
If the sum of the adjacent slopes at a sampling point vanishes the center of the
corresponding circle is vertically aligned with the sampling point. Then the
transition points have the same distance from the sampling point along the x-axis.
Quadratic Approximation:
The curve is approximated by a sequence of quadratic splines. The transitions
between adjacent parabola sections are continuously differentiable. The transition
uses the same distance from the sampling point for left- and right-sided
approximation. This distance value is bound by half the minimum of the interval
lengths of the two adjacent intervals. Such for the greater interval the parabola is
continued by a straight line till the next parabola section is hit. If the curve is non-
periodically continued these straight lines are also applied for the boundary
intervals from the boundary point to at least the interval center point.
The permissible deviation from the sampling points is determined by the parameter
Approximation Tolerance. In the example a value of 1000 is chosen. There is a
maximum possible distance to meet the requirements for adjacent parabola
sections. Thus an extremely large value of the approximation tolerance will not
change the resulting curve any longer.
If straight lines are used the first derivative (e.g. the preset velocity if the curve is
used as preset displacement) is constant. The second derivative (e.g. the preset
acceleration if the curve is used as preset displacement) of the straight line sections
is zero. The first time derivative of the parabola sections is linear. The second time
derivative of the parabola sections is constant. The transition of the first derivative
is continuous at the sampling points. The transition of the second derivative
between adjacent parabola sections or a parabola section and its adjacent straight
line is discontinuous.
SimulationX 3 5-47
User Manual 5. Modeling Fundamentals
If the sum of the adjacent slopes at a sampling point vanishes the vertex and the
focal point of the parabola are vertically aligned with the sampling point.
If the linear extrapolation is turned off and the domain of the curve is exceeded
during simulation, an error message is produced and the simulation stops. The
setting is ineffective if "Periodic Continuation" is selected for the curve.
Mirror Curves: The curve is mirrored at the left boundary point (in both
coordinate directions). Outside of the defined range the curve behaves as
specified in the "Linear extrapolation". A continuation by mirroring is
demonstrated in the following illustration with linear extrapolation turned on:
5-48 SimulationX 3
Special Topics
In the dialog a table of all available curve axes appears. It contains the x axis of the
curve on top, which then is followed by one or more y axes depending on the
functionality of the respective curve.
SimulationX 3 5-49
User Manual 5. Modeling Fundamentals
5-50 SimulationX 3
Special Topics
Setting curve
parameters: No No Yes No
SimulationX 3 5-51
User Manual 5. Modeling Fundamentals
Hint: It has to be made certain, that the curve parameters increase strictly
monotonously according to the order of the curves. Otherwise the dialog cannot be
closed and an error message is generated.
In order to prevent the automatic conversion of the numerical values you can press
the Shift-key during the unit selection. The selected unit defines only the
conversion of values in the table and in the diagram. The input signal must be
provided in the appropriate SI base unit (if the signal has a unit of measurement
this is ensured automatically). The selected unit for the output quantity is used in
the result display too. The output signal itself is provided in the respective SI base
unit.
5-52 SimulationX 3
Special Topics
Hint: It is to be always made certain that the curve parameters increase strictly
monotonously with the sequence of the curves is the list.
SimulationX 3 5-53
User Manual 5. Modeling Fundamentals
Toolbar:
The toolbar in the top of the characteristic map dialog differs from the toolbar of
the characteristic curve dialogs in some aspects. It offers access to the following
functions:
5-54 SimulationX 3
Special Topics
Representation of contour
Representation of zone ranges
Representation of grid structure
Reset all contents of the dialog to default values
SimulationX 3 5-55
User Manual 5. Modeling Fundamentals
5-56 SimulationX 3
Special Topics
button on the diagram cancels the zoom operation. A double click on the
diagram re-establishes the original view before all zoom or rotation steps..
Two-dimensional diagram: This type of representation shows the curve in
top view (contour plot). Depending on selection, data points and/or contours,
zone ranges, and/or a grid are displayed.
Three-dimensional diagram: This type of representation shows the curve
in perspective projection. Depending on selection, data points and/or contours,
zone ranges, and/or a grid are displayed.
Point-wise representation of sawpling points: In this representation only
the sampling points given in the table are shown in the curve display. Contours,
zone ranges, and grid cannot be displayed.
Representation of contours: This button activates/deactivates the display
of contours in the diagram. During the point-wise representation of sampling
points this function is not available.
Representation of zone ranges: This button activates/deactivates the
colored representation of contours in the diagram. A zone (altitude range)
corresponds to the range between two contours. During the point-wise
representation of sampling points this function is not available.
Representation of grid structure: This representation activates/deactivates
the connection of the sampling points by a grid structure. During the point-wise
representation of sampling points this function is not available.
Properties of 2D-maps
Clicking the corresponding button in the tool bar of the map dialog opens the
properties dialog for the characteristic map, which permits the setting of
comment string,
physical dimension,
unit and
Interpolation and/or Approximation (the latter with approximation tolerance)
for both, the inputs in the characteristic diagram and for the output value. In the
map dialog a separate tab is available for each of the values.
Comment string:
The comment defines the inscription on the individual axes in the diagram of the
characteristic map. It can contain, e.g., symbols or short describing texts.
SimulationX 3 5-57
User Manual 5. Modeling Fundamentals
with a unit, which can be suitably adjusted by the user. The units affect the
numerical values in the table of the sampling points as well as in the diagram of the
characteristic map. A change of the unit causes a conversion in the table and the
diagram. The selected physical dimension for the curve output does also apply to
the signal output of the component.
Note that the input signals must always be provided in the respective SI base unit.
The current selection of a unit for one of the map inputs does only affect the
representation of the values in the table and the diagram. All internal computations
take place in the SI base unit. This does also hold for the output values of the map.
5-58 SimulationX 3
Special Topics
SimulationX 3 5-59
User Manual 5. Modeling Fundamentals
5.4.4 3D View
SimulationX provides a 3D viewer to visualize, examine and assemble multi body
simulation models. You can use multiple 3D views to display the elements of such
models, their position and orientation while building the model, and see the
animated simulation result. To open a new 3D view use the menu option Window-
>New 3D View.
3
4
Hint: Connector symbols are used for interactive modeling tasks. Therefore they
are only visible during modeling.
5-60 SimulationX 3
Special Topics
Hint: By pressing one of the predefined view angles the camera will be rotated
around the target point. It is recommended to set the target to the object(s) of
interest before using this feature.
SimulationX 3 5-61
User Manual 5. Modeling Fundamentals
Hint: Most camera controls are not available when a model camera is used to view
the scene. Position and orientation of a model camera are defined by its
parameters. To modify position/orientation of a model camera you have to
transform the object itself, using a second 3D-view.
5.4.4.3 Settings
You can customize the way your model is displayed on the screen using various
settings that can be applied to elements and views.
View settings are applied only to that particular view, while object settings effect
the object and possibly its children in every view they are displayed.
To change settings of an object go to the tab 3D settings in the property pages of
that object, view settings are available in the property pages of the current model.
At least one 3D-view has to be opened for a model to see and change these
settings.
Hint: Since every view has its own settings, a tab is added for each of them in the
property pages of the current model.
View Settings
A 3D-view in SimulationX has its own set of settings, which makes it possible to
display one model in different ways at the same time.
To make it easier to switch between certain sets of settings they can be saved and
restored using view modes. There are four predefined view modes available, which
can be activated using the dropdown list in the toolbar.
The settings for each view mode can be examined in the views property page,
where they can be changed and saved. It is also possible to create a new view mode
5-62 SimulationX 3
Special Topics
with customized settings. Saved view modes are available in all views of
SimulationX.
Values contained in the section general settings are not included in view modes.
Hint: The predefined view modes are protected. If you modify them and try to
save them, they wont be changed. Instead, a new view mode is created holding the
new settings.
View Modes
The viewing modes and their settings can be opened from the tool bar at any time.
There are four presets available which cannot be altered. Any changes of
individual settings are saved with the model, though the presets themselves remain
untouched. It is possible, however, to create your own view by simply copying the
current settings.
Custom view modes are saved locally on your hard drive and can thus be used for
all 3D views. View modes can be created, copied and deleted through the
properties dialog of the 3D view. Custom view modes can also be renamed in that
section. Settings from the General Settings are not accounted for in the view
modes, pre-defined view modes cannot be edited or deleted.
Figure 5.42: Modified settings are highlighted in bold (on the left); copying and
renaming creates a custom view mode (on the right).
SimulationX 3 5-63
User Manual 5. Modeling Fundamentals
View Mode
Predefined view modes
Standard view Wireframe
Visibility
Edges
Mode Edge visibility mode
Off No edges visible
Wireframe All edges visible
Silhouettes Silhouette and hard edges only
Hidden Lines Visibility of hidden edges
Only available when edge mode is not off.
To save performance these settings cannot be used with
shadow planes/reflection/shadow maps.
Blend out Occluded edges are not visible
Blend over Occluded edges are visible.
5-64 SimulationX 3
Special Topics
SimulationX 3 5-65
User Manual 5. Modeling Fundamentals
5-66 SimulationX 3
Special Topics
Visibility
Level of detail Different modes to control when to switch between LOD
levels.
Points
Symbol Defines a symbol to be used as point visualization.
Size Size of the points.
Table 5.2: View Settings
Object settings
Every element in the scene has its own settings, which are applied to that element
in every view where this element is visible.
If an object contains child objects (i.e. submodels) its settings take effect on these
objects, too, allowing to use compounds as a single object. However, it is still
possible to override settings coming from the parent object.
Visibility
Visualization Contains a couple of different visibility modes, which
override the global settings of the visibility of edges and
faces.
Use global setting (Standard)
Invisible
SimulationX 3 5-67
User Manual 5. Modeling Fundamentals
Solid
Wireframe
Edges
Points
Local Coordinate Choose at which element state the local coordinate system
System (CS) should be visible
when selected CS is visible when the element is
selected
never CS is never visible
always CS is always visible
Material
Use model values Decide whether the color coming from model parameters
should be used (true/false)
Color Local color setting for this element
Table 5.3: Object Settings of the View
5-68 SimulationX 3
Special Topics
Geometry settings
Geometry settings are part of the object settings but depend on the contents of an
object. Some geometry has specific settings, which are added to their elements
object settings. This is the same for models: geometry settings of their contents are
added to their own object settings. Geometry settings are empty per default. That is
the object doesnt define its own value but uses its parents value. This is signaled
by a blue italic value. If a value is defined on a certain element it is used for every
child which doesnt define its own value.
The model itself cannot derive values from a parent. Therefore its values are
always defined. When creating a new model it is initialized using default values,
which affect every element added to the model.
Geometry settings
[All geometries]
Always in front If true, this object will be drawn in front regardless of what lies
between it and the camera. This may lead to unexpected results
if defined for more than one object.
Trajectories Trajectories Enables/Disables motion paths for the selected
element.
Length Defines the length of trajectory in seconds. '-1'
for no length restriction.
Resolution Smallest time interval between adjacent positions
Always Shows the complete trajectory ignoring the given
visible simulation time. The length of the trajectory must
not be restricted in this case.
[All geometries except coordinate systems]
Shadow Deactivate shadow for this object (if activated in the view).
Reflection Deactivate reflection for this object (if activated in the view).
[Curved geometries ]
Geometry Different levels of geometry approximation.
approximation
SimulationX 3 5-69
User Manual 5. Modeling Fundamentals
[Imported geometries]
Smooth Deactivate smooth shading at object level.
shading
LOD Activate the use of LODs for this object.
Backface Deactivate backface culling to remove visualization artifacts of
culling geometries with inconsistent face handedness.
[Arrows]
Arrow Defines in which direction the arrowhead should point.
direction
[3D curve]
upVector Defines the up vector used to generate the curve: the geometry
shows defects when the difference between two supporting
points is close to the direction of the up vector. In that case it is
recommended to choose another one.
[Coordinate system]
Fixed size Deactivates the fixed size behavior of coordinate systems.
[Free cross section] (Prism, Rotoid, )
Smooth Separate shading option for objects using free cross sections.
geometry
[Quadratic cross section]
X alignment Defines cross section alignment in x direction (center/max/min)
Y alignment Defines cross section alignment in y direction (center/max/min)
5-70 SimulationX 3
Special Topics
If an element contains MBS connectors, they will become visible when the
element is selected.
To add or remove an element from the selection, hold Shift and click it. It is also
possible to select more than one element. To do so, hold the left mouse button to
draw a selection frame. Every element inside of this frame will be selected when
the left mouse button is released.
If you click inside the 3D View, the system keeps track of every element which is
behind the cursor, not only the one which is in front and therefore visible. As long
as the selection is not changed via the left mouse button, you can switch between
these elements using the Tab key.
To deselect everything, simply select nothing by clicking in an empty place of the
screen.
Hint: Use the Tab key to select elements obscured by other objects.
Construction
To create an element, choose the desired element in the library and place it
anywhere inside the 3D view using drag-and-drop.
If you are creating an ITI MBS element it is also possible to start a construction
process, to change the standard values for the geometry dimensions. To do so, hold
STRG while dropping the element into the 3D view. After that, each dimension of
the element can be defined successively using the mouse, and confirmed by
pressing the left mouse button. It is possible to switch between continuous and
discrete input by pressing D on the keyboard. To finish construction, either define
and confirm every dimension parameter, or press Esc to abort the process and
restore the standard dimension values.
SimulationX 3 5-71
User Manual 5. Modeling Fundamentals
Positioning
Translation and rotation of an element in the 3D View is an interactive task done
by moving the mouse while keeping the left mouse button pressed. To make these
tasks easier, a couple of helpful features are available through the following keys:
Hint: These keys are supposed to be pressed once, not held down. It is never
necessary to press more than one key at the same time.
To confirm the new position, release the left mouse button. If an element is
transformed, the transformation will be propagated to all its successors.
To rotate selected elements press R once. You may now click anywhere in the 3D-
view to start the rotation, keep the left button down while moving the mouse.
Without a defined constraint, the element will be rotated around the line of sight.
To rotate around a special axis only, press the corresponding key on the keyboard
(X, Y, Z).The center of rotation is the coordinate system (CS) of the rotated
element. You can switch between different centers of rotation using the Space. It is
possible to choose the CS of the elements input connector, the CS of its
predecessor and the CS of the output connector of its predecessor, if available.
5-72 SimulationX 3
Special Topics
To translate an object you can move it using one of its connectors. It is possible to
constrain a translation along different axes or planes of the reference coordinate
system. To choose a plane, combine the axis constraints (for example: combining
X and Z moves the object along the y-plane). The reference CS is the elements CS,
it is also possible to switch to the global CS using the Space key.
Connect
To connect element A with element B inside the 3D view, simply grab A on one of
its connectors, and move that connector to a free one of element B. If there is no
connector visible at B during the translation of A, it
a) has no connectors at all,
b) has no corresponding connector (input connectors can only be connected
to an output connector), or
c) has no free connector (an input connector may have only one connected
output connector).
When the connectors are aligned on the screen and the mouse button is released, A
and B are connected where A is transformed that way that the CS of both
connectors are aligned in position and orientation. By pressing STRG while
connecting A and B, only the position of the connectors are aligned, the orientation
of the elements will stay as they were before.
Disconnecting Elements
To disconnect Element A from element B, simply move element A away from B
by moving one of its connectors.
Figure 5.45: Separate from elements: separated by pulling the element away at its input
connector will cut the connection to the predecessor
If you move A using its output connector, it will be disconnected from every other
element. The positions of the other elements, successors and predecessors, will
stay as they were.
If you move A using its input connector, it will be disconnected from its
predecessor, but stays connected to its successors, which will move as well.
SimulationX 3 5-73
User Manual 5. Modeling Fundamentals
To move objects without disconnecting press Shift when selecting the connector
(you can release Shift during the translation).
A rotation operation does not cut any connection, but will be applied to the rotated
elements as well as all of its successors, like any other transformation.
Trajectories
During animations, it is possible to show motion paths for any 3D object.
This option can be enabled or disabled in the 3D settings for one or more elements
at any time. The data for the trajectories are not based on the recorded result curves
of the model. They are saved and managed separately in the 3D view. Besides the
setting for the resolution of the trajectories, also the resolution of the animation has
an impact on a smooth motion path.
Recorded motion paths are deleted when the model is reset or if the option is
disabled in the 3D settings.
5-74 SimulationX 3
Special Topics
5.4.4.5 Performance
Low 3D performance may increase simulation time and reduce the quality of
animations. When facing performance problems check these points:
a) Hardware
Update the driver of your graphics card
Be sure your system supports DirectX 9.0c
Decrease the size of the 3D-view
b) Geometries
Reduce the count of visible 3D objects
Reduce the count of facets used in your 3D objects
- Internal objects: reduce geometry precision, see 5.4.4.3
- Imported objects: reimport geometries with lower precision
- Imported objects: activate LOD
c) Settings
Use the predefined view mode wireframe to increase performance
Deactivate advanced effects like anti-alias, shadows, reflection,
hidden line rendering
Create your own view modes to quickly change between settings
optimized for performance/visual quality
Geometries
Imported geometries of high precision may have a severe impact on 3D
performance, if combined with advanced visualization techniques. When importing
or creating these geometries through third party applications, it is recommended to
use low/middle precision settings, especially when these geometries are used for
visualization only.
Built-in geometries support different precision settings if applicable, see geometry
settings.
SimulationX 3 5-75
User Manual 5. Modeling Fundamentals
Visualizers
Using a visualizer the value of a result variable can be shown during the
simulation.
5-76 SimulationX 3
Special Topics
To assign a result variable to the visualizer, open the property dialog via the
context menu. On the page Visualizer there is a combination field where you
can choose the desired variable.
Controls
Using controls you can change parameters during the simulation.
To assign a parameter to a control open the property dialog (context menu). On the
page Control there is a combination field where you can choose the desired
parameter.
The Push Button control can be used to trigger a specific action from the
Diagram view of a model.
SimulationX 3 5-77
User Manual 5. Modeling Fundamentals
The push button control element, there are now two modes:
1. Script execution
When the button is pushed, a script specified in the properties dialog is
executed.
2. Stimulation of a parameter
As long as the button is pushed, the parameter selected in the properties
dialog uses the specified maximum value instead of the defined minimum.
5-78 SimulationX 3
Special Topics
The control "Grid" can only be used with arrays, for example, with a function (see
Figure 5.47). Then the values can be edited comfortably in the table and are
available for the simulation immediately.
The axis label can be inserted on the label of the table. In the example, "| a | b" is
used.
Forms
Forms allow making the diagram view even more readable. For creating forms all
graphical primitives are available. The primitives are selected via the menu Insert
Forms or the control bar Drawing. Different properties of the forms can be
adjusted via the control bar too.
SimulationX 3 5-79
User Manual 5. Modeling Fundamentals
5-80 SimulationX 3
Special Topics
The differences between the two models are listed in the output area.
SimulationX 3 5-81
User Manual 5. Modeling Fundamentals
5-82 SimulationX 3
by
Analysis
Transient Simulation in the Time Domain
6 Analysis
The following sections give a description of the analysis available in SimulationX.
These are:
Transient Simulation in the time domain,
Animation of Results,
Steady State simulation in the frequency domain,
Calculation of the equilibrium state,
Linear system analysis.
Furthermore, the variant analysis is described. The third part will make you
familiar with the order analysis which is a tool used in the torsional vibration
analysis. Power and energy flows within a SimulationX model can be analyzed
with the Power Balance feature.
6.1 Transient Simulation in the Time Domain
The controlling of the simulation in the time domain is done using the buttons of
the toolbar Simulation Control. Check that Transient is set in the selection box
for the kind of analysis before beginning the computation.
Equilibrium
Reset to Start
Start Simulation
Terminate Simulation
Record Animation
The simulation in the time domain is performed from the start time tStart to
the stop time tStop.
SimulationX 3 6-1
User Manual 6. Analysis
The results are the time functions of the variables whose protocol attributes you
enabled. During the simulation the result windows are continually updated.
- Due to this ongoing update of the result windows (plot windows) one can
immediately observe the actual results and their progression.
In the mode Single Step just one step will be calculated. At t=tStart no time
step will be carried, but the calculation of initial values. The results of the initial
value calculation will be displayed in the model explorer. If the soft button Break
Single Step is kept pressed then the calculation of the single step will be
continued till button release.
If the Stop button is pressed, the simulation finishes the current time step in order
to ensure valid result data. If the Stop button is pressed a second time, the
simulation stops immediately and the time is set back to the last valid time step.
For large scale models the execution of this time step may be time consuming and
hence the simulation seems not to stop. In this case, pressing the Stop button a
second time the simulation stops immediately and the time is set back to the last
valid time step and the following dialog is shown.
The command Reset puts the model in the non-initialized state. This means,
simulation time is reset to tStart,
all result protocols and variables are deleted and,
if the result of a previous simulation has been saved as "Initial State" (see
6.1.1.3), the model is initialized with that state. The initial values (in the
elements and connections) of the model become disabled in that case, since
they will be ignored when starting a new simulation.
6-2 SimulationX 3
Transient Simulation in the Time Domain
With the menu option Simulation Transient Settings or by the button the
parameters of the numerical solution algorithm can be changed. This applies to the
setting of numerical parameters (tabs General and Solver) and the display of
certain events during simulation (Tracing).
Here you can change all settings for the computation of the model, e.g. simulation
time, step size, accuracy or solver.
SimulationX 3 6-3
User Manual 6. Analysis
The simulation interval is defined by Start Time tStart and Stop Time
tStop. The stop time must be at least the same as the start time. If the stop
time is identical with the start time, the program only runs the event iteration
for the starting point.
The Scalable Real-Time Synchronization makes it possible, to bring the
simulation time in line with the real-time. Thus a model with a start time of 0 s
and a stop time if 60 s will be calculated in one minute, under the premise, that
the complexity of the model and its numerical features allows this calculation
time. With that interactive simulation, this means that parameters are changed
with control components, like sliders or switches, during the simulation, are
possible within real-time requirements. The definition of a Scale Factor makes
sense, when the designated simulation interval differs strongly from the defined
or reasonable time for an interactive simulation. Thus a simulation of the year-
round behavior of a building can be done in several minutes. For the
synchronization different modes are available:
No Synchronization (Standard Setting)
There is no synchronization. The calculation will be done as fast as possible.
Synchronization related to total time
SimulationX tries to meet the defined total calculation time. If there are
hesitations at some points during the calculation, later SimulationX will try to
regain this lost time.
Synchronization related to protocol interval
SimulationX tries to achieve a constant calculation speed. Hesitations can
sum up and led to a significantly longer total calculation time.
Synchronization of time events
This type of synchronization is suitable for example for models, which work
together with external components operating in real-time. In SimulationX
models this communication is triggered in most cases with time events.
These time events are created with the Modelica when sample(..) construct,
which is for example used in the SimulationX library
SignalBlocks.TimeDiscrete. If this type of synchronization is activated, the
execution of time events is stopped until the real-time reached the simulation
time.
If the synchronization is activated, the stop time of the model can be deactivated by
choosing Infinite in the corresponding combo box. Furthermore the recording of
results is set to equidistant automatically. During a infinite simulation the curves in
the result windows are displayed in a sliding time interval. The size of that interval
can be specified via Display Buffer Length.
6-4 SimulationX 3
Transient Simulation in the Time Domain
The Maximum Calculation Step Size dtMax defines the upper limit of the
step size used by the solver.
The default value is: (tStop-tStart)/100
This permits to perform at least 100 simulation steps. Limitation of the
maximum step size is important especially for models without any state
variables and events. Otherwise, the step size would grow up to the stop time
with such models. For models without state variables, the step size is increased
to dtMax after one successful step unless the step size is limited by an event.
For models with state variables that can be calculated without any problems as
they may have a linear time dependence, the step size grows gradually until the
stop time is reached unless it is limited by an event or dtMax. Please note that
dtMax can have a significant impact on the data logs under these
circumstances (see below).
SimulationX 3 6-5
User Manual 6. Analysis
6-6 SimulationX 3
Transient Simulation in the Time Domain
Select the desired reset point and click the Reset button on the right side of the
selection box. This function carries out the following actions:
The current simulation time t is set to the time of the reset point tRP.
All entries with t>tRP are deleted from the result protocols of variables.
All existing reset points after the selected reset point are deleted.
The model is reinitialized with the state of the selected reset point.
SimulationX 3 6-7
User Manual 6. Analysis
Figure 6.4 shows an automatic generation of 10 reset points after the starting point
over the simulation time. After a simulation run you can reset the model to one of
the generated points by using the dialog Reset Points again and start the
simulation from there.
Saving the initialization internally enables you to define the state of a model at the
current Reset Point (or the current state, respectively) as the initial state for further
simulations. This might be useful for example, if the steady-state solution of a
model (calculated either by the transient or the steady-state solver) is to be used for
further transient simulations (variant analyses, optimization runs etc.). If such an
initial state has been defined (dialog Simulation Control, page Reset Points,
Save Initial State), the following actions are carried out:
The parameter "Start Time" tStart is set to the time of the current Reset
Point tRP. (Otherwise the calculation became inconsistent if the absolute time
t is referred somewhere in the model.)
The status line "Initial state is active" is shown in the dialog.
After Reset, the model is initialized automatically with the saved initial state.
The initial values in the elements and connections of the model are disabled, since
they will be ignored at the next simulation start.
However, the saved initialization state can be removed (dialog Simulation
Control Reset Points, Remove Initial State). In that case, the following
actions are carried out:
The parameter Start time tStart is reset to its original value.
6-8 SimulationX 3
Transient Simulation in the Time Domain
The status line Initial State is not active is shown in the dialog.
After Reset, the model is not initialized.
With a restart of the simulation now again the initial values are used in the
elements and connections of the model.
Alternatively a user changeable initialization file can be generated in SimulationX.
It allows the user to change the values of parameters and variables in order to adapt
an existing model to the current needs without changing the model itself. It can be
also used to adjust starting conditions close to the real solution, to help the solver
to initialize the model properly, even if the underlying equation system is strongly
nonlinear. Another use case is to store the current state of a model at a certain point
in time in an initialization file and to restart a simulation from this state by reading
this file.
You can generate this initialization file (*.isi) by using the menu
Export/Initialization Data. It can be generated from in any status of the model
(e.g. non-simulated as well as simulated). The content is model specific.
If generated from a non-simulated model the file contains only the current values
of parameters. Variables are left out in this case. If it is generated from a simulated
model, it also contains the current values of variables.
The content of this file is plain text and can be modified with any text editor. The
syntax is aligned to Modelica equations. It consists of lines of the form:
<Identifier>=<Value>;
Please note:
The initialization file does not contain the complete state of the model. For
example the state of buffers of Modelica delay operators or the internal state of
external objects is not contained.
The initialization files (*.isi) can be loaded with the parameter userInitFile
in the model. You can access this parameter by double-clicking into the diagram
view of the model on the tab General Parameters of the model properties:
SimulationX 3 6-9
User Manual 6. Analysis
If a path is specified, every time the simulation is started, the file is read in.
6-10 SimulationX 3
Transient Simulation in the Time Domain
6.1.1.4 Tracing
A multitude of debug information can be displayed in the output area during the
simulation, in order to ensure fast and efficient trouble shooting. By using the tree
view, the display of various trace messages (menu option Simulation
Settings dialog, page Tracing) can be switched on or off.
SimulationX 3 6-11
User Manual 6. Analysis
Values are displayed only if the traceOn parameter of the model is set to true
or the analysis of logical condition that is defined there returns the value true.
That way, the output can be limited to a certain time making an analysis much
easier.
With double-click on the diagram view you open the properties dialog of the
model where you have access to this parameter through the tab card General
Parameter.
6-12 SimulationX 3
Transient Simulation in the Time Domain
For example, in order to restrict tracing to a time interval, you must enter the
following relation: t>0.5 and t<0.7 or use the relation displayed in the
following figure.
The tracing settings are not saved with the model. They are stored in the Windows
Registry and apply thus to all models even after a restart of SimulationX.
SimulationX 3 6-13
User Manual 6. Analysis
6-14 SimulationX 3
Transient Simulation in the Time Domain
solvers are not able to solve the system, especially in case of CVode and the
Fixed Step solver, if a nonlinear block cannot be solved.
Solve one-line blocks explicitly
To solve equation systems explicitly, it is sometimes necessary to divide by
the potential iteration variable, even if it can be zero. Usually this is avoided.
Using this switch, this will be done in case the local equation system contains
only one iteration variable and one equation. The assumption is, if it would
be a division by zero in the resolved case, that equation would be also
singular in the non-resolved case and therefore also not solvable.
No index reduction (Only for Steady State Simulation and Input-Output
Analysis):
If the equation system forms a DAE with a higher differential index,
normally some equations are differentiated symbolically to reduce the index.
This may lead to rectangular systems, which cannot be solved by Steady
State Simulation or Input-Output Analysis. In this case, use the switch to
avoid this.
Index calculation
same
Calculation of consistent initial values no
state?
yes
Time step
This step transforms the SimulationX model represented in the modeling language
Modelica into a computable form. The model is now in a solver-internal
representation. Consistent initial values are determined then. Time domain
SimulationX 3 6-15
User Manual 6. Analysis
simulation will start after that. After every successful time step the solver checks
whether an event (e.g. discontinuity) has occurred. In this case, the exact time of
this event is determined as precisely as possible, continuous integration is stopped
and the model is reinitialized.
The following section describes the steps in detail.
Depending on the selected solver the model is represented now either as an implicit
system of differential algebraic equations:
0 = f ( x, x&, p, t ) , (6.1)
with:
x ..... State variables
x& .... Time derivatives of state variables
p ..... Parameters
t ...... Time
6-16 SimulationX 3
Transient Simulation in the Time Domain
In the latter case, implicit parts of the model are solved by small linear or nonlinear
systems of equation during the evaluation of the right hand side (RHS) of the
equation.
For most libraries, all initial values in model objects and connections are set and
fixed to the value zero (e.g. the Mechanics libraries). For most models, this
represents the lowest energy level possible in a system.
Initial values can be entered and fixed in the elements property window or
the Model Explorer (see Figure 6.7). There are also variables with initial
values that are not linked to a separate start parameter, which is often the
case for Modelica libraries. In that case, the initial value of a variable can
be specified through the attributes dialog and fixed if needs be (see section
5.3)
Initial values are consistent only when the values of the state variables and their
derivatives fulfill the differential-algebraic equation systems at the starting point.
The initial values of Ordinary Differential Equations (ODE) are always consistent;
meaning that for each set of the state variables initial values there is a solution to
SimulationX 3 6-17
User Manual 6. Analysis
the system (6.2). The computation algorithm must only compute the highest
derivatives of the state variables in that case. This is demonstrated using the
example of a mechanical one-mass oscillator:
Speed and displacement of the mass are given as initial values. As the initial value
for acceleration
m
a( t = 0 ) = 1100 (6.3)
s2
is computed automatically.
The situation is slightly more complicated if also algebraic parts occur in the
algebro-differential equation. Examples of this are:
Mechanical models with constraints (joints, transmissions),
Electric circuits with parallel capacitors (C-loops) or inductors in series
(L-nodes),
Hydraulic or pneumatic models with connections without volume.
This is called a system of Differential-Algebraic Equations (DAE). Here, the initial
values are no more automatically consistent as the following example shows:
6-18 SimulationX 3
Transient Simulation in the Time Domain
In the first variant, initial values are defined and fixed at both sides of the gear.
However, they are not consistent. The algorithm cannot produce consistency as
free variables are not available. This faulty parameterization is frequently found
when initial values are defined only for one side (branch 1) of the constraint. The
initial values of J2 are still the default values and must be changed by the user.
Consistent initial values can be produced for the other two options: In variant 2
J2.om0 can be determined by the algorithm so that the constraint will not be
impaired. In the third parameterization the initial values are already consistent.
The following information shall help you in dealing with initial values:
Define as many initial values as possible and fix them. This will ensure that the
initial state which you desire will be obtained.
When using constraints, you should carefully decide where you want to define
initial values. Note that with constraints there are some initial values which you
cannot select freely but which must fit the constraints. Set such initial values to
free or fix them with a valid value.
Avoid free initial values with models which represent ordinary differential
equations. The algorithm will then select the consistent initial state arbitrarily
which might not be the one you want though.
The message Calculation of consistent initial values failed! could also point to an
error in the model. Refer to chapter 11 FAQs.
If the calculation of consistent initial values fails (at time t=tStart) try to define
a suitable homotopy, see section 6.1.2.3.
A consistent state must also be recreated after events (reinitialization of the model).
Then the same algorithm will be used. The information what state variables are
fixed or free will then be derived from the algebro-differential equation though.
The following variables will mainly be considered to be free:
purely algebraic state variables,
state variables with a derivative which, however, is not used at any point in the
model,
the highest derivatives of the state variables,
the 1st derivative if the 2nd derivative exists but is not used anywhere in the
model.
All other state variables are fixed and keep their values prior to the event. So they
cannot show any jump.
A frequent modeling mistake is that at certain events jumps are required for state
variables which are not capable of such discontinuous behavior, i.e. whose values
are recognized by the algorithm as fixed during reinitialization. Examples of this
are jumps of the voltage over capacitors which can be realized only with infinite
currents. Other examples are jumps of the transmission ratio of rigid transmissions
SimulationX 3 6-19
User Manual 6. Analysis
which cause jumps of the angle or angular velocity which are physically
impossible!
Note: An exception is found with the elements end stop and rigid
friction(rotatory or linear mechanics).
6.1.2.3 Homotopy
It may be that the calculation of consistent initial values or a steady state fails
although a solution exists. Then homotopy could help. Another application consists
in finding a particular solution when several solutions exist. This last case can
particularly appear for strongly nonlinear models from Thermal Fluid, MBS
Mechanics or Electronics.
Homotopy techniques
SimulationX supports three homotopy techniques:
1. Natural Parameter Homotopy with Modelica homotopy operator (see (6.6))
2. Automatic embedding with fixed-point homotopy (see (6.8))
3. Automatic embedding with Newton homotopy (see (6.9))
The Modelica homotopy operator is also accounted for when used for
automatic embedding in the model (see (6.6)).
They run after the following scheme:
1. The system of equations f (x ) = 0 (x denotes the independent variables, i.e.
state and their derivatives, during the Initial Value or Steady State
Calculation) is suitably augmented by the homotopy parameter
(in SimulationX models lambdaHomotopy) (6.4)
h ( x, ) = 0 (6.5)
2. After the solution of (6.5) for = 0 , curve tracing is used to focus again on
the original task at hand with h(x,1) = f (x ) . Curve tracing begins with = 0
and stops once = 1 has been reached.
6-20 SimulationX 3
Transient Simulation in the Time Domain
Points of the result curve {z = (x, ) : h(x, ) = 0 } are determined consecutively starting
with (x(0 ) , (0 ) = 0) = z (0 ) = z (0,) = (x(0,) , (0,) = 0) (see Figure 6.12). The marker (0 ) refers to the
starting point for curve tracing, and in (0,) the modifier (,) marks the accepted
value (after the corrector iteration, see 2). That applies also to all other points
during curve tracing.
Starting from a calculated point (x (i 1) , (i 1) ) = z (i 1) = z (i 1,) = (x (i 1,) , (i 1,) ) on the curve, the
calculation of the next point (x (i ) , (i ) ) = z (i ) = z (i ,) = (x (i ,) , (i ,) ) looks as follows (see
Figure 6.12):
1. Step size si > 0 and a tangent t (i 1,) in point z (i 1,) = (x (i 1,) , (i 1,) ) on the curve
h(x, ) = 0 define a new predictor point
z (i , 0 ) = (x (i , 0 ) , (i , 0 ) ) = z (i 1, ) + si t (i 1, ) = (x (i 1, ) , (i 1, ) ) + si t (i 1, ) (predictor step).
Tangent t (i 1,) is orthogonal to the derivative of all components of h to z ,
that is dh(z (i 1,) ) dz t (i 1,) = 0 .
2. The predictor point is iteratively improved by a Newton-like method
(corrector step): z (i ,0 ) z (i ,1) L z (i ,*) .
SimulationX 3 6-21
User Manual 6. Analysis
In some applications the user knows different initial states for a modified value of
a model parameter. The choice of different initial values then determines different
solutions of the modified system. The Modelica homotopy operator and the
associated continuation method allow a description of the special path which
connects the known initial state for the modified system with the desired initial
state of the original model.
6-22 SimulationX 3
Transient Simulation in the Time Domain
actual corresponds to the declaration equation or the value for which the model
shall be computed. simplified describes an expression for which an initial or
steady state is known and a salutation can be easily computed.
SimulationX 3 6-23
User Manual 6. Analysis
6-24 SimulationX 3
Transient Simulation in the Time Domain
SimulationX 3 6-25
User Manual 6. Analysis
the BDF Method or the MEBDF Method is set in the dialog Simulation
Control/Solver/General. For the default value iHomotopyType = 1, natural
embedding is used exclusively if the Modelica homotopy operator is in use
somewhere in the model (6.6).
For values 2 and 3, the following applies:
(If the Modelica homotopy operator is not in use throughout the model (see (6.6)),
(6.8) and (6.9) only have f (x ) instead of h(x, ) . x0 is the vector of the state
variables and their derivatives (where applicable) before the calculation of initial
values and the equilibrium calculation. If the dimensions of h und x do not match
during fixed-point homotopy (6.8), all components of h are multiplied by , but
the summand (1 ) (x x0 ) is only added for the dimensional minimum of h and
x . That allows for automatic embeddings to be used with and without the
Modelica homotopy operator. Even without the Modelica homotopy operator, the
homotopy parameter is part of the equation system, and one for = 0 is
apparently x = x0 .)
Tracing/Result windows
The results can be analyzed via the Output (see section 6.1.1.4) or Result
Windows (see section 7.3). Since the values are not recorded as a function of the
time t, examine result variables as a function of the homotopy parameter
lambdaHomotopy (Model Explorer or in the property dialog under
Properties/General Results) or use the Result Window transformation Index
(Result Window Menu: Insert/Transformation / Index). Then result variables can
be viewed solely.
The recording of results during the calculation of initial values via homotopy has
to be enabled. Set the value of bProtocolValuesForHomotopy (dialog
Simulation Control SolverMore Further Parameters) to true. The
result window transformation Index shows all values over the corresponding
sampling point (index number) during curve tracing.
The tracing allows a complete overview (with BDF method or MEBDF method)
about all computations and helps to find reasons when the simulation fails. The
values of states, newton updates, jacobians, or the Errors in the Residuals at an
actual iteration step (Actual Action) during the continuation method as well as the
6-26 SimulationX 3
Transient Simulation in the Time Domain
current step size (Solver Homotopy Step size for homotopy) and the
computed tangent space can be traced (Solver Homotopy Computed
Tangent Space).
The tangent space consists of all vectors whose product with the Jacobian yields
the zero vector. In the case of one-dimensional solution curves it corresponds with
the tangent at the currently calculated point. It is also possible, however, that the
solution set and thus the tangent space are of higher dimensions.
The magnitudes of the calculated states during the continuation method can spread
widely. Thus the continuation method works with scaled values. The scaling can
be viewed after activating the tracing Solver Homotopy Step size for
homotopy (only with BDF method or MEBDF method).
SimulationX 3 6-27
User Manual 6. Analysis
6-28 SimulationX 3
Transient Simulation in the Time Domain
SimulationX 3 6-29
User Manual 6. Analysis
6.1.2.5 Events
An event is a time instant during the simulation run at which:
state variables or their derivatives change in leaps and bounds (discontinuities)
and/or
the structure of the equations changes.
When the structure changes, other equations apply from one moment to the other
or their number changes. Examples of structure changes are:
change between sticking and sliding friction in mechanics,
ideal mechanical end stops,
opening and closing of ideal electric switches.
Time-dependent events are passed on internally to the event queue of SimulationX.
The step size control of the solver ensures that computation proceeds up to these
time instants and event processing will start then.
6-30 SimulationX 3
Transient Simulation in the Time Domain
The values of elementary relations remain constant during integration, i.e. a short
time before the event iteration the old values are used, although the relation may
have changed already. At the event time the integration is stopped and an event
iteration is started. During the iteration the model time remains constant.
During the iteration the values of the relation adjust to the real situation and new
consistent initial conditions are calculated at the same time instant. Thus at the
discontinuity you get two points in the protocol of a variable at the same time, one
before the iteration and one after.
For the event iteration the discrete variables play an important role. They can
change their values only at event times. If a discrete variable changes its value
because of the new consistent state, the iteration is repeated. Only when each
discrete variable keeps its value the event iteration terminates and the integration
continues. It may happen for some model that its discrete variables dont stop
changing in the process of event iteration. In most cases this indicates a modeling
error. Then the simulation stops with the error message "Cycle found in the event
iteration".
The operator noEvent can be used to prevent that certain relations trigger
unintentional events.
Example:
y:=noEvent(if u>uMax then uMax else if u<uMin then uMin else u);
The expressions in the if instructions are evaluated directly without keeping the
values of the relations constant and without producing events.
You can use this to protect the domain of a function:
y:= if noEvent(x>=0) then sqrt(x) else 0;
Without noEvent an error would take place, because a short time before the event
iteration x is already negative, but x>=0 is still true.
The operator noEvent should be used only after careful consideration as it can
mask events which are required for exact computation.
noEvent is absolutely applicable and its use is even to be recommended, for
instance, in the following cases:
The event has no influence on any state variable. This is often the case when
model parts are merely used for evaluation. The continuous integration can then
proceed with the computation over this time instant without any problem.
However, a certain error must be expected in the relation as it cannot be
ensured that the change-over instant is hit exactly.
To intercept values out of the domain of operations and functions (e.g. division
by zero, tan, arcsin ...).
SimulationX 3 6-31
User Manual 6. Analysis
The result changes the slope of a function only to a small extent (e.g. linear
continuation of the exponential function).
You use a relation to produce a continuous run of the highest relevant
derivative of a state variable.
An event is generated automatically at 0.5 sec for the relation even though there is
no discontinuity there at all. The noEvent operator:
The noEvent-property has effect on all relations inside the noEvent function.
All statements within a when-statement are implicitly handled as if they would be
contained in a noEvent function. This is not a restriction, because the body of the
when-statement is not evaluated during normal integration.
6-32 SimulationX 3
Transient Simulation in the Time Domain
Solvers with the addition compiled C-code use a compiled representation of the
model algorithm to increase the computation speed. SimulationX supports the C-
Compilers of the Microsoft Developer Studios (version 6 and above, also the free
Express Editions). One of these compilers must be installed on the SimulationX
computer and can be selected in the dialog Simulation Transient Settings,
tab More, group Compiled Simulation.
SimulationX 3 6-33
User Manual 6. Analysis
If the corrector value is accepted, the next time step can be dealt with. To this end,
a new step size and/or order is computed from the iteration curve.
The Maximum Order can be changed in the dialog Simulation Control, tab
More. It indicates how many of the time steps which have been computed
already may be included in the computation. During a simulation the system
performs an automatic control of the order. When the maximum order selected is 1,
the method corresponds to the implicit Euler method.
When the minimum step size is reached and convergence has still not been
obtained, we get a hint. You should always reduce the minimum step size first
then. Only if this does not help, the error bounds may be relaxed. A reduction of
the maximum order is only required with strongly non-linear models where the
methods with the default settings compute slowly or do not find any solution at all.
The automatic control usually ensures that always the optimum order is used for
computation.
res = J ( xi 1 xi ) (6.10)
where:
res .. Residuals
x ..... State variables
i ...... Number of iteration
J ..... Jacobian matrix
6-34 SimulationX 3
Transient Simulation in the Time Domain
is selected. This solver takes advantage of the fact that mostly only local
dependencies exist with the equation system to be solved. For example, with a
drive line the state variables at the engine depend only indirectly via other state
variables on those at the wheel. This causes many zero entries in the Jacobian
matrix which need not be considered in the solution. This leads to a considerable
faster computation as compared with the Gauss solver.
The Gauss Method is recommended for extremely strongly meshed models
where no sparse Jacobian matrices are found. However, this case is very rare.
Models with strongly differing time constants or high changes of the magnitude of
the state variables can feature badly conditioned Jacobian matrices. The above
mentioned methods will no longer be suitable then to compute an exact solution.
This can lead to a bad convergence in the corrector steps (many corrector
iterations, small step sizes) or even to the cancellation of the simulation. The
Scaled Gauss Method attempts to improve the condition number and thus to
yield a better solution.
Every model contains the variable Solver Debug Info solverInfo which is filled
by the solver. The BDF or MEBDF solver writes the following nine components to
this vector:
1. Order.
2. No. of corrector steps for predictor-corrector iterations.
3. No. of discarded steps (invalid or discarded because of an event) between the
last successful and the current step.
4. No. of steps with too big error estimation between the last successful and the
current step.
5. No. of discarded steps because of lack of convergence between the last
successful and the actual step.
6. Recommended change of the step size (interesting in the context of event steps
and discarded steps).
7. No. of RHS calculations in invalid and valid steps (not during event iterations)
8. No. of discontinuities (Event iterations)
9. No. of Jacobian matrix computations.
10.No. of event-steps, including internal event iterations, at the equilibrium
calculation and embedding
11.Number of substitute event steps in event iterations: for example, for collisions
with end-stops, a numeric integration of (motion) equations (to maintain the
conservation law of momentum) is required; in this case the substitute event
steps during the event iteration are checked for changes in the discrete state of
the system; if changes are found, the next step is suppressed and the equation
system is re-calculated.
SimulationX 3 6-35
User Manual 6. Analysis
In SimulationX you can find out what step size must be presumably chosen for a
stable calculation of such models which are intended for the export to real-time
platforms.
For this solver, the same restrictions as for C-code export are to be considered.
The Min. Calculation Step Size dtMin is the only quantity (beside tStart/
tStop) in the dialog Simulation Control, tab card General on which the
calculation of state variables depend. The step size remains constant throughout the
simulation.
As a result events can consequently not be detected exactly. Inaccurate results can
follow when chosen a too big dtMin. It will be checked once at each time step
(after the calculation of the states) whether a zerofunction has changed its sign.
The potential event iteration will then be carried out subsequently.
In the dialog Simulation Control, tab card Solver you have the choice
between five Integration methods. Their difference consists in their order and the
number of RHS computions (RHS: Right Hand Side or model evaluations) per
time step.
0 : Euler Forward (1 RHS computation, order 1),
1 : ITI Standard (1 RHS computation, order 2),
2 : Heuns Method (2 RHS computations, order 2),
3 : RKF23 (3 RHS computations, order 3),
4 : DOPRI5 (6 RHS computations, order 5).
Responsible for the differing number of RHS computations is the method order
which represents a degree of accuracy of the numerical approximations. As models
are usually not linear and contain discontinuities, eigenvalues often depend on the
corresponding working point in such cases. It is thus advisable to experiment with
various methods and several step sizes dtMin between 1.E-003 and 1.E-006.
6-36 SimulationX 3
Transient Simulation in the Time Domain
Figure 6.23: Stability domains (except ITI Standard whose stability domain is located
inside of those of Euler Forward)
Remark: Stability requires: dtMin has to be chosen such that the product
dtMin lies inside the stability domain for all eigenvalues with negative real
part. Hence a larger stability domain promises theoretically calculations with a
bigger step size.
However our present experience often shows that being able to choose a larger
model step size due to more stability does not compensate the longer computation
time due to multiple calculations of the model.
SimulationX 3 6-37
User Manual 6. Analysis
We recommend to try different methods and different step sizes in the range
between 1.E-003 and 1.E-006 until you obtain the desired results, beginning
with iMode = 1 or 0 and dtMin = 1.E-005.
6.1.3.3 CVODE
This solver can be applied to following models:
- Stiff or non-stiff models (systems having eigenfrequencies and/or time
constants in a wide range).
- Large models are computed mostly faster compared to the (ME)BDF-solver.
This is caused by the compilation of the model algorithm.
Due to the compilation process, the preparation of the calculation takes a bit longer
than using the (ME)BDF-solvers without compiled C-code. Therefore we
recommend the usage of this solver for models, with fixed structure and varying
parameters (e.g. in variant calculations).
For this solver, the same restrictions as for C-code export are to be considered.
Please refer to the latest release notes of your SimulationX version for details.
6-38 SimulationX 3
Transient Simulation in the Time Domain
Written by:
S.D. Cohen, A.C. Hindmarsh, R. Serban, D. Shumaker, and
A.G. Taylor.
UCRL-CODE-155951 (CVODE)
UCRL-CODE-155950 (CVODES)
UCRL-CODE-155952 (IDA)
UCRL-CODE-155953 (KINSOL)
All rights reserved.
Considerably less RHS calculations, particularly for models with a sparse Jacobian
matrix, and consequently an obvious decrease of computation time can be achieved
by a more efficient computation of the Jacobian matrix. By default, it is enabled in
the dialog Simulation Control, tab card More in combination with a Sparse
Matrix solver for the solution of the linear system. It can also be combined with a
Gauss Method or disabled in certain circumstances (Without Efficient Jacobian
computation).
SimulationX 3 6-39
User Manual 6. Analysis
Comparable to the BDF solver CVODE writes the following nine components to
the vector solverInfo:
1. Order (at time t<=tStop)
2. Changing factor of the step size
3. No. of RHS calculations (until time t)
4. No. of iteration steps within one event iteration (enable Recording of Results
At least after dtProtMin (before) and after Events necessary)
5. No. of Jacobian matrix computations (until time t)
6-40 SimulationX 3
Transient Simulation in the Time Domain
6. No. of code generations (until time t) (only for Sparse Matrix solver)
7. No. of decompositions (until time t)
8. No. of solving the linear system (until time t)
9. No. of discarded steps (at time t)
6.1.4.1 Output
For each state variable the solver computes an error estimate. These values are then
weighted and their sum over all time steps is displayed in the column Influence.
At each time step the Fixed Step Solver computes for each state variable (column
States) two numerical approximations whose difference is scaled and summed up
during the simulation. This sum is displayed in the column Influence.
The solver increases counters denoting the changes of discrete variables which
may occur during event iterations. Furthermore, the solver also counts zero
crossings of zero functions that induce events. The results are listed in the column
number of changes and number of zero crossings respectively.
SimulationX 3 6-41
User Manual 6. Analysis
6.1.4.3 Handling
(1) The Performance Analyzer must be enabled before its use (Checkbox
Activate Performance Analyzer). If we are solely interested in a certain
time interval [t1 , t 2 ], t1 > 0, the (de-)activation can also happen during the
simulation.
(2) Setting Record values during simulation time all summed up values at
the corresponding simulation time will be recorded. After stopped or
finished the simulation they can be pursued over time with the help of the
scroll bar.
(3) Otherwise only the values at the actual simulation time are displayed
(press Update or Update list automatically).
(4) Clicking on the head of the list columns affects a sorting after number
(No.) or name (States, discrete variables or zero functions) of the states or
the computed values (Influence, number of Changes or number of zero
crossings).
(5) The tab control element at the top of the list allows switching the view
between the estimated influence of state variables, the changes of discrete
variables during event iterations and the zero crossings of zero functions
on events.
(6) By clicking on an entry, the corresponding component within Structure
View and Model explorer can be directly reached enabling intuitive
assigning of the state variables or corresponding model parts to the
monitored entry.
6.2 Animation of Results
The results of a transient simulation can be recorded and replayed in real-time as
an animation. During running animations motion sequences can be checked within
the 3D-View.
The animation can be controlled and adjusted with the following commands:
6-42 SimulationX 3
Animation of Results
Record Video
Animation in a Loop
Forward to End
Step Back
Step Forward
Back to Start
Start Animation
Terminate Animation
In the result windows (see Figure 6.25) with Y(t) or Y(x)-diagrams respectively a
cross wire is discernible that follows the progress of the result curve during the
animation.
SimulationX 3 6-43
User Manual 6. Analysis
In the result window with a Bar chart (see Figure 6.26) the bars size will be
changed dynamically in accordance to the value of the associated result variable.
Within the diagram view visualizer as well as element symbols and forms with
dynamic properties of appearance allow the additional visualization of results.
On the tab Visualization within the connection properties dialog you can select a
result variable which should be animated. This result variable will be animated at
connection line according to the specified limits with different colors.
6-44 SimulationX 3
Animation of Results
The animation of a 3D-View can be saved as video file that can be played back
with an external player (e.g. Windows Media Player). It can also be given to a third
party and can be included in presentations or web sites.
At the end of the calculation at time tStop the edit box for the mode of Analysis
will be set to Animation automatically. If this behavior is not the wanted you
can open the dialog Options in the menu Extras. Here choose the tab
General and deactivate the option Switch to Animation after Recording.
SimulationX 3 6-45
User Manual 6. Analysis
Via a selection field (see Figure 6.31) you can choose afterwards a video
compression (which exists on your computer), in order to save storage capacity.
6-46 SimulationX 3
Periodic Steady-State Simulation
The following frequency-domain quantities can be displayed for the computed re-
sults:
amplitudes
fluctuation coefficients
excitations
phases
real parts and imaginary parts
In each of these cases the sum curve, the mean value, and the spectral compo-
nents (orders) are shown. Furthermore, for the periodical part of the ansatz the
signal wave form over one period and the fluctuation are available as typical
time-domain results.
The Delay Time with constant delay was implemented in the frequency domain too
and will generate correct results in steady state simulation with continuous-time
input signals.
The user may operate the Steady-State Simulation with the help of the buttons in
the Simulation Control toolbar. Before starting the simulation make sure that
the combo box for the kind of simulation is set to Steady State.
For the handling of the simulation the Simulation Control toolbar offers the
following commands:
SimulationX 3 6-47
User Manual 6. Analysis
Reset to Start
Start Simulation
Terminate Simulation
with the time-dependent vector x (t ) of the state variables, and the corresponding
vector x&(t ) of time-derivatives and an equation
for the computation of the user-selected result quantities y(t ) . In a valid model the
number of state variables n matches the number of equations in (6.11). Conse-
quently, for valid models x (t ) and f have the same number of components.
For an example, in most powertrain applications the vector x of the state variables
is composed of the angles and the angular velocities of the rotational masses and
system (6.11) constitutes Newton's law of motion together with the equations re-
presenting the angular velocities as time-derivatives of the angles of the rotational
masses.
During the steady-state simulation such solutions x (t ) of the system are computed
which can be represented as the composition
t ~ (t )
x (t ) = x P + x [0] + x (6.13)
T
t
of a uniform (linear) motion x P , a constant component x[0] and an unbiased pe-
T
riodical component x~ (t ) . Thereby, the periodical motion is approximated by a
finite harmonic sum
6-48 SimulationX 3
Periodic Steady-State Simulation
N
~ (t ) :=
x x R [k ] cos(kt ) x I [k ] sin (kt ) .
k =1
(6.14)
Here, the indexes R and I refer to the real part and imaginary part of the complex
amplitudes x [k ] = x R [k ] + j x I [k ] in the equivalent representation
N
~ (t ) = Re(x [k ] exp(jkt ) ) .
x k =1
(6.15)
The result quantities y are likewise decomposed into mean value y[0] and the
complex spectral components y [k ] with k = 1,..., N and afterwards transformed into
the diverse representations. Section 6.3.5 describes the computational basis for the
representation of the result quantities in greater detail.
SimulationX 3 6-49
User Manual 6. Analysis
dically oscillating wave form equals zero. In the case of a powertrain this applies
for an instance to the angular velocities of the rotational masses.
When setting-up the steady state simulation the user is required to select one of the
state variables as period variable and to input the period vector component for
that variable by himself. This is in general not a difficult task. E.g., for a power-
train the excitation wave form repeats after two turns of the crank shaft. Therefore,
one may choose the crank shaft angle as period variable and two turns (i.e. 4
radian) as the value for the period variable.
The values of the other period vector components are determined in a separate step
called period computation at the beginning of the steady state simulation.
1. The quasi-static method used for the period computation requires that con-
straints are formulated in terms of states and not in terms of time derivatives.
For powertrains this implies that transmission constraints must be formu-
lated in terms of angles and positions and not in terms of velocities.
2. The model equations should be continuous. This especially applies to points
where
the period variable equals zero or the user-given period and
all velocities are zero.
6-50 SimulationX 3
Periodic Steady-State Simulation
where for each parameter value of x Ref the number of equations equals the number
of variables.
Figure 6.32: Powertrain with additional element loadTorque for the compensation of the
mean engine torque
A powertrain without load will continuously accelerate and therefore does not keep
in a periodical steady-state (with constant rotational speed) if it is driven by an en-
gine under full injection.
Only with a load torque compensating the motor torque the mean engine speed can
be kept at the reference level (see Figure 6.32). Thus, for a powertrain application
it is a good idea to add a torque source as load torque and choose its torque param-
eter as the reference parameter.
SimulationX 3 6-51
User Manual 6. Analysis
6-52 SimulationX 3
Periodic Steady-State Simulation
A comprehensive help for these dialog pages is given in sections 6.3.3 (page
System) and 6.3.4 (page Method).
First, select the computation mode Steady State in the submenu Mode of the
Simulation menu and then click the start button or press the button F5.
The simulation mode can also be selected from the dropdown box
in the toolbar.
SimulationX 3 6-53
User Manual 6. Analysis
You can select the reference quantity from the tree-view in the section "Setting
Reference Quantity" on the system page (see also Figure 6.34). It may be a
system variable or a system parameter.
With the input fields Start and Stop the user determines the boundaries of the
interval within which the reference quantity varies during the steady state
simulation. The values for Start and Stop are not restricted. Stop may be
larger, equal, or smaller than Start. If you choose the same value for both
settings then the steady state simulation is only executed for this parameter value.
As indicated by the mouse pointer in the lower red circle of the example from
Figure 6.34 the angular velocity of the rotational mass jClutchAndGear is
selected by a mouse click.
If you choose a variable as reference quantity, as in the above example from
Figure 6.34, the mean value of that variable is swept from Start to Stop during
the steady state simulation. With a variable as reference quantity you are also
required to select a Compensation Parameter (see section 6.3.3.4). The harmonic
balance adapts the value of compensation parameter in order to adjust the mean
6-54 SimulationX 3
Periodic Steady-State Simulation
value of the reference quantity to the appropriate value inside the user-defined
range.
If you choose a parameter as reference quantity no compensation parameter is
required and the input field for the compensation parameter is disabled.
Figure 6.35: Settings for the period, the fundamental order, and the highest order for a
4-cycle engine
In field Settings Period you select one of the state variables as Period Variable.
For this variable you have to specify the period length. E.g. for a powertrain you
may select the cardan shaft angle as the period variable and input in the case of a 4-
cycle engine the value 4 as period. The period duration of the oscillation is com-
puted from this data and the values for the reference variable automatically by the
steady state simulation.
Further details about the period variable and the period length can be found in sec-
tion 6.3.1.
SimulationX 3 6-55
User Manual 6. Analysis
The relative limits for the step size of the curve tracing algorithm determine mainly
the resolution of the solution curve. The default relative minimal and maximal step
sizes 0.01 and 0.1, respectively, should be optimal for many applications.
Choosing the minimal step size too small may lead to apparent stopping of the
6-56 SimulationX 3
Periodic Steady-State Simulation
curve tracing or even unwanted reversal of the tracing direction. A too large
maximal step size may lead to skipping of resonance peaks along the solution
curve.
Figure 6.37: Frequency responses of nonlinear systems may have turning points in
which the tangent direction of the curve is perpendicular to the direction of
the reference quantity. In such points the step size in direction of the
reference quantity is zero.
The step size is also controlled by the curvature of the solution curve and the con-
vergence of the Newton-algorithm. These aspects of the step size control can be in-
fluenced by the options on the dialog page More Parameters.
SimulationX 3 6-57
User Manual 6. Analysis
Notes:
Since the exact solution is unknown also the numerical error cannot be determined
exactly. As a measure for the remaining numerical error the length of the current
Newton step is used.
Beside the remaining error of the Newton iteration, which is controlled by the
relative tolerance, also the sampling error of the Fast Fourier Transformation
contributes to the overall error in the spectral results. This error can only be re-
duced by oversampling (see section 6.3.4.4).
If the linear method is chosen the relative tolerance is only relevant for the
calculation of the mean values. The oscillation amplitudes of the states are
computed with exactly one Harmonic Newton step starting from zero initial guess
regardless whether the numerical error reaches the relative tolerance or not (see
section 6.3.4.5).
6.3.4.4 Oversampling
In the course of the harmonic balance nonlinear functions must be evaluated in the
time-domain. For the balance of the frequency-domain residuals the function
values are transformed with the help of the Fast Fourier Transformation (FFT) into
the frequency domain. The Oversampling determines how many samples in the
time-domain are used for this discrete Fourier transformation. If N is the number
of spectral components for the harmonic balance then at least
Oversampling 2 N
points are used in the time-domain. Internally, the number of samples is enlarged
to the next power of two since the FFT works best for this case.
6.3.4.5 Algorithm
With the multiple choices box Algorithm you can select one of the following al-
gorithms for the harmonic balance:
1. Nonlinear Method (Newton, GMRES, Jacobi-Precond.)
With this method the harmonic Newton algorithm is applied to the system
equations. As many Newton iterations are executed as it takes for the rela-
tive approximation error to get smaller than the user-given tolerance.
Thereby, the approximation error is estimated by the length of the current
Newton step. It has to be taken into account that the sampling error of the
Fast Fourier Transformation gives a contribution to the overall error which is
not controlled by the error estimator of the Newton algorithm. Therefore, the
Oversampling must be chosen high enough to keep the sampling error small.
The harmonic Newton-Algorithm requires the solution of a large linear
system of equations in each iteration step. The supplement GMRES in the
name refers to the iterative algorithm for the solution of this linear system.
The GMRES algorithm can be speed-up by a pre-conditioner. This is an
approximation for the Jacobian of the harmonic balance equations.
6-58 SimulationX 3
Periodic Steady-State Simulation
Without interpolation there is only one common reference grid. The mean
value and all orders are calculated in each point of this grid. This causes high
computational costs without interpolation.
With interpolation the mean value component and the oscillation orders are
calculated separately each with its own step size control and its own
reference grid. This allows coarser grids and therefore less numerical effort
without loss of precision. Only the results are interpolated on a combined
common reference grid.
SimulationX 3 6-59
User Manual 6. Analysis
The linear methods are suited for systems where the constant component and the
time-linear component dominate the nonlinear system behavior in comparison to
the oscillating signal component.
The linear methods are exact for linear systems which are excited by a generator
whose frequency is chosen as reference quantity and whose phase is chosen as
period variable.
a) Model
Important examples for systems where the constant and time-linear components
dominate the nonlinear system behavior are powertrains with combustion engine
whose conrod is rigidly modeled. For such a powertrain the simulation results once
obtained by the linear method and once by the nonlinear method are depicted in
Figure 6.38. For this example the results of the linear method match very well
those of the nonlinear method. In general it can be stated that for powertrain
applications with rigid conrod and linear drivetrain the precision of the linear
method is sufficient.
For systems with dominating nonlinear system behavior the results of the linear
method may be erroneous. An example for such a system is a spring mass oscilla-
tor with nonlinear spring characteristic as it is exhibited in Figure 6.39.
6-60 SimulationX 3
Periodic Steady-State Simulation
The linear and nonlinear methods differ mainly in the determination of the state
evolution in dependence of the phase angle. The results are calculated from the
states. With the nonlinear methods and with the linear method without inter-
polation the assigning equations for the results are evaluated in the time-domain. In
this way result quantities are correctly calculated even if they depend strongly
nonlinearly on states.
The linear method with interpolation is designed for high calculation speed. With
this method the results are calculated in the time domain only for the large affine-
linear motion of the states. The changes of the results caused by the small state
oscillations are linearly superposed in the results afterwards (as transmission
matrix the Jacobian of the results with respect to the states is averaged over one
oscillation period).
The result quantities required for powertrain applications (such as angles, angular
velocities, and excitation torques) are most often linearly or mildly nonlinearly
SimulationX 3 6-61
User Manual 6. Analysis
If in special applications its influence becomes too large it is possible to switch off
result interpolation through the extended parameter bResultInterpol (press
the button More Parameters... on the Steady State Dialog page Method). If
many result protocols are activated this may slow down the calculation.
b) Realistic result for f2.y without c) Erroneous result obtained with result
result interpolation interpolation
Figure 6.40: Comparison of the results with and without result interpolation
6-62 SimulationX 3
Periodic Steady-State Simulation
Figure 6.41: Activation of the protocol attribute of a result variable in the Properties
dialog of a model element (here jClutchAndGear)
Figure 6.42: Opening a result window for the periodic steady state simulation
For display of a result variable with activated protocol flag chose the variable from
Results (Steady State) in the context menu of the corresponding model element (cf.
Figure 6.42). Thereby the corresponding steady state result window for that
variable opens (see Figure 6.43).
SimulationX 3 6-63
User Manual 6. Analysis
With the tabs Spectra and Signal in the right lower corner of the result
window you can switch between the representations of
the spectra over the reference quantity (as, e.g., the mean angular velocity of a
rotational mass) and
the time-domain waveform over the affine signal-component of the period
variable (as, e.g., the fluctuation of the angular velocity of a rotational mass
over the uniform advancing angle without angle oscillation)
When opening the steady state result window the Spectra are shown by default.
6-64 SimulationX 3
Periodic Steady-State Simulation
~
ymax ~
ymin The fluctuation coefficient
y[0] is a usual measure for the
2 y[k ]
For y[0] deviation of the angular
Fluctuation y[0] = 0 speed of a rotational mass
0 For y[0] = 0 this
Coefficient this from its mean value. It is
quantity is set to the default representation
quantity is
zero. for the angular speed of
set to
zero. rotational masses.
For the computation of the excitation For rotational masses
of a result quantity y only the directly connected to a
approach massless and rigid crank
t shaft the excitation of the
x(t ) := x P + x[0]
T acceleration torque is the
is used. excitation torque
commonly used for order
That means that the unbiased
Exitation ~ analysis in powertrain
periodically oscillating signal x (t ) is engineering.
set to zero for this computation.
For excitations, those results y which
are linearly dependent on the states the
y[k ]
excitation frequency components
(k = 1,..., N ) equal zero and are not
shown.
The phase is relative to the
Phase 0 0 arctan( y I [k ], y R [k ]) null phase of the period
variable.
The real part is the co-
Real Part 0 y[0] y R [k ] efficient of the base func-
tion cos(kt ) in the ansatz.
The imaginary part is the
Imaginary coefficient of the base
0 0 y I [k ]
Part function sin (kt ) in the
ansatz.
Table 6.2: Multiple choices for the spectra representation
The multiple-choice box at the right upper corner (see Figure 6.44) offers the
following possibilities how the displayed quantities are derived from the harmonic
balance results.
At a given reference value the value of the sum curve is the maximum absolute
value of the deflection taken over the Signal in time-domain (Signal representation
in the Steady-State result window).
SimulationX 3 6-65
User Manual 6. Analysis
Figure 6.44: Multiple-choice box for the representation of the spectral components
In the example of Figure 6.45 the Fundamental Order and the Maximal Order both
are set to 1 such that the waveforms of the states are approximated only by their
fundamental components. The output of the nonlinear block xPower5 is distorted
in such a way that its maximum exceeds the amplitude of the fundamental
component. Therefore, the sum curve is located notably above the curve for the
amplitude of the fundamental component.
6-66 SimulationX 3
Periodic Steady-State Simulation
On the diagram presentation at the panel Spectra the sum curve, the mean value,
and the spectral components are listed (see Figure 6.46). The columns in this panel
have the following meaning:
1. With the checkbox in the first column you can switch on and off every single
signal component (sum signal/mean value/individual orders). To select a
range of orders select the start order with the mouse and afterwards the end
order with the shift-button pressed. If you check or uncheck one of the orders
within the selected range all of selected orders will be checked or unchecked,
respectively.
2. In the second column the orders of the spectral columns are listed. These are
the integral multiples of the fundamental order given in the System-dialog of
the steady state properties page.
3. In the third column the maximal amplitudes over the reference quantity for
each of the spectral components is listed.
4. The fourth column lists for each spectral component at which reference value
the maximal amplitude is taken on inside the user-defined range for the
reference quantity (see Figure 6.46).
Figure 6.46: The Panel in the spectra representaion of the steady state results. For the
sixth order (light-blue) it is shown where the corresponding curve takes on
its maximum (blue line) and how large this maximum is (red line)
SimulationX 3 6-67
User Manual 6. Analysis
Figure 6.47: Result window for the signal representation of the steady state results.
The way how the displayed quantity is calculated from the harmonic balance re-
sults can be selected from the multiple-choice box in the right upper corner of the
result window.
Figure 6.48: Multiple-choice box for the computation of the displayed quantities from
the harmonic balance results
The reference value for which the signal wave form is displayed can be adjusted by
the slider or input in the text field and accepted with the enter button or a mouse
click on the button Apply.
6-68 SimulationX 3
Equilibrium (Static / Steady-State)
The numerical method cannot differentiate if a model does not have an equilibrium
or if it cannot be found because, for instance, the selected start values are
unsuitable. For helping the algorithm to find equilibrium, it is possible to carry out
a transient simulation which brings the model near to a possible equilibrium and
start the equilibrium calculation afterwards.
SimulationX 3 6-69
User Manual 6. Analysis
The results from the equilibrium computation are displayed in the model explorer
(for all variables), in result windows (first value of the result curve) or by means of
immediate displays.
You can start a simulation in the time domain or a linear model analysis from the
calculated equilibrium state.
6-70 SimulationX 3
Linear System Analysis
The linear system analysis calculates the eigenvalues for the small signal system
equations which are derived from the simulation model by the linearization of the
model equations in the current operating point.
As seen in section 6.1.2.1 the Symbolic Analysis provides the system equations in
one of two forms. Here we use the more general form
, (), () = (6.18)
, () + (), () + () = . (6.19)
Since the disturbance () shall be small we may approximate the left-hand side
of this equation by its first order Taylor series
To simplify the system for the linear system analysis the time-dependency of the
Jacobians is neglected and rather the Jacobians -
Stop , Stop , Stop and Stop , Stop , Stop
at the stop time Stop of the time-simulation are used. Therewith, we finally arrive
at the equations
SimulationX 3 6-71
User Manual 6. Analysis
() = () (6.22)
= . (6.24)
Since exp never gets zero we can divide by this term and get the eigenvalue
equation
= . (6.25)
which can then be solved for the eigenvalues and the corresponding eigenvectors
by the appropriate numerical algorithms. From these eigenvalues and
eigenvectors all quantities represented in the dialog window `Natural Frequencies
And Mode Shapes of SimulationX are derived (see 6.5.1). Furthermore, these
eigenvalues are the poles shown in the dialog window for the `Input Output
Analysis (see 6.5.2).
6-72 SimulationX 3
Linear System Analysis
You open the dialog window for the natural frequency analysis with Analysis
Natural Frequencies and Mode Shapesor by the button . After pressing the
Update button the computation is performed and the eigenvalues are given in a
table.
The window size can be varied. You may leave it open during other operations.
This allows you to comfortably observe the influence of certain parameters on
certain eigenvalues. Simply change the parameter and re-compute the eigenvalues
(button Update).
Filtering
In addition to the existing possibility to hide frequencies with values zero or
infinity, lower and upper limits for frequencies as well as time constants can be
defined. The filter settings are stored with the model.
The natural frequencies and mode shapes are displayed on five tab cards:
6.5.1.1 Eigenvalues
Display of the complex eigenvalues, damped and undamped natural frequencies,
damping factors D and of the time constants of the current model. Clicking on a
column header sorts the table rows according to the clicked column. Clicking on
the same header alters the sorting order from ascending to descending and vice
versa.
For a given eigenvalue the entries of the corresponding row are determined by
the following rules:
1. The row is marked as time constant T in the first column if is real and as
frequency f if is complex.
SimulationX 3 6-73
User Manual 6. Analysis
6-74 SimulationX 3
Linear System Analysis
With default settings only eigenvalues different from zero and infinity are shown.
If you click on Show All zero and infinite eigenvalues are also represented and
each complex conjugated pair of eigenvalues takes two rows of the table (cf.
Figure 6.51).
You can copy the content of the table to the clipboard by pressing Ctrl-C.
Alternatively, click with the left mouse button into the data area. From the opening
popup menu chose Copy table.
6.5.1.2 Eigenvectors
Display of all eigenvectors and of the names of the respective state variable. By
clicking on a line the corresponding element or the corresponding connection is
selected in the diagram view and in the Model Explorer.
To copy the contents of a table in text format to the clipboard, select the command
Copy table in the context menu of the table.
6.5.1.3 Deviation
An eigenvector is displayed as a value and also in the form of a bar chart. The
length of the red bar is indicating the amplitude of the deviation. The direction
(positive or negative) is selected depending on the phase angle. Complex values in
the right half plane, corresponding to phase angles between -90 and +90 are
shown as positive (to the right), whereas values in the left half plane (-180 to -90,
and 90 to 180) are shown negative. Such vibration mode plots are very common
in natural frequency analysis, showing amplitude and positive (in-phase) or
negative (counter-phase) sign. This comes from the natural frequency analysis
SimulationX 3 6-75
User Manual 6. Analysis
based on mass and stiffness only (undamped systems), where all phase angles are
either 0 or 180. In damped systems any phase angle is possible. Therefore we
also provide amplitude and phase in addition to the bar chart.
By clicking on a line, the corresponding element or the corresponding connection
is selected in the diagram view and in the Model Explorer.
To copy the contents of a table in text format to the clipboard, select the command
Copy table in the context menu of the table.
Natural mode
Select here the eigenvector to be displayed. The order of the entries in the
combobox corresponds to the sorting on the dialog page Eigenvalues.
Filter
Actuate this button to hide any state variables which are not of interest by means of
a selection dialog.
6-76 SimulationX 3
Linear System Analysis
The deviations shown in the bar chart are normalized according to the rule:
max( y ) = 1 (6.30)
In the normalization only the currently displayed state variables are regarded.
You get a print preview of the energy distribution by pressing Print Preview.
There you may choose modes for which the energy distribution should be
represented.
Natural mode
Select the natural mode here, whose energy distribution is to be shown. The order
of the entries in the combobox corresponds to the sorting of the eigenvalues on the
dialog page Eigenvalues (see 6.5.1.1).
SimulationX 3 6-77
User Manual 6. Analysis
Kinetic energy
This table shows the normalized distribution of the kinetic energy Ekin for the
currently selected natural mode. The table contains all elements which can
accumulate kinetic energy (e.g. element Mass, library Mechanics).
Potential energy
This table shows the standardized distribution of the potential energy Epot for the
currently selected natural mode. The table contains all elements which can
accumulate potential energy (e.g. element Spring, library Mechanics).
Power loss
This table shows the standardized distribution of the power loss Ploss for the
currently selected natural mode. The table contains all elements which are linked
with power loss (e.g. element Damper, library Mechanics).
max(Ploss ) = 1 (6.33)
Filter
Click this button to open a selection dialog to hide the not interesting variables and
change other settings.
6-78 SimulationX 3
Linear System Analysis
SimulationX 3 6-79
User Manual 6. Analysis
The crossing points can be exactly measured by clicking with the mouse
on the point of interest. A certain speed range can be marked by 2 vertical
lines. The location of the vertical lines and the represented region of the
diagram can be adjusted by using the mouse or with defined values n by
clicking on the button shown on the left side.
6.5.1.6 Animation
The animation of the natural modes permits three-dimensional allocation of the
natural frequencies and localization of the corresponding components in the 3D
view.
Natural mode
Select the natural mode here which is to be animated. The order of the entries in
the combobox corresponds to the sorting of the eigenvalues on the dialog page
Eigenvalues. The natural mode can also be selected while the animation is
running.
Amplification
With the slider control you can set an amplification factor for the deviation of the
animated natural mode. The deviation can be changed while the animation is
running.
Animation frequency
With the slider control you can vary the animation speed. With an animation
frequency of 1 an oscillation period per second is shown. The animation frequency
can be changed while the animation is running.
Start
Actuate this button to start the animation. During the animation you can set the
amplification and animation frequency and change the active natural mode.
6-80 SimulationX 3
Linear System Analysis
Stop
Actuate this button to terminate the running animation.
Save
Actuate this button to save the animation for the active natural mode as a video in
the AVI format. If more than one 3D view is displayed, you have to select the
desired view from a list first.
To display all values the window size can be adjusted. The window may stay
opened for further operations. This allows you to easily study the influence of
single parameters.
SimulationX 3 6-81
User Manual 6. Analysis
6.5.2.1 Settings
The dialog page Settings permits the selection of inputs and outputs for
performing a linear system analysis. Free signal inputs can be defined as an input.
As output both signal outputs and result variables can be selected.
Edit
Actuate the respective button to add or delete inputs or outputs. A dialog will be
opened to select admissible inputs or outputs of the active model. The variables
can be copied from the tree view of the model by Drag-and-Drop or double click.
Signal inputs of the model suit as admissible inputs and result quantities as
admissible outputs for the input-output analysis.
Excitations
An excitation must be specified for every defined input. For this purpose the
respective input must be marked in the table. There are several options for the
description of the excitation:
6-82 SimulationX 3
Linear System Analysis
Analysis
Before an analysis will be performed the frequency range to be studied must be
specified by means of the following parameters:
Minimum frequency in Hz
Maximum frequency in Hz
Number of samples
Division of the frequency axis (linear or logarithmic)
Results
The table Results contains for every defined output the system response in three
different types of representation:
Real and imaginary part
Amplitude and phase
Nyquist plot
SimulationX 3 6-83
User Manual 6. Analysis
The symbols can be dragged from the result table as a result window into the
SimulationX workspace with Drag-and-Drop or double click. The result windows
opened in this way are stored together with the model and updated automatically
when another frequency analysis is performed.
Actuate this button to update the computation results after
parameter changes in the model or after changes of the settings for
the frequency analysis. Result windows with frequency curves
which are already open will be updated automatically in this
process.
The Poles and Zeros dialog page shows the poles and zeros of the transmission
system as a table and in graphical form as a pole / zero setting chart (beforehand
the inputs and outputs of the system must be determined on the dialog page
Settings).
The pole and zero settings can be highlighted with a mouse click both in the table
and in the graphics. Multiple selections are possible with the Ctrl button kept
pressed. Marked poles or zeros are highlighted with different color in the graphics.
6-84 SimulationX 3
Linear System Analysis
The symbol bar of the dialog page contains the following buttons:
Copies the table in text format and the graphics to the clipboard.
These displays can be copied to other programs with the command
Paste contents.
Opens the print preview. The table and the graphics can be printed
or exported with it.
Shows a magnifying lens. By marking a rectangular area in the pole
/ zero plot you can zoom into a section of the graphics.
Resets the zoom. All poles and zeros which can be pictured are
displayed.
Actuate this button to update the computation results after
parameter changes of the model.
Actuate this button to close the Input Output Analysis window.
6.5.2.4 Export
This dialog page permits the export of the active model at the current operating
point in the state-space representation (if available):
SimulationX 3 6-85
User Manual 6. Analysis
x&= A x + B u
(6.34)
y = C x + D u
or in descriptor form:
E x&= A x + B u
(6.35)
y = C x + D u
with:
x ... state variables
u ... input variables
y ... output variables
As a first step the input variables and output variables of the system must be
determined on the dialog page Settings.
Data format
Determine here the format in which the system matrixes are to be exported. The
following formats are supported
Matlab m-File
Modelica-Syntax
Number format
Under Format string the accuracy and format of the numbers in the exported
data are determined. The syntax used here complies with the rules defined for the
printf function in the programming language C.
6-86 SimulationX 3
Variant Analysis
Designations
Customize the names of the exported matrixes here. Note that the validity of the
designations depends on the selected data format.
Actuate this button to copy the system matrixes in the selected
format to the clipboard.
Actuate this button to save the system matrixes in the selected
format as a file. A file dialog is opened to select the file name and
target directory.
Actuate this button to update the computation results after
parameter changes of the model.
Actuate this button to close the transmission behavior window.
With this button you go to help for how to use this window.
6.6.2 Preparation
Firstly, load the model, which you want to use for a parameter study. In order to be
able to assess how long a simulation will take roughly, it is advisable to execute a
single computation prior to the actual variant computation.
Start the Variants Wizard now. The command you need is given in the menu
"Analysis" or in the tool bar .
Note, that the model is reset during the variant computation. Any existing
computation results will be lost. Therefore, save your model before you start the
SimulationX 3 6-87
User Manual 6. Analysis
Variants Wizard. Open the result window of the variables whose curve you want to
observe during the computation. Activate in the result window the option for an
automatic freezing of result curves, if required (see 6.6.4).
If all result variables, which are selected on page Results within the Variants
Wizard should be observed, the option Show Result Windows (see Figure 6.65)
on page Save can be selected. This will automatically open the selected result
windows and activate the automatic freezing option.
If there is an existing variation description (*.var) available for the active model
with the same name as the model file (*.isx, *.ism), that description is loaded
automatically when the Variants Wizard is started.
Select on the dialog page Welcome whether you want to define a new variant
calculation or use an existing one. You also define the computation task here.
6-88 SimulationX 3
Variant Analysis
6.6.3.2 Parameters
The dialog page Parameters is used to select the parameters to be varied. For
this a tree view is available, similar to that of the model explorer.
You can copy the respective entries to the list of parameters to be varied by Drag-
and-Drop or double-clicking.
Parameter Variations can now be defined through Modelica Array construction
expressions. This admits a far more flexible description of variants. Thereby, the
former specification of start value, step size, and end value can be input as follows:
start:step:stop
You can list several values which may be vectors or matrices. For instance, use the
following expression to list the values value1, value2, and value3:
{value1, value2, value3}
Variation calculations can now also include parameters based on strings, Boolean
values and enumerations. The parameter variation must be described in such a way
that the expression delivers a vector of the same type as the parameter itself for the
result. The simplest form is an array constructor:
{<val1>, <val2, , <valn>}
Example:
{true, false}
{SpringDamper.Kind.Spring,
SpringDamper.Kind.Damper}
SimulationX 3 6-89
User Manual 6. Analysis
{c:\temp\file1.dat, c:\temp\file2.dat,
c:\temp\file3.dat}
You can delete list entries by selecting the respective lines and then actuating the
button .
6.6.3.3 Variants
The dialog page Variants lists the parameter assignment for any calculations to
be performed as a table. You can add parameter sets here or delete selected entries.
6.6.3.4 Results
Select on the dialog page Results the result variables which you want to save for
the analysis of the variant calculation.
At the top of the view you see again the tree of the current model where you can
copy the respective entries to the list below by Drag-and-Drop or double-clicking
with the mouse. The protocol attribute for the selected result variables is enabled
automatically if required.
6-90 SimulationX 3
Variant Analysis
If a result file format is chosen which produces a single file only then it is possible
to let SimulationX automatically open the registered application for the file in
question (e.g. MS Excel for a XML-spread sheet).
There are four output formats available for saving the simulation results:
A text file is created for any result variable, which has been entered in the list.
The directory where these files are created can be selected by using the button .
In the following, an example of such a file is given.
In order to make the comparability of the individual variants easier, the results are
saved in an equidistant protocol step size which can be adjusted in the respective
input field.
Force F[N]
Current Frequency f=5 Hz Frequency f=10 Hz Frequency f=15 Hz
simulation
time [s]
0 0 0 0
0.01 0.0610679658897106 0.115427960730342 0.165126435123372
0.02 0.351107779866563 0.648306137116845 0.857805463509306
0.03 0.84043513728217 1.40536310612747 1.52968568804314
SimulationX 3 6-91
User Manual 6. Analysis
XML file
This output format permits saving of any results of the variant computation in a
single file. Standardization of this format permits to analyze and further process the
data saved in this way through an increasing number of other programs such as
Excel.
The name and location of this file can be adjusted by using the button .
In order to make the comparability of the individual variants easier, the results are
saved in an equidistant protocol step size which can be adjusted in the respective
input field.
In order to make the comparability of the individual variants easier, the results are
saved in an equidistant protocol step size which can be adjusted in the respective
input field.
6-92 SimulationX 3
Variant Analysis
Expression Meaning
[...] The brackets represent a list of varied parameters in the form of
p1, p2, ..., pn
<comment> Comment of the parameter pi
<name> Name of the parameter pi
<value> Current value of the parameter pi
<unit> Unit of measure of the parameter pi
<ident> Identification of the parameter pi
<iVar> Number of the variant i
<numVar> Number of variants n
Table 6.3: Format definitions
Using this format, the results are not saved separately from the model. Instead the
complete SimulationX model including any logged results is saved for any
computed parameter set. This format should be used if the individual computations
shall be analyzed with SimulationX.
In the field Variant Title Format you can adjust the title of the computed
variant. Table 6.3 gives an overview of the entries which are possible here.
Examples:
If you use varied parameters, such as
Another format:
SimulationX 3 6-93
User Manual 6. Analysis
Output:
Using this format, the complete SimulationX model including any logged results is
saved for any computed parameter set in a new project.
The curve labels in the legend are to be given in the format which is specified on
the dialog page Results of the Variants Wizard.
Alternatively to the described preparation and observation of single result
variables, all result variables, which are selected on page Results within the
Variants Wizard (see 6.6.3.4) can be observed using the option Show Result
Windows (see Figure 6.65) on page Save. This will automatically open the
selected result windows and activate the automatic freezing option.
6-94 SimulationX 3
Order Analysis
Under "Program" you fill in the full path to the program to be executed. The
command line parameters required to be given under "Arguments". If required, a
working directory for the external tool can additionally be determined.
Figure 6.67: Dialog for setting the call parameters for external tools
Order Analysis provides a tool for this kind of frequency domain calculations. The
close interaction with the simulation software SimulationX of ITI simplifies the
import of the simulation data to be analyzed. A multitude of customization options
and the automatic selection of reasonable default values for parameters ensure a
flexible, easy, and fast exploitation of the program. Result diagrams can be printed
or exported via the Windows clipboard. All data, settings, and results can be saved
to a file for later reuse.
SimulationX 3 6-95
User Manual 6. Analysis
6.7.1 Installation
The order analysis is not part of SimulationX setup. When required it must be
installed therefore.
When you call the Order Analysis for the first time, a corresponding selection
dialog (see Figure 6.68) appears. There you can choose the installation media
between product DVD and download from the Internet. After successful
installation the Order Analysis can immediately be called without SimulationX
must be vacated.
Alternatively, the installation can also be done from the start screen of the
SimulationX installation DVD.
6.7.2 Functionality
An order analysis is performed using simulated or measured run-up or run-down
data for a drive.
The input data sets are the signal to be analyzed A(t ) (e.g., the torque of a shaft or
the acceleration at some location in the drivetrain) and the base signal (t ) (e.g.
the rotary speed) over a common time base.
6-96 SimulationX 3
Order Analysis
N / 2 1
The maximum frequency f max = depends on the number of samples and
T
the sample time that were used for the FFT.
The coefficients a k are displayed as sonogram or as waterfall diagram alternatively
k
(see Figure 6.69). The frequencies f k = are assigned to the x-coordinate the
T
values of the basis signal are plotted on the y-axis.
SimulationX 3 6-97
User Manual 6. Analysis
6.7.2.2 Basis Signal over Order (Computation over the Integral of Base
Signal)
As opposed to the computation over frequency the analysis signal is not divided
into time intervals T . Therefore, in a first step the time axis is replaced with the
t
basis signals integral over time (t ) = (t )dt :
0
A(t ) = A( (t )) . (6.37)
Knowing the period p of the analysis signals first harmonic over , (which is one
revolution of the engine, leading to = 2 in the above mentioned application
example) the coefficients of the Fourier series can be related to the harmonic
orders:
kp
nk = . (6.39)
P
The coefficients a k are displayed as sonogram or as waterfall diagram alternatively
kp
(Figure 6.70). The orders nk = are assigned to the x-coordinate the values of
P
the base signal are plotted on the y-axis.
The kind of result representation induces a requirement on the input data: The base
signals moving average has to be strictly monotonic (see 6.7.3.2). Furthermore the
computation algorithm requires that the base signals integral is strictly monotonic
in the interval of interest.
6-98 SimulationX 3
Order Analysis
Figure 6.70: Sonogram and waterfall diagram (Basis signal over Order)
SimulationX 3 6-99
User Manual 6. Analysis
6.7.3 Operation
ITI-ORD is started either via the menu Analysis/Order Analysis within
SimulationX or via the Windows Start menu.
Both sections of the window (see Figure 6.72 ) are arbitrarily resizable.
An analysis run is performed in four steps:
1. Source data import
2. Specification of the analysis settings
3. Specification of the display settings
4. Saving, printing, result export.
6-100 SimulationX 3
Order Analysis
Next, in ITI-ORD the button beside the corresponding identifier (Figure 6.74)
is pressed. A window opens, which shows a tree view of all currently opened and
already saved models. Select the corresponding result quantities and press the OK.
This creates the link to the corresponding result quantities. The input box next to
the button now shows a text with the following syntax:
COM@AppID@Model@ModelObject@ResultQuantity
SimulationX 3 6-101
User Manual 6. Analysis
The '@' symbol is a separator for the individual identifiers. The identifier COM
indicates, that the connecting to the Application is achieved via the COM interface.
The AppID indicates the selected application. These entries are subject to further
extensions and should be left unaltered. There follows an entry for the file name
(including the complete path) of the model. The two entries at the end specify the
model object and the result quantity. The last three entries can be set manually too.
This allows, e.g., a quick and easy change of the model file name and path.
When linking the input fields Analysis signal and Base signal are assigned with the
name of the model and the corresponding result quantity. The texts are used to
label the plot axes and can be overwritten with a text of users choice.
To be able to select a source for the time integral of the base signal from the tree
view the corresponding option button has to be selected (see Figure 6.75).
Please note, that it is currently not possible to analyse vector or array sized signals.
If you want to analyse such signals, you have to tranform them into multiple scalar
ignals during the simulation. For the angular velocity of a rigid body with name
body1 from the multi-body library is a vector of length 3. Its x-value can be
referenced with body1.om[1] in a function signal block, whose output is then
used for analysis.
The source data import itself takes place once the analysis and base signals are
assigned to result variables in a model.
Data import is restarted by pressing the Update button (necessary, e.g., if there
was a new simulation providing modified data). If the selected application is not
running at this time, the program is started and the corresponding model is loaded.
For the case that the application, the model, the model object, or the result quantity
is not found, an error message appears. All links to result quantities can be
6-102 SimulationX 3
Order Analysis
modified or newly created at any time. Using the button Info a window is opened,
which displays information about the imported signals.
If the selected result quantity is a rotary speed (e.g., the speed of a rotary node),
then is the period length (2 [rad]). If the base signal is another quantity, then you
have to enter the period in SI. Example: When base signal is delivered in m/s, then
the period has to be specified in meters.
The length of period is important for the correct display of the order lines. The
period length will also be used for the creation of equidistant courses (see section
6.7.3.1).
It is possible to change the period length later and to redo the order analysis.
Basemax
f max =
2
(6.40)
1
dt =
2 f max
The values of the base- and the analysis signal are linear interpolated.
SimulationX 3 6-103
User Manual 6. Analysis
6-104 SimulationX 3
Order Analysis
()
3
2
1
1st FFT 2nd 3rd
Figure 6.78: Base signal reference points and time segments for the FFTs
With this approach the complete data set for the reference signal range from min
to max is covered with FFTs. There are no disregarded signal parts as well as no
overlapping segments within this range.
Please consider that using this method there is no way of directly influencing the
length of the individual signal segments. For long signals and sparsely distributed
base signal observation points fairly long segments are created. Inside such a
segment the frequency can vary considerably, which may corrupt the FFT results.
For short segments and dense base signal observation points the segments become
very short, which results in a decrease of frequency resolution.
The Minimum and Maximum settings define the signal section to be analyzed and
specify the target frequency range.
SimulationX 3 6-105
User Manual 6. Analysis
By pressing the Automatic button reasonable parameter values are selected for all
settings. In particular these are:
Continuous distribution of the base signal observation points
50 FFTs
Minimum and Maximum values of the base signal
1
Minimum frequency = 0, max. Frequency = (dt is the time step size of the
2dt
signals)
If consistent parameters are selected, the button Calculate can be pressed in
order to perform the order analysis and to show the current result.
Analysis Options with Computations over the Angle
Figure 6.79: Dialog for setting the analysis options by computation over the angle
For the views Base signal over order and Base signal over time the following
computational parameters can be changed (cf. Figure 6.79):
Parameter Comment
Sampling points per FFT Number of sampling points that are used
for FFT (this value must be even numbered
but not necessarily has to be a power-of-
two)
Number of periods The width of a interval P is given by the
product of the number of periods and the
period length.
Number of FFTs This parameter defines the number of
windows (intervals) distributed over the
whole data
6-106 SimulationX 3
Order Analysis
N / 2 1
nmax = (6.42)
M
Number of Periods
This parameter defines the width P of the intervals used for FFT as an even numbered
multiple of the basic period length p.
SimulationX 3 6-107
User Manual 6. Analysis
This is why M has to be even numbered; otherwise the solution would not contain
the 0.5th sub harmonic.
Number of FFTs
This parameter defines, how many FFT-windows are placed over the interval that
ought to be analyzed (between Minimum and Maximum). Therefore this number
also affects how much the FFT windows do overlap each other. In an extreme case
two neighboring windows are closer to each other than the source datas samples.
In this case an error message appears after computation has started via Calculate
button. That means the value for the Number of FFTs has to be reduced
considerably.
Maximum Order
The parameter Max. Order ( nmax ) defines the maximum order displayed in any
diagram.
The number of sampling points N (see 6.7.3.2 ) affects the maximum order that can
be displayed:
N / 2 1
nmax = . (6.44)
M
Thus the value of nmax may be automatically decreased. In this case the number of
sampling points per FFT N has to be increased to guarantee the desired maximum
order nmax .
Definition of the Analysis Interval
6-108 SimulationX 3
Order Analysis
With the parameter Minimum and Maximum the boundaries of the interval that
ought to be analyzed are defined. The values correspond to the beginning (the end)
of the first (the last) FFT window. See Figure 6.81 for a graphical explanation.
After marking the checkbox Signal the minimum and maximum of the FFT
values in the display can be specified. This makes sense, if there are significant
differences in the dimension of the individual FFT values.
Further, the display can be toggled between a sonogram and a waterfall diagram
and orders can be highlighted.
The viewing angle of the waterfall diagram can be changed by clicking on the
display and moving the mouse with the button pressed. The perspective is reset to
the defaults again via the diagram windows context menu entry Reset. The
Properties entry in the context menu opens a dialog for the adjustment of the
display options, which allows modifying the remaining display parameters.
Each order line can be visible or hidden and has its own comment. Rational orders
are also shown.
SimulationX 3 6-109
User Manual 6. Analysis
The button Order lines shows the dialog order lines (Figure 6.83).
Each order line can be visible or hidden and has its own comment. Rational orders
are also shown.
2D Display
The 2D View shows the amplitudes of the base signal pursuant the selected orders
(Figure 6.83). You achieve the view by clicking the button 2D View.
The sum level is the maximum of the analysis signal in the time-domain (at the
analyzed base signal). The visibility of the sum level can be set in the dialog of
order lines
Figure 6.84: Illustration of the amplitudes of the speed of the selected orders
6-110 SimulationX 3
Power Balance
In SimulationX the Power Balance is currently available for the libraries Linear
Mechanics, Rotary Mechanics, Electronics and Hydraulics. All elements of these
libraries calculate their characteristically powers. They are defined by the product
of the flow quantity (e.g. mechanical force) and the potential quantity (e.g.
mechanical velocity). Elements can apply power to the system (e.g. mechanical,
external torque), store power in the system (e.g. mechanical inertia or spring) or
generate power losses in the system (e.g. mechanical damper).
SimulationX 3 6-111
User Manual 6. Analysis
There are no general standardized names for both kinds of stored power in
different physical domains (cf. Electronic vs. Mechanics). Because of that the
generic terms Stored Power Type A and B are used.
The Power Balance in SimulationX collects all power components of the elements
in the actual model and assigns them to the 4 types of power. In the model 4 new
result variables are generated, where the assigned power components are summed.
The following table(cf. Table 6.6) shows these 4 Power Balance variables and
defines, which power components of different libraries are assigned.
Library Input Power Stored Power Stored Power Power Loss
Type A Type B
Linear External Power Change of Change of Power Loss
Mechanics Kinetic Energy Potential Energy
6-112 SimulationX 3
Power Balance
On demand you can calculated the related energies by integration of these 4 power
variables.
This variable is a control variable which shows that all components of power are
used in the balance. In that case PSum is 0.
SimulationX 3 6-113
User Manual 6. Analysis
After that, the result variables are generated in the model. They are visible in the
model explorer and their protocol attributes can be activated here.
After opening the model in the TypeDesigner (click on Types in the model
explorer- then double click on model name), you can find these variables on the
page Components. The corresponding balance equations (summation of the single
power variables) are defined on the page Behavior on a separate tab Equations
which starts with the comment //Powerbalance: Do not change
manually! (cf. Figure 6.88).
Manual editing of these equations is not prohibited, but then there is no guaranty
that the complete power balance is correct. Therefor these equations should not be
changed manually.
6-114 SimulationX 3
Power Balance
After changes of the structure of the model or names of model elements the Power
Balance must be updated manually. Simply click again on Power Balance (cf.
Figure 6.85)!
To Insert a Power Balance in a compound you have to open the diagram view of
respective external or inner compound (right-click on the element type-Open-
Diagram View). After that the Power Balance can be added as in section 6.8.2.1
specified.
The completeness of the Power Balance can be checked with the sum of all powers
PSum (cf. section 6.8.1). When all components of power on all substructure levels
are collected successfully, then in the comprehensive modell PSum = 0.
SimulationX 3 6-115
User Manual 6. Analysis
The Power Sensors can be connected in series between two elements of the
respective library. They measure the power flow in the connection between these
two elements.
6-116 SimulationX 3
Troubleshooting: What should I do if...
SimulationX 3 6-117
User Manual 6. Analysis
6-118 SimulationX 3
Troubleshooting: What should I do if...
SimulationX 3 6-119
User Manual 6. Analysis
Modeling
problem!
6-120 SimulationX 3
Troubleshooting: What should I do if...
SimulationX 3 6-121
User Manual 6. Analysis
6-122 SimulationX 3
Troubleshooting: What should I do if...
SimulationX 3 6-123
User Manual 6. Analysis
oscillations, you should decrease the value of dtProtMin. To see all data
generated by the solver you may enter dtDetect as value for
dtProtMin.
The value of dtDetect should not be changed. This step size only affects the
accuracy of the detection of discontinuities. The value should not be higher than
the minimum step size. The minimum step size dtMin should be an integer
multiple of dtDetect.
6-124 SimulationX 3
by
This means that during the simulation a large set (of data) is created.
The following chapter shall show you the possibilities to handle simulation results.
Depending on the respective analysis requirements, you may use
visualizers or
result windows.
7.2 Visualizer
To evaluate the quality of a model, e.g. in the phase of model development or
troubleshooting, it is often sufficient to evaluate selected result variables at the
respective time step. Such evaluations are for instance:
Does any result variable exceed a certain limit?
Does a result variable lie within a certain range?
Does any result variable change at all?
SimulationX 3 7-1
User Manual 7. Result Analysis, Documentation and Settings
Further a minimum and a maximum value can be defined (see Figure 7.3).
Depending on the selected display options additional setting are available.
7-2 SimulationX 3
Visualizer
In the case of the bar graphs and the speedometer this corresponds to the range
which can be displayed. The signal lamp is lit when the linked variable is within
the range.
SimulationX 3 7-3
User Manual 7. Result Analysis, Documentation and Settings
Note: If the background color is set to Transparent, multiple display elements can
be layered on top of each other (see right image of Figure 7.5.
7-4 SimulationX 3
Visualizer
Polar curve
Area chart
Bar chart
Pie chart
Surface diagram (2D, 3D)
SimulationX 3 7-5
User Manual 7. Result Analysis, Documentation and Settings
For the data assignment, it is possible to specify whether the data series should be
given in columns or rows and whether the first row or column should contain the
corresponding arguments (if they cannot be derived from the values index in the
respective column or row).
7-6 SimulationX 3
Visualizer
Labeling, minimum and maximum for each axis of the diagram can also be set. If
the minimum and maximum have the same value, the axis is scaled automatically.
Scalar variables can only be represented as lines as a function of time. The axes are
labled automatically without the option of modification in the table.
7.2.5 Comment
Visualizers can be used for visualizing results anywhere in the model where the
current value is more important than the entire progress over time. Refreshing the
overlay display requires more computation time. If visualizers are only used for
SimulationX 3 7-7
User Manual 7. Result Analysis, Documentation and Settings
visualization purposes during a recorded animation, they can be disabled for the
actual simulation (Extras/Options => General).
7.3 Result window
Result windows are used for graphical presentation of simulation results and their
interpretation. They are being updated during the simulation process and allow
continuous monitoring of the running computation.
7.3.1 Basics
In order to show a result curve of a model variable, several conditions must be met:
1. The variable must be defined as a result quantity in the model. Result
quantities are all those variables that were not explicitly declared
parameters.
2. The variables protocol attribute must be enabled. This can be done in
the Properties window of each component or in the Model Explorer. The
Result Bar (see 7.3.2.5) in the result window provides another way to
activate the protocol attribute (see section 7.3.3.2).
Values recorded during the computation are stored in temporary files by default.
The performance can be improved by increasing the reserved buffer size for each
result value or by keeping the data itself in the memory (RAM). This setting,
however, requires significantly more memory and should therefore only be used on
suitably equipped computers.
7-8 SimulationX 3
Result window
* These values depend on the value of dtProtMin and the settings for
logging results in the Property Bar of the transient simulation.
If several result curves are shown in one result window, following options are
available:
arrange curves within one panel
arrange curves in different panels on one page
arrange curves on different pages (one result curve per page)
For multiple selections all related variables of the same name are shown together in
one panel.
SimulationX 3 7-9
User Manual 7. Result Analysis, Documentation and Settings
You can also drop the selection in an open result window. In this case, the result
curve will be added to the existing curves in the window. Depending on where it is
dropped, the result curve will be integrated into an existing panel or added to the
result window as the first result curve of a new panel or of a new page. For details,
see section 7.3.4.
In order to allow for new result windows to be positioned more precisely when
dragging and dropping results from the parameter dialogs of elements and
connections, the parameter dialog becomes transparent during such operations.
7-10 SimulationX 3
Result window
By clicking the icon of a protocol attribute, logging the corresponding variable can
be enabled or disabled. You can also drag the icon and drop it in a model view
window to create a new result window, or drop it in an existing result window to
add a new curve.
SimulationX 3 7-11
User Manual 7. Result Analysis, Documentation and Settings
Please note that unlike other file formats, a SimulationX result configuration file
includes only references to variables, not the actual values. The available result
variables are accessible through the Result Bar.
For creating result windows, the following file formats are supported:
SimulationX result configuration (*.rsx)
ITI SimX format (*.rfs)
Text format (*.txt, *.csv)
IEEE-binary format (*.bin)
Section 7.3.2.5 applies to SimulationX result configurations.
In order to avoid new result windows to be created each time a result curve is
opened from the context menu of an element or connection, it is now possible to
add new result curves to a new page of an existing result.
There are two options to specify whether this action should be the default behavior
or whether it is restricted to only one open result window at a time. If there are
multiple result windows, the active one is used, i.e. the window which was opened
7-12 SimulationX 3
Result window
last or which is selected in the result window manager. This option is available
from the properties dialog of the result window manager.
The following code fragments demonstrate the use of these classes and methods
for script-driven creation of result windows.
ResultWindows.AddYt "model1.mass1.x"
ActiveDocument.ResultWindows.AddYt "mass1.x"
SimulationX 3 7-13
User Manual 7. Result Analysis, Documentation and Settings
1
2
3 5
6
4
Figure 7.9: Result window
To change the layout of the result window, go to View in the menu bar.
Individual components, e.g. Property Bar or Result Bar, can be undocked.
You can adjust the representation of the results under Options Presentation
For graphical output, the result window offers the following options:
Line graph
This is the default setting when you open a result window as shown in Figure 7.8
and can also be selected by clicking .
Bar chart
7-14 SimulationX 3
Result window
Result variables can also be displayed as bar charts (see Figure 7.10). Click on
.
As a result of changing values for each bar during the simulation, you will see a
simple progress animation.
Certain result variables are more accessible through a polar diagram which can be
selected by clicking . X is shown on the angle and y on the radius.
SimulationX 3 7-15
User Manual 7. Result Analysis, Documentation and Settings
Results are shown in vertical alignment illustrating the share of the total.
Pie chart
In certain cases it makes sense to choose a pie chart over other forms of
representation.
Sankey diagram
The Sankey diagram can help visualize flow quantities (e.g. energy balances).
Quantities are represented by arrows of proportional dimensions.
7-16 SimulationX 3
Result window
y(t)-chart
If in one window two or more result variables with different physical content or
different units are shown, a new y-axis is generated automatically for each result
variable. The same applies to the x-axis.
y(x)-chart
SimulationX 3 7-17
User Manual 7. Result Analysis, Documentation and Settings
7-18 SimulationX 3
Result window
Drag the result curve over the top area of the existing panel (Figure 7.18). A
rectangle marks the drop zone. The new curve will be placed above the existing
one as shown in Figure 7.28.
Drag the result curve over the center of the existing panel (Figure 7.19). A
rectangle marks the drop zone. The new curve will be displayed together with the
existing one in the very same diagram as shown in Figure 7.15.
SimulationX 3 7-19
User Manual 7. Result Analysis, Documentation and Settings
Drag the result curve over the bottom area of the existing panel (Figure 7.20). A
rectangle marks the drop zone. The new curve will be placed below the existing
one.
In the same manner, you can also swap curves around within one window. The
same procedure can be used to arrange panels horizontally.
Please note that panels can only be re-arranged through the context menu or the
page properties (cf. 7.3.9.1) once two curves have been aligned via drag-and-drop.
7-20 SimulationX 3
Result window
In order to copy a page, press the Ctrl-key and hold it before dropping it.
before after
Ctrl+middle mouse Zooming along the axes (scale range)
button Position the cursor over either of the axes and press
Ctrl+middle mouse button. Moving the mouse along the
respective axis will then zoom in or out accordingly.
Shift+middle mouse Synchronizes the x-axes of all panels on the active page
button while moving (vertical alignment only).
Ctrl+Shift+middle Synchronizes the x-axes of all panels on the active page
mouse button while zooming along the axes (vertical alignment only).
SimulationX 3 7-21
User Manual 7. Result Analysis, Documentation and Settings
Zoom
In addition to setting a range (min-max) for the shown segment through the
Property Bar, you can also use the magnifier function from the toolbar to
zoom in to a certain area. Simply mark the area you want to zoom into with a
rectangle as shown in Figure 7.22.
If you need to move the graph around, there is always the option to use the cursor
keys . Each curves view in one window can be customized
separately.
Ctrl Holding the Ctrl-key after selecting the magnifier keeps this
function enabled until released.
X-button Holding X after selecting the magnifier zooms only along
the x-axis.
Y-button Holding Y after selecting the magnifier zooms only along
the y-axis.
7-22 SimulationX 3
Result window
For zooming with the mouse wheel in several panels there are following additional
options:
Ctrl+mouse Smooth zooming within a panel.
wheel
If you want to reset the view after zooming, use the undo-function from the
toolbar. Please note that this will re-enable auto-scale for the axes.
Tip:
For the documentation of a segments exact values it is strongly recommended to
set a minimum-maximum range in the Property Bar.
Custom auxiliary lines can now be moved interactively by drag and drop.
Color, style and width of auxiliary lines can be changed in the Property Bar on the
right-hand side.
In order to delete an auxiliary line, right-click on it in the Property Bar and then
click Delete.
SimulationX 3 7-23
User Manual 7. Result Analysis, Documentation and Settings
7-24 SimulationX 3
Result window
SimulationX 3 7-25
User Manual 7. Result Analysis, Documentation and Settings
General Macros
<simRun> Name or number of the simulation curve.
If the name (value of the global string
variable nSim) is empty, the value of the
global integer variable iSim will be
displayed. This applies only to frozen
curves. Active results have an empty
character string.
<tab> Tabulator: enables individual tokens to be
grouped in columns within a legend
%[flags][width][.precision]ltype
Parameters in brackets are optional.
The parameters have the following meaning:
flag Meaning Default
- Align results to the left within the given Right alignment.
field width.
+ Always show numbers with algebraic sign. Sign only shown for
negative values.
Space Insert a space in front of positive numbers No space.
(ignored if + flag included).
0 Show leading zeros (within defined digit No leading zeros.
range)
# Always show decimal point for type=e, Decimal point only
type=E or type=f. shown when digits
following after the
decimal point.
# Always show trailing zeros for type=g or No trailing zeros.
type=G.
The dot separates the width parameter from the precision parameter. Precision is a
non-negative decimal integer.
7-26 SimulationX 3
Result window
The l-sign (prefix for type specifier) is required, as numbers used are of type
"double".
type Meaning Default
f float: floating decimal shown in the format [-
]mmm.ddd. While the number of digits in front of
the decimal point depends on the integer part of
the number, the number of digits after the decimal
point depends on the defined precision.
e, E float: floating decimal shown in the format [-
]m.ddddddexxx or
[-]m.ddddddExxx,
Precision specifies the number of digits.
g, G float: %e or %E is used only when the exponent is
smaller than -4 or greater than/equal to the
precision argument. Otherwise, %f is used.
Decimal point (if nothing else follows) and trailing
zeros are dropped.
The default setting for numbers is %6lg.
7.3.6 Post-processing
7.3.6.1 Transformations
A transformation is the subsequent modification of the computed results within the
result window, independent of the simulation process. To conduct a transformation
of the active curve within a results window, proceed as follows:
1. Select the corresponding curve from the legend, the combo box in the
toolbar or the Property Bar.
2. Go to Insert Transformation and select an operation.
SimulationX 3 7-27
User Manual 7. Result Analysis, Documentation and Settings
Before being copied into the display buffer, data can be modified by one or more
transformations or can be linked to recorded values of other variables.
7-28 SimulationX 3
Result window
Additional references can be stored in the series object as potential arguments for
transformations and operations with other variables. If linked variables have a
common basis (e.g. simulation time t of the same model), only the Y-references to
the additional variables are stored making the computation process much simpler.
The difference of two variables, for instance, requires a subtraction of only the Y-
values of both pairs of values.
SimulationX 3 7-29
User Manual 7. Result Analysis, Documentation and Settings
If the variables to be linked originate from different models or simulation runs (e.g.
by importing or freezing computation results), both the X- and the Y-references are
stored.
7-30 SimulationX 3
Result window
When forming compositions of operations which have more than one argument it
has to be noted that only the first argument of an operation can be a result of a
preceding transformation or operation. The remaining arguments refer directly to
the respective variables.
SimulationX 3 7-31
User Manual 7. Result Analysis, Documentation and Settings
result curve as an array expression. The first case uses a scalar for the result
expression. The following result dimensions are permitted for the array
description:
Vector[n]: n number of x values
Array[2,m]: m random number of nodes
Array[m,2]: m random number of nodes
Example 1:
Five result curves are to be linked as follows:
= (1. [1]2 + 1. [2]2 + 1. [3]2 ) (1. 2. )
Example 2:
Three result curves are to be added together and then multiplied by 1000.
For vectorial descriptions of expressions, you can also use Modelica array
structures. This allows even for creation of curves that no longer have any
reference to the original data (e.g. ideal curve, slope line etc.).
7-32 SimulationX 3
Result window
{{0,0.5},{1,1.25}} line
{{0,0.5},{1,1.25},{2,0.5}} polyline
{{0,0.5},{1,1.25},{2,0.5},{0,0.5}} triangle
{if i==1 then j else sin(j/180*pi) for i in 1:2, j in 0:360 } sinus function
How to:
1. Move the cursor over the coordinate system, press and hold the left mouse
button. The cursor turns into a crosshair at the current position of the curve.
A small status window shows the active curves values for x and y.
2. If you change the crosshairs position along the curve while holding the left
mouse button the values are updated accordingly. Please note that only
computed points can be displayed. If there is only a small amount of values,
SimulationX 3 7-33
User Manual 7. Result Analysis, Documentation and Settings
the crosshair jumps from point to point. When the mouse button is released,
the crosshair disappears.
When you open the Measure Bar by clicking , you get additional options
while the crosshair remains visible after releasing the mouse button. You can
grab and move the crosshair again to get other values. The values shown in the
small status window are also displayed in the Measure Bar on the right-hand
side..
7-34 SimulationX 3
Result window
Beside the values of the measured points (X1, X2, Y1, Y2), data about the path
difference (X, Y) and the slope (X/Y) between the two points are provided in
the same window.
In result windows with multiple panels, movement of the active crosshairs in each
is synchronized along the x-axis while the small status window is only available for
the selected curve. Values for the other graph(s) are accessible through the
Measure Bar (see Figure 7.30).
SimulationX 3 7-35
User Manual 7. Result Analysis, Documentation and Settings
7-36 SimulationX 3
Result window
Simple drag operations for a variable from the result bar into the
result area of a result window create a shortcut.
Dragging a variable from the result bar into the result area while
holding the Shift key copies the data to the target model.
It is also possible to print out the selected page with all curves displayed.
7.3.9 Settings
7.3.9.1 Property Bar
Via the menu View Property Bar you get access to the properties of the
result window.
This window provides access to all result attributes you may want to edit. Click on
a category to see its available settings in the lower section of the Property Bar. You
can find the most common settings explained below.
Menu bar, toolbars and status bar can be turned on or off under the menu View.
These options may come in handy to save space when having multiple result
windows open at a time.
SimulationX 3 7-37
User Manual 7. Result Analysis, Documentation and Settings
Window properties
In the properties dialogue you can adjust the settings of the window and the
representation of the curves.
Window
Name/Explanation Value
Keep axis settings when frozen True/False
Current settings for minimum and maximum are preserved.
Auto-scale is disabled.
Independent curves for frozen results True/False
When freezing results, an independent curve is created which
can be moved to a different panel, page or window and, hence,
is available for transformations. If this option is deactivated,
frozen results are tied to the original curve.
High rendering quality True/False
Improves image quality for output on a screen at the cost of
rendering performance. For export, high quality settings are
applied by default.
Keep cached values when unselected True/False
With this setting you can increase the rendering speed when
switching between pages of a result window at the expense of
available memory.
7-38 SimulationX 3
Result window
Page properties
Page
Name String
Shows the current page title. Editing the page title disables
automatic labeling.
Automatic labeling True/False
Turns on/off automatic labeling for pages. When enabled,
labels are derived from the first result variable on a page.
SimulationX 3 7-39
User Manual 7. Result Analysis, Documentation and Settings
7-40 SimulationX 3
Result window
You can define the number and position of panels on one page through the page
properties as illustrated in the example below (two panels in one row).
SimulationX 3 7-41
User Manual 7. Result Analysis, Documentation and Settings
Figure 7.34: Result window with one page and two panels horizontally aligned
Figure 7.35: Ergebnisfenster ohne (links) und mit (rechts) individuellem Seitenlayout
Panel properties
Panel
Name String
Enter an optional title for the panel.
Visible True/False
Select this option to display the name of the panel in
the top left corner above the coordinate system.
Chart style Cartesian coordinate
Common settings for characteristics are the Cartesian system
coordinate system and the polar coordinate system. Polar coordinate system
Further options are intended for instantaneous values. Bars
For more information, please refer to the following
pages.
7-42 SimulationX 3
Result window
SimulationX 3 7-43
User Manual 7. Result Analysis, Documentation and Settings
7-44 SimulationX 3
Result window
Axes properties
For individual changes, select the panel you want to customize.
X- and y-axes have the same properties. Properties can be set for each axis
separately.
If the result window holds multiple curves, a common axis (true) can be shown for
each coordinate (x; y).
If auto-scale is enabled (true/false), minimum and maximum are derived from all
curves (common axis) or the selected curve while the axes are optimized to fit the
window showing all visible values. Minimum, maximum and marks, however,
cannot be selected anymore.
"Show axes" (labels) can be enabled and disabled (true/false) referring to marks
and units.
The parameter "additional marks" permits finer scales on the axes (grid). The grid
can be enabled or disabled.
The axes can also be displayed with a logarithmic division.
Depending on the general properties, the parameters "Minimum", "Maximum" (to
generate a section, for example), "Unit" (of measure) and "Marks" can be set under
Options.
The orientation for the x-axis can be set through "Negative orientation
(true/false).
Curve properties
Each curves properties can be customized individually, such as color, line style,
line width and markers.
These settings can be changed by selecting a result variable in the Property Bar
(see Figure 7.33) as outlined below:
1. Select the curve to be customized in the Property Bar.
2. Make changes as desired for the properties below.
SimulationX 3 7-45
User Manual 7. Result Analysis, Documentation and Settings
Series
Label String
Sets the result curve label. You can use different macros for
automatically generated names (see 7.3.5.4).
Visible True/False
Use this option to hide a curve (temporarily).
Auto freeze True/False
If this option is turned on, the selected curve will be frozen
automatically when resetting the model.
Show transformation in title True/False
Includes the transformation in the title. For example, an FFT
of the result mass1.om is displayed as FFT (mass1.om).
Representation
Color Color selection
Sets the line color of a curve.
Line width Numerical value (integer)
Sets the line width of a curve. For fast
rendering, chose 1. For printing or exporting,
broader lines may improve readability.
Line style solid
Sets the line style of a curve. For fast rendering, dash
chose a solid line. dot
dash dot
dash dot dot
Marker No marker
Use markers to improve differentiation of Rectangle
multiple curves. Filled rectangle
Ellipse
Filled ellipse
Triangle
Filled triangle
Alternative triangle
Alternative filled Triangle
Cross
Alternative cross
7-46 SimulationX 3
Result window
SimulationX 3 7-47
User Manual 7. Result Analysis, Documentation and Settings
7-48 SimulationX 3
Result window
SimulationX 3 7-49
User Manual 7. Result Analysis, Documentation and Settings
Transformation
Type String
Specifies the type of a transformation.
Parameter 1
Further parameters depend on the selected
transformation.
7-50 SimulationX 3
Result window
SimulationX 3 7-51
User Manual 7. Result Analysis, Documentation and Settings
7-52 SimulationX 3
Result window
All result windows with Fast Fourier Transformation are closed when the model is
reset.
It is defined as the Fourier transform of one signal divided by the Fourier transform
of the other signal:
Y(j )
H ( j ) =
X(j )
X ... signal2 (input) (7.1)
Y ... signal1 (output)
H ... response function
SimulationX 3 7-53
User Manual 7. Result Analysis, Documentation and Settings
Complex frequency response functions can be derived from the ratio of various
output and input signals. Here are some examples:
dynamic flexibility (displacement to force),
mobility (velocity to force),
accelerability (acceleration to force)
dynamic stiffness (force to displacement)
impedance (force to velocity)
resonant mass (force to acceleration).
7.4 Printing (PrintEngine)
This chapter explains how models and results are documented. Any Windows
printing operations are assumed to be known. By the menu File Print
Preview you get to the printing preview.
All printable parts of the actually model are listed in a hierarchical tree view, such
as
Diagram view
Global Parameters and results
Components and
Result charts.
Toolbar
Page preview
7-54 SimulationX 3
Printing (PrintEngine)
In the Document structure the printable components are sorted out according to
structural criteria. Each selection refers to the selected components and the
underlying components.
In the View the printable components are sorted out according to textual criteria.
7.4.1.2 Toolbar
The existing toolbar permits further settings for the document and various output
options.
Initializes the printing process
Setting up the printer
Setting up the page layout (s. a. paper size, source and
direction, border)
Exporting the document in 3 formats
PDF-File (*.pdf)
Rich Text Format (*.rtf)
HTML-page
Sending the document as an email
Bar for navigation in the document
Displaying/hiding edge marks
Adjusting font size (5 sizes).
Selection of print view layout
Closing the print preview
The following properties of the page layout are adjustable (see Figure 7.39):
Page format (paper size, paper direction, border)
Header (label and font size)
SimulationX 3 7-55
User Manual 7. Result Analysis, Documentation and Settings
7-56 SimulationX 3
Printing (PrintEngine)
For labeling of header and footer a selection of predefined field types are available.
SimulationX 3 7-57
User Manual 7. Result Analysis, Documentation and Settings
Set simobj=doc.SimObjects.Add
("Mechanics.Translation.Mass", "Mass1", 90, 90)
Set simobj2=doc.SimObjects.Add
("Mechanics.Translation.Spring", "Spring1", 180, 90)
Set simobj3=doc.SimObjects.Add
("Mechanics.Translation.Damper", "Damper1", 180, 150)
doc.Connections.Add "Mass1.ctr2", "Spring1.ctr1",
"Connection1"
doc.Connections("Connection1").AddLine "Damper1.ctr1", 145,
105
' Parameterization
doc.SimObjects("Mass1").Parameters("m").Value = 0.5
doc.SimObjects("Spring1").Parameters("k").Value = 1000
doc.Connections("Connection1").Parameters("x0").Value =
0.01
doc.Connections("Connection1").Results("x").Protocol = true
doc.Connections("Connection1").Results("v").Protocol = true
' Open a result window
Set wnd = sim.ResultWindows.Add("Connection1.x")
wnd.SetMinMax 0.0, 1.0, -0.01, +0.01
doc.Parameters("Damper1.b").Value = 2
doc.Reset
doc.Start
Set pe = doc.PrintEngine
If pe Is Nothing Then
MsgBox "Error getting printengine"
Else
7-58 SimulationX 3
Printing (PrintEngine)
End If
Figure 7.41 shows the result of the script controlled print. The inserted pictures on
page 3 are made via a capture program. The structure of the page corresponds to
the sequence of the notation in the script.
SimulationX 3 7-59
User Manual 7. Result Analysis, Documentation and Settings
Parameters can be imported and results output via the existing COM interface (see
Chapter 9). This is helpful for the automation of simulation runs.
7.5 TVA Report Generator
The TVA Report Generator generates analysis reports as DOCX files, i.e.
Microsoft Word. These reports are based on model parameters and computation
results from SimulationX models. These SimulationX models are 1D mechanical
powertrain structures including inertia and spring-damper elements as well as
engine and machine elements.
7-60 SimulationX 3
TVA Report Generator
The data is transferred between the TVA Report Generator and SimulationX via
the COM interface. In order to utilize the TVA Report Generator, the following
requirement must be met:
SimulationX 3.7 with a valid license must be installed to use this tool
Elements
A list shows the components generated for the report. It is possible to unselect
report components that are not required.
Templates
Word Document:
Specify the directory of your DOCX template file (file extension *.docx).
Configuration file:
Specify the directory of your configuration file. This file must be an ASCII
text file with file extension *.ini (DefaultSetting.ini). For more information
about this configuration file, see chapter Configuration File below.
Settings
Project, Customer, ProjectNo, Mode:
Enter the name of your project and your customer as well as your project
number and your simulation or analysis mode. This information will be
printed on the cover and shown in the header of each page of the report or at
SimulationX 3 7-61
User Manual 7. Result Analysis, Documentation and Settings
Note: All selected file paths and customized settings will be saved, when the
program is closed. So they are available for the next session of the TVA Report
Generator.
Report Generation
If this option is selected, the TVA Report Generator
opens the file in your default DOCX application upon the report generation.
DOCX Template
The TVA Report Generator comes with a default template with an ITI-specific
layout (Template.docx). This file is Users\PUBLIC\Documents\SimulationX
3.7\TVA Report Generator.
Note:
Within this template, there are several strings: #CUSTOMER#,
#PROJECT_NAME#, #PROJECT_NO#, #MODE#.
These strings are fixed placeholders which are filled by the TVA Report
Generator:
#CUSTOMER# customer or client
#PROJECT_NAME# project name
#PROJECT_NO# project number
#MODE# analysis or simulation mode
7-62 SimulationX 3
TVA Report Generator
If you want to modify this configuration file, it is recommended to copy the ITI
template. The file can be opened in any text editor.
The file contains several groups of model types which are to be included by the
TVA Report Generator and hold required parameters.
Note:
Do not change these group headers. Only change the list under the header if
required.
The groups contain lists of model type idents, as you can see them in the
library bar of SimulationX. At the end of each ident, there is the name of the
corresponding parameter which holds an inertia or stiffness value, for
instance.
Example 1: Mechanics.Rotation.Inertia.J
The TVA Report Generator searches the simulation model for elements of
type Mechanics.Rotation.Inertia. For each element of this type,
the TVA Report Generator reads the value of the parameter J. According to
the Default.ini file, J is an inertia parameter (-> group [Inertias]) and thus
the value is written to the table of the system parameters in column Inertia.
In the case of engine models, the model type ident is followed by a list of
parameters in brackets. The engine elements in a simulation model hold more
than one parameter for the report. Thus this list assigns model parameters to
report parameters.
Example 2: TVA.Engines.LEngines.L4 (NoCyl=NoCyl:4,
CylBore=bore, Stroke=stroke, NoStrokes=kindCyl,
RecMass=mOsc, RodRatio=ratio)
The TVA Report Generator searches the simulation model for elements of
type TVA.Engines.LEngines.L4. If one is found, the TVA Report
Generator reads the value of the parameter bore, for instance. According to
the Default.ini file, bore is assigned to the report parameter CylBore and
thus the TVA Report Generator understands the value as cylinder bore
parameter and writes it to the engine data table.
SimulationX 3 7-63
User Manual 7. Result Analysis, Documentation and Settings
, = ,
= 60
in [rpm];
with O = {0.5 ; 1 ; 1.5; ; Omax} and Omax, which is the setup parameter
Max. Order (see above in section 7.5.1)
The vector sum angle is computed based on the complex firing angles
and complex eigenmodes of each cylinder c for each order O:
o Complex firing angles for each cylinder c using the given firing
angle of the cylinder c:
7-64 SimulationX 3
General Settings
( ) = cos( )
( ) = sin( )
o SimulationX provides magnitude RN,c and phase , for each
eigenmode Nc for each cylinder c:
( ) = , cos,
( ) = , sin,
o Summation of the complex firing angles and the complex
eigenmodes for each cylinder c:
, = ( ) ( )
, = ( ) ( )
o Summation of the real and imaginary parts:
= ,
= ,
= 2 + 2
7.6.1 General
If you want to make during the simulation, a visualization of Visualizers, Modelica
graphic primitives or state charts, the control Enable Diagram View Animation
during Simulation must be set in the register General. This can increase the
computation time.
SimulationX 3 7-65
User Manual 7. Result Analysis, Documentation and Settings
You can choose a default action to be performed every time SimulationX is started:
Create New Model
Open Recently Used Model
No Model at Startup
In the section Warnings and Errors, you can specify how SimulationX should
deal with warnings and errors. Pre-defined checks can be changed to customized
analyses.
7-66 SimulationX 3
General Settings
7.6.2 Directories
With the menu Extras Options Directories you can change the paths which
were generated by SimulationX during installation (see Figure 7.43).
7.6.3 Libraries
The section Libraries gives an overview of all available model libraries. You can
specify which libraries are loaded when SimulationX is started and whether
excluded libraries should be loaded automatically when a model requires them.
The table shows the version and directory as well as the current status of the
libraries (Load at start, existing license, currently loaded). An overview of all
shown states is available by clicking on the Legend button.
For external libraries, this requires the option Load external libraries
automatically to be enabled. If only certain packages are to be included, disable
the option Load external libraries completely. This may need more time to
compute for missing references if within the affected model functions or constants
SimulationX 3 7-67
User Manual 7. Result Analysis, Documentation and Settings
from other packages are used in equations or algorithms. These references are
currently not supported when libraries are loaded automatically.
7.6.4 Storing
So far, all data, which was recorded during a simulation run, has been stored in
memory.
This data can optionally be stored in the file system too. Current hard disk
technology and intelligent buffering permit almost equivalent access performance
compared to storage in memory. The option can be turned on and off via the menu
Extras Options Storing.
You can also select the standard file format for storing (*.ism or *.isx).
When the option 'Store Modelica Conform' is selected, models are stored as *. mo
files without results and without inclusion of the SimulationX calculation
environment.
Storing calculated models with results may occasionally lead to large files on the
hard disk. This can be avoided selecting the option Store without Results by
default'.
7-68 SimulationX 3
General Settings
The AutoRecover allows protecting your work against power failures or other
unwanted program terminations. If the feature is activated, temporary copies of
modified models are stored in the specified regular intervals of 5 min (default
setting) or longer.
With the AutoRecover feature turned on, on the next SimulationX launch after an
abnormal termination the models affected are displayed in a recovery dialog. From
there they can be restored and saved (cf. Figure 7.46).
The information in the files reflects the state at the last auto-save.
AutoRecover does not replace the manual saving or backing up of your files!
SimulationX 3 7-69
User Manual 7. Result Analysis, Documentation and Settings
If when using SVN the storage of backup copies of modified types is not desirable,
the creation of backup files can be deactivated by the option "Store backup for
models and types".
7.6.5 Modelica
Figure 7.49: Modelica Settings in this Register the appearance of the text editor is
specified.
7.6.6 Editor
Also a special text editor (e.g. Notepad++) for working on the text view can be
adjusted by setting a file path.
7-70 SimulationX 3
General Settings
Preferred driver:
Here the preferred 3D driver can be selected. The default setting 'Auto'
should only be changed when problems occur with the 3D graphics. ->
Changes are only applied when a new 3 D view is opened.
Camera controls:
Specifies the mouse button controlling the camera.
Allow animation during the simulation:
Disables the refresh rate of the 3D view during a simulation in order to
reduce computation time.
Copy to clipboard:
Resolution: Virtual resolution of the created image. The value 96
corresponds with the original size of the 3D view on the screen.
White background
If enabled, settings for the 3D views background are ignored showing a
white background instead.
7.6.8 Fluids
Figure 7.49 shows the available settings for the Fluid selection. For more
information see section 8.3.
SimulationX 3 7-71
User Manual 7. Result Analysis, Documentation and Settings
7.6.9 Miscellaneous
In this tab the label of the elements is set, as they are shown in the model.
Customizing of element labels and connection labels are described in section
5.2.3.3.
7.6.10 Connections
Connections can graphically represent their state during the simulation. The default
behavior for individual connection types, e.g. Mechanical connection (linear), you
can specify on this dialog page.
These settings are stored globally and thus apply to all models, as long as no local
settings for individual connections were made in the model.
7.6.11 Languages
With this menu option you can select the dialog language of SimulationX. You
will get a list of the languages that are available. As you click with the mouse on a
language it becomes the dialog language for SimulationX.
7-72 SimulationX 3
General Settings
7.6.12 Licensing
Using the menu Extras Options Licensing allows you to switch to another
license. It can be done by a click on the button below SimulationX start as:
followed by selecting the desired edition. See chapter 2.
7.6.13 Maintenance
This dialog allows you to check for update and specify the interval when
SimulationX is supposed to check for updates automatically. This requires a
working internet connection. Before you install any update, we recommend you
read the Release Notes first.
SimulationX 3 7-73
User Manual 7. Result Analysis, Documentation and Settings
Office Add-ins can be installed from the Options section (see section 9.2). You
can also customize the installation of SimulationX (e.g. add new libraries). Please
note that the Office Add-ins are bound to a specific user. When other users log on
to Windows, they must reinstall the Office Add-ins under their account in order to
use them.
You can also reset all settings you made for non-licensed or not installed features.
(Disable this function permanently, see Figure 7.54).
7-74 SimulationX 3
General Settings
If icons in the toolbar are not displayed properly after an update from SimulationX
in the tab Options a Reset my usage data can be helpful.
SimulationX 3 7-75
User Manual 7. Result Analysis, Documentation and Settings
7-76 SimulationX 3
by
In general, the user defines new types via the TypeDesigner, which is integrated in
SimulationX. The format and location for saving the definition can be configured
during the definition process. Furthermore, between different security levels can be
chosen to define permissions for using and changing this type.
A distinction between global types and local types is defined. Here and in the
following of chapter 8 this is done from the perspective of an opened simulation
model in SimulationX:
Global types can be found within the library bar of SimulationX. These types are
globally defined in the program environment and useable for all models or other
types. Global types are saved as individual file separately or in the package.mo file
of a corresponding library package. Those packages can also be saved as a
directory folder. The path is determined with respect to the directories in Extras
Options Directories Modelica Search Path.
Local types are saved inside of a simulation model and can be found in the model
explorer on page Types. Thus the usage of local types is limited to the model itself.
SimulationX 3 8-1
User Manual 8. Customizing and Extension
This feature is used to change local types into global types (and vice versa) or to
change its position inside the tree structure. The handling procedures are described
in chapter 4).
It is possible that the copy and move functionalities are limited by the encryption
of types.
Moving a type from the library bar into the tree structure (page Types) of the
model explorer (and vice versa) changes the reference within the element (model
component). That is essential, because while moving the element its storage
location is also changing. Hence the old reference is not valid anymore.
Example:
The global type Type_move in a user defined library package UserDefinedTypes:
is used in a model. The reference can be determined in the element property dialog
on page "General" or in Modelica code of the model. The current type reference
is UserDefinedTypes.Type_move.
By moving the type via Drag-and-Drop into the model, the reference of the type to
the element will be changed to Model1.Type_move (compare Figure 8.1).
However inside the Modelica code, the name of the model is not included in the
reference.
The type is no longer available within the library bar and cannot be used for
modeling in other models than Model1. Already existing models, that are not open
during the moving process (including model components of the type Type_move),
still contain the type reference UserDefinedTypes.Type_move. These models
8-2 SimulationX 3
Administration of user-defined Types in SimulationX
cannot be opened anymore correctly. An error message will be generated, that the
corresponding type is unknown.
It is also possible to move types from the model (model explorer, page Types) to
the library bar. There the reference in the element (model component) is changed
as well.
1. The *.mo files of the user-defined type are saved on a network drive in a
way, that SimulationX is loading and using the same files on both
computers.
2. The files for the user-defined types are present at both computers, while
name and content should be identical and
the tree structure of the library containing the user-defined types has to be
identical on every computer.
When changes on types have been conducted, the *.mo files have to be
changed. The exchange of *.mo files is also possible during a SimulationX
session, but the function Reload has to be executed before a new
simulation run is started.
3. The types are saved as local types inside the model and are passed on within
the model file.
For saving types as local types within the model, the function for resolving
external references (Menu Edit Resolve External References) can be used. It
SimulationX 3 8-3
User Manual 8. Customizing and Extension
copies the global types into the model (creation of a local type) and resolves the
type references from global to local. The global type still remains in the library bar.
The feature creates a special entry Imported Types in the model explorer. This
entry contains the imported local types. Moreover, external fluid definitions will be
imported in the same way.
If user-defined type elements are used by more than one user, it is recommended
that one user is responsible for data administration and management.
After editing and saving an existing global type, a backup file is generated by
SimulationX automatically.
The backup file gets the file extension .mo1. Further changes result in increasing
the counter step by step with increment 1. The file with the highest index is the
latest back up file.
The creation of a new package in the library bar usually results in the generation of
a new directory. The name of the new package is identical to the name of the new
directory. During entering the name, SimulationX pays attention to a correct
syntax and already existing names in the same level of hierarchy. It is not allowed
to use identical names for packages or types in the same level.
A file package.mo will be generated within the new file directory. This is
necessary to ensure compatibility with Modelica definitions.
8-4 SimulationX 3
Administration of user-defined Types in SimulationX
Figure 8.2: Type and file system structure of global user-defined types
The type NewElemType3 was created with the attribute Save Within Environment
(No Own File). Its source code is contained in the file package.mo, which
corresponds to the package NewGroup1. The types NewElemType1,
NewElemType2 and NewElemType4 were saved as individual files. I.e. for each of
them an individual *.mo-file is existing.
Files ending on mo1, mo2, etc. are backup files which are created by SimulationX
whenever a type is modified (this behavior can be deactivated with the
corresponding setting at Extras Options Storing). Files containing # are
generated when new versions of types are created.
SimulationX 3 8-5
User Manual 8. Customizing and Extension
It is possible to create the library tree structure for a user-defined library outside of
SimulationX. To avoid problems during the load process it is necessary to pay
attention about the used syntax.
Fluid types
Fluid types are defined with the FluidDesigner. These fluid types are separately
saved in a Name.mo file. The path is taken with respect to the directories in
Extras Options.
SimulationX model
Per definition a SimulationX model is a type, similar a type. In addition to the type
there are additional information, parameters , which are necessary for a
simulation computation. Hence a SimulationX model is also editable via the
TypeDesigner. To access the TypeDesigner, double-click on the model on Model
Explorer tab Types. Alternatively you can perform a right-click on the model Open
TypeDesigner. (For more information please refer to section 4.2.4).
8-6 SimulationX 3
Administration of user-defined Types in SimulationX
The import for ExternalTypes directories takes the types which were created within
the ExternalTypes package and converts them into a Modelica package. It can be
used like ordinary Modelica packages by integrating them, using the Modelica
search path.
The import dialog for ExternalTypes packages (Figure 8.3) can be accessed
through the options dialog (menu Extras/ Options) under Directories /
Modelica Search Path by clicking the button External Types.
The text field External Types Folder has to contain a path to a directory that
corresponds to an ExternalTypes folder which was created with SimulationX 3.5 or
earlier. That means, the path should be identical to a valid entry for a
ExternalTypes directory in the earlier version of SimulationX. Instead of the
manual input, the path can also be selected using the Search button.
At Package name a new identifier must be entered for the Modelica package,
which is created be the import of the ExternalTypes directory.
SimulationX 3 8-7
User Manual 8. Customizing and Extension
To declare a path in the Directory for MODELICAPATH, there are the following
possibilities:
This (new) directory will be automatically added to the Modelica search path.
By clicking the OK button, a new directory with the specified new package name is
created in the chosen directory for the Modelica search path. All files and
subdirectories from the ExternalTypes folder will be copied to the newly created
directory. Additionally, a package.mo file is created to fulfill the requirements for
Modelica packages. The package.mo file also contains the special Modelica
annotation __iti_ExternalTypes=true, which labels the package as a former
ExternalTypes package. The original ExternalTypes directory is not modified by
the import.
SimulationX creates internal links for the types from the imported ExternalTypes
package. These links are used to resolve references which still contain
ExternalTypes as part of their identifiers. This may occur, when models are loaded,
that have been created with an earlier version of SimulationX. In special cases, e.g.
when relative identifiers were used in the former external types, the internal links
may not be sufficient. Such relative references can be corrected using the
interactive type correction.
It is not only possible to correct references, which occur in the type which is about
to be loaded, but also for references within types outside the current type, which
are needed for its instantiation. Corrections are possible in individual models
(ism/isx files) but also for types defined in Modelica libraries.
Typical use cases for the type correction are the conversion of models to a new
version of a library or the adjustment to changes during the library development.
8-8 SimulationX 3
Administration of user-defined Types in SimulationX
The text fields Environment and Modelica Code give information about the
position in the opened type, where the reference cannot be resolved. Reference
shows the identifier of the type which could not be found.
After a type has been selected in the combo box New Element Type as a
replacement for the type which was not found, the reference can be corrected by
clicking the Replace button.
References with the same name and environment are automatically handled in the
same way as the first occurrence of the unresolved reference was treated.
If the reference shall not be corrected, there are three additional possibilities:
Ignore the behavior for the reference is identical to SimulationX 3.5, i.e.
components with an unknown type are removed and the instantiation is
interrupted with an error in case a base class cannot be found.
Ignore All like Ignore, but additionally all the remaining unresolved
references are ignored.
Cancel the instantiation is cancelled and the type is not loaded; the type is
not modified.
SimulationX 3 8-9
User Manual 8. Customizing and Extension
After the interactive type correction was finished i.e. either after the corrected
type has been instantiated successfully or after the type correction was interrupted
the Dialog for Changes in the Library Tree (Figure 8.5) is opened. It contains
a list of types outside the current type, which were modified during the type
correction. The files, in which these types are implemented, are shown at the same
place. By clicking the Save-button, the modifications are stored permanently in the
file system. Discard can be used to reverse these modifications.
8-10 SimulationX 3
TypeDesigner
model MissingBaseClass
extends UnknownBaseClass;
end MissingBaseClass;
model Test
MissingBaseClass m;
end Test;
8.2 TypeDesigner
The TypeDesigner is the in SimulationX integrated editor for the definition of user
defined library elements. The TypeDesigner offers access to the complete range of
possibilities for modeling and programming in SimulationX and the object-
orientated modeling language Modelica.
The TypeDesigner assists the user during the creation and the development for all
kinds of standardized Modelica classes:
Model (type)
Connector
Record
SimulationX 3 8-11
User Manual 8. Customizing and Extension
Block
Function
Package
The following steps explain how to start the TypeDesigner. After that an example
describes the definition of a type.
New types can be created in different ways:
1. Creation of new types (see section 8.2.1)
2. Extension of existing types (see section 8.2.3)
3. Creation of composed types (see section 8.2.4)
The assignment of the new type (global or local) can be changed at any time.
The TypeDesigner is intended to edit the content of the type. To change the
structure it is necessary to open the type via Open in the context menu.
8-12 SimulationX 3
TypeDesigner
8.2.2.1 General
Type Definition
If the TypeDesigner has been started in the library bar or in the Model Explorer via
the context menu New/Model the storage position is fixed at that point.
The kind of storage (within environment / as file) depends on the environment of
the new type. A type could be saved as file only within an already existing
directory (package).
If the TypeDesigner has been started via the SimulationX menu (Elements
Compound, or Elements Extension) or via the context menu of an internal
SimulationX library type (Extension), the storage position has to be defined by the
user themselves too:
local (within the model) or global (within the library bar) storage
the environment: package or existing type (selection via tree structure)
SimulationX libraries cannot be selected as the environment, because they are not
changeable by the user.
SimulationX 3 8-13
User Manual 8. Customizing and Extension
The type can be described with a comment. The type name will be used for file
name generation as well as for an automatic generation of component names in the
model.
Graphical Representation
The symbol defines the graphical representation of the components within the
types-/library tree and the elements of this type in the diagram view. If no symbol
is defined, then a default frame with the symbol dimensions is created.
The button creates a new symbol. The symbol can be edited directly in the right
hand side window. It is possible to generate graphical objects via the integrated
toolbar. Bitmaps can also be used in the symbol. Pixels with the color magenta
(red=255, green=0, blue=255) are interpreted as being transparent.
Hint:
When you draft the symbol take the later position of the connectors into
consideration already. Optimum results are yielded when the connectors are in the
15-pixel grid at the edges of the symbols.
8.2.2.2 Connectors
By the definition of connectors (also called "ports") you define the interface for
elements of the new type. Perform the following steps for each connector to be
created:
1. Select the desired type of connector (see Figure 8.7).
2. Insert it with the button next to it. The new connector is displayed in the
preview window.
3. Properties such as name and comment can be edited.
4. With Drag-and-Drop you can move it to the desired position in the window.
8-14 SimulationX 3
TypeDesigner
The number of connectors is only limited by the size of the frame. By enlarging the
element (width and/or height) you can extend the number of connectors. If a
bitmap already exists it is necessary to delete the bitmap before changing the
symbol dimensions.
With the buttons the order of the connectors can be changed and using
deletes a connector.
8.2.2.4 Components
Add different types of components and edit them. To this end, perform the
following steps:
1. Select the desired component type (see Figure 8.10). Table 8.1 gives an
overview to major properties of available component types.
SimulationX 3 8-15
User Manual 8. Customizing and Extension
Physical Quantity: The type attributes quantity and displayUnit can be defined to
select a default unit for components of type Real, Integer, Boolean. These
attributes define the available units and the displayed (default) unit in the property
dialog.
8-16 SimulationX 3
TypeDesigner
Further settings: Possible settings in the lower table depend on the selected
component type. A Parameter, for instance, can serve as Start Value. By choosing
the option Disabled, a component can be set to visible but not changeable. This is
helpful e.g. for fixed directories or for results delivered by other programs. Using
the Protected option, e.g. for a variable, makes the variable invisible in the
parameter dialog of the type. This can be used for hiding variables, which are used
for the calculation of intermediate results in the algorithm or equation section. If
the option Discrete is selected, then the component is only changeable within event
iterations.
Declaration equation (for Variables): Using the declaration equations is not
recommended at this point. In general the result is similar to an equation in the
equation section of the TypeDesigner on page Behavior.
If there is another equation in the equation section for this variable, then there is
one equation too much. The user will get a message about this problem in the
Output window. The analysis of the problem will be more complicated because
possible reasons are located at two different points.
Start Value (for Variables): If a variable is designed to be a state variable then the
start value, also called initial value, should be editable by the user. Therefore a
value can be entered or an existing parameter with the start value attribute can be
selected in the enumeration. To get a parameter with start value attribute the user
has to create a component of type Parameter.
After that the option Start Value in the lower table has to be activated. The symbol
of the parameter component switches from blue to red. The parameter should have
the same quantity as the variable. Within the parameter dialog in SimulationX this
parameter contains the special symbol of a pin, which allows fixing or unfixing the
entered start value.
SimulationX 3 8-17
User Manual 8. Customizing and Extension
Component Application
Parameter Input of numerical values and mathematical expressions of
the Real type, Integer type, Boolean type or String
type (see also Table 8.2). Parameters of Real type can be
used as initial values of states.
Enumeration Selection of an option from an enumeration, requires the
selection or generation of an Enumeration type (see
TypeDesigner on page Local Types/Enumeration)
Boolean Selection of an option
Variable Result variable (see Table 8.2)
Characteristic curve Input of a characteristic curve f(x)
Set of characteristic Input of a group of characteristic curves fi(x)
curves
Family of curves Input of a family of curves
2D-look-up table Input of a 2D-look-up table
3D-look-up table Input of a 3D-look-up table
Database link Linking of parameters of the type with a database
Block Use of a Block type as reusable input-/output blocks (see
Local Types/Block)
Record Set of associated data with different types - selection of a
Record type is necessary (see Local Types/Record)
Model Extension of a compound (see section 8.2.4)
Dialog group Group of components in a page of the properties dialog,
allows the arrangement of properties in groups
Dialog page User defined dialog page of components in the properties
dialog, allows the creation of user defined tabs in the
property dialogs
Table 8.1: Component types
8-18 SimulationX 3
TypeDesigner
First create the dialog page or group. At the right side you can give a name.
SimulationX 3 8-19
User Manual 8. Customizing and Extension
Move the new item up and down by using the arrow buttons. The components
below will be displayed with the corresponding indent. This shows that the
component is subordinated to page (or group). If a component should not be
subordinated, then move the component above the first page of the type. These
components are displayed on the standard pages for parameters and results.
Empty dialog pages and groups are not stored in the type and they are deleted also
if the components site is left.
Hint:
Dialog pages and groups influence only the display in the property dialog. Name
and identifier of components are not changed by the relation to a group.
The definition of local types under types is possible. A type in type construct
will be generated which was already described at the beginning of this chapter. For
a well arranged modeling such structures should be avoided and only be used in
exceptional cases. One of these cases is the usage of enumerations which are
usually bound to a certain type and must be defined within the type.
To add a new local type, select first the kind of type and add the type using the add
button . At the left side you can edit name and comment of the new type.
For editing of structured types (Function, Block, Record, Models, Connections, and
Packages) opens a special TypeDesigner via the Edit button.
Enumeration
The type of an enumeration defines a set of alternatives and a default value. When
you create a component of the enumeration type, you can define the visibility of
the alternatives and a different default value.
Function (Definition of a stateless calculation)
Functions are reusable calculation modules. The arguments (input- and output
parameter) are the interface.
8-20 SimulationX 3
TypeDesigner
8.2.2.6 Imports
Imports provide public definitions of a package to a local type and allow therefore
a shortened syntax. Furthermore the import statement defines explicit the
dependency between type and imported package.
Via the button additional import statements can be added. Then available
definitions can be chosen in a selection box.
The import of package contents is possible in three different ways. The differences
are shown in Table 8.3.
SimulationX 3 8-21
User Manual 8. Customizing and Extension
The first two possibilities allow renaming the imported definition within the
current type. Then the definition can be used with the new name within the type,
e.g. to avoid name conflicts with already existing definitions.
By activating the option Import all definitions, all package definitions will be
imported. This is indicated with the * sign at the end of the expression in the
import column (see Figure 8.12).
All names of the imported definition will be converted to shortened syntax within
the source code. After deleting an import, the complete identifier will be used
again.
8-22 SimulationX 3
TypeDesigner
Activity Groups permit to define conditions when certain parameters are visible or
invisible.
To make the Activity Groups function available, enable the checkbox Support
Activity Groups first.
With the button you create a new group which you can edit.
A list of tuples {name, condition, list of corresponding parameters} is maintained.
Each tuple is one ActivityGroup. The parameter list gives the names of the
parameters which are influenced by this Activity Group.
If a condition returns the value false, the corresponding parameters are invisible in
the properties dialog and they return the value 0. If a parameter exists in several
Activity Groups, the individual conditions are linked with OR, i.e. if a condition is
true this parameter is visible then.
To delete an Activity Group, mark it and use the button Delete .
Example:
You want to create a type which uses a cross section and a flow as selection
criterion for various approaches.
Enumeration Option
Cross section A = {a, b } Rectangle
A={ d } Circle
Flow Q = { p1 } Approach1
Q = { p21, p22 } Approach2
Q = { p31,p32,p33 } Approach3
Table 8.4: List of parameters
SimulationX 3 8-23
User Manual 8. Customizing and Extension
There are two enumerations which select the type of the respective option.
The type contains one parameter of the ActivityGroups type then and its value
consists of the following entries:
1. Create one component each for the cross section and the flow and the
corresponding parameters.
To do this, select one component of the type Enumeration and add it.
Assign the respective name then (A in the present example) and the comment
(Cross section). Add the values now (in the present case Rectangle and
Circle). Define any other parameters then.
8-24 SimulationX 3
TypeDesigner
The order of the entries corresponds to the representation in the properties dialog
of the new type and should be used for the example as shown in Figure 8.13.
2. To create an ActivityGroup
Activate the Activity Groups with the checkbox Support Activity Groups (top
left). Use the button , define the conditions for the enumerations and enter
the parameters.
Note:
Inactive parameters return 0.
Enumerations are inquired via an integer value.
Create an element of the new type in the diagram view and open the properties
dialog. Under Parameter1 you find the previously defined selection criteria and
you can test them.
SimulationX 3 8-25
User Manual 8. Customizing and Extension
A new dialog is used if there are more than 10 parameters. In the present case the
parameter p33 in the dialog Parameter2 is displayed for Approach3.
8.2.2.8 Behavior
The behavior of the Type can be described with algorithms and equations.
The left side shows the names of the available components and local function types
for information. An enumeration shows also the available alternatives. At the right
side you can edit the currently selected section.
It is possible to define more than one equation or algorithm section. During the
simulation the sections are evaluated in the order in which they appear. The order
can be changed by using the arrow buttons and by doing Drag-and-Drop of the
tabs at the bottom of the view.
Every type needs at least one equation or algorithm section. When possible you
should describe the behavior by using equations. This increases the chance of
optimization by the symbolic analysis.
Hint: Internal functions contain only one algorithm section. Adding sections is not
possible.
8-26 SimulationX 3
TypeDesigner
Enter a sequence of instructions which describes the behavior of the new type. In
addition to instructions for numeral values and arithmetic operators, the control
constructors which are common in programming languages are also available. You
have access to the connectors, parameters and result variables via their names.
Equation section:
Enter the equations which describe the new type. Any equation has a left and a
right side which are connected with a "=". The equation must be terminated with a
";". The equations are analyzed automatically prior to the simulation and the order
of processing inside the section is determined internally.
Algorithm section:
Enter a sequence of instructions which describes the behavior of the new type. In
addition to instructions for numeral values and arithmetic operators, the control
constructors which are common in programming languages are also available. You
have access to the connectors, parameters and result variables via their names. The
algorithm determines the processing order of the statements.
To ease the work with the notation of algorithms and equations are the following
buttons available:
Find Variables, Parameters, (text retrieval)
Find and Replace (text retrieval)
Check Syntax
In addition to the description of the type behavior within the simulation one can
include special sections concerning the initial value calculation. Both options of
the behaviors description, i.e. Initial Algorithm and Initial Equation, are
available. The Initial-sections will be utilized only during the calculation of the
initial values of the model. The usage of systems of equations or algorithms for the
initialization is only necessary in case the initial values cannot be calculated
explicitly. A further possibility the behavior of an element to describe is the use of
state chard diagrams (see section 8.4).
SimulationX 3 8-27
User Manual 8. Customizing and Extension
are any - are shown in the message area below the text input field and you are
asked to correct them. If the source code is correct then it is accepted and the
Modelica page changes from editing mode to view mode and all other pages in
the TypeDesigner are updated too.
Enables editing of the Modelica source code. Click to switch to editing
mode (the background color of the button changes from gray to blue).
Click again to switch back to view mode (the background color changes
from blue to gray).
Undoes the last user input (e.g. typing, copy-paste, or query-replace
operations).
Redoes undone user actions.
Starts a text search.
Starts query and replace.
Performs a Modelica syntax check on the source code.
Enlarges the font size.
Reduces the font size.
For clarity of the source code you can collapse Modelica code fragments by
clicking the framed minus signs at the left border of the text window. The
collapsed code fragments are indicated as three dots "..." (see Figure 8.17). To
expand the code fragment click on the framed plus sign.
This feature is especially useful for hiding annotations which in general do not
influence the behavior of the model but determine the graphical representation of
the type in the user interface.
8-28 SimulationX 3
TypeDesigner
8.2.2.10 Documentation
In order to simplify utilization and re-application of a new type, you should
document your work. Documentation is done in form of HTML file.
If no such file exists yet, the TypeDesigner generates a frame (see Figure 8.19)
with all essential components required to document the new type. Your task is to
complete the generated frame with any information which permits proper use.
Select font
Insert picture
Insert table
Insert Hyperlink
Insert bookmark
SimulationX 3 8-29
User Manual 8. Customizing and Extension
8.2.2.11 Security
SimulationX offers a two-level safety concept (see Figure 8.20) to protect global
types against unauthorized access or changes.
Usually global types are stored in the model language Modelica and they are
freely accessibly by any user.
By encrypted storage access to these files can be prevented. However, these
models and types can still be loaded without any restriction. To prevent this, you
can use encryption optionally with a password in addition (Password for Usage).
To use global types, which are protected in this way, in SimulationX, you must
input the correct password when you load the file. Passwords which are entered
like this are stored on your computer in a computer-specific and also encrypted file
to avoid that the password is inquired any time you start SimulationX. This file
cannot be transferred to another computer and it is created anew by SimulationX
after hardware components, like hard disk or network interface card, have been
replaced in which case the passwords must be re-entered.
Frequently, global types shall be made available to other users. In this case it can
be desirable to prevent insight into the functions and to prevent any changes to the
behavior of the type. This can be done by entering a second password (Password
for Editing), see Figure 8.21. For the execution of any actions which disclose the
behavior of the type (converting into local types) or permit changes to the type
(starting the TypeDesigner), it is obligatory to input this password. This password
is not stored.
8-30 SimulationX 3
TypeDesigner
The option for encryption and the two-level password protection can be lifted only
by fully authorized users.
Hint:
Make sure that your password is kept in a safe place. Without a valid password you
will not be able anymore to open and edit a global type which is protected in this
way.
To derive a new type within a model from an element which exists already in the
model, proceed as follows:
1. Highlight the element whose type is to be used as a pattern for the newly to be
developed type.
2. Open the TypeDesigner (Elements Extension or button on the
toolbar).
You can decide whether the derived type is created as a global type (global) or
only in this model (local). The base type is also shown.
Working with the TypeDesigner is analogous to the procedure when you create a
new type, as described under 8.2.1. The properties of the basic type (connectors,
parameters, result variables, behavior) are extended to the newly created type. You
can extend it by new connectors, parameters, result variables now and extend the
behavior by adding new algorithms or expressions.
On the page 'Base type components' some properties of inherited components can
be modified for use in the current type.
If a property of an inherited component is not modified, then the corresponding
value of the component in the base type will be used. This means that changes of
the component properties in the base type will also affect the unmodified
properties of the corresponding components in all derived types. Modified
SimulationX 3 8-31
User Manual 8. Customizing and Extension
Unmodified properties are indicated by blue text color and modified properties are
shown as black text. Modifications can be removed by deleting the text in the edit
box.
The behavior of the basic type is not displayed. During the simulation the behavior
of the basic type is always executed prior to the behavior of the derivative. This
means that you can use results of the basic type or change them.
8-32 SimulationX 3
TypeDesigner
The pages of the TypeDesigner are the same as those described in section 8.2.1 -
extended by the pages Inner Connectors and Inner Components.
Example:
Develop a model structure according to Figure 8.23. Select the elements and
compound them in a new type. You will complete the compound in the following
chapters.
SimulationX 3 8-33
User Manual 8. Customizing and Extension
The selected inner connectors will then be available under Connectors for the
compounded type (see Figure 8.25).
Hint:
You can use Drag-and-Drop for moving connectors directly from the tree view to
the preview window and for placing them at the desired position.
To delete a connector which was led out, select it with a mouse click and press
Remove .
8-34 SimulationX 3
TypeDesigner
Example:
Hint:
Use Drag-and-Drop to drag components from the tree view into the preview list.
The inner components which have been taken over are given on the dialog page
Components, where certain properties (e.g. the comment) can be changed (see
Figure 8.27).
To delete a component which was taken over, select it in the preview list and
actuate the button Remove .
When you use the compound you can use the components for parameter input (see
Figure 8.29).
Example:
Use the created compound (NewCompound1) and extend it by a mass (Mass1)
which is defined with the parameter Mass1.m = 2 kg.
SimulationX 3 8-35
User Manual 8. Customizing and Extension
Start the simulation and display the resulting way of the mass (mass1.x) in a
result window.
Any operations as described in the chapters 4 and 5 can be applied to the generated
types (i.e. moving, reflecting, and rotating...).
With the button on the toolbar the inner structure can be displayed for a
combined type in the diagram view. This view is closed with .
However, to change the type you must use the TypeDesigner!
8-36 SimulationX 3
TypeDesigner
8.2.6 Functions
8.2.6.1 Internal/External Functions
Functions are used to define reusable stateless calculation modules. The arguments
(input- and output parameter) are the interface of the function. Their order must be
considered when the function is called. The behavior of internal functions will be
described by an algorithm. The behavior of external functions is described by
functions from DLL libraries.
The SimulationX tracing can be accessed from external functions too. How the
tracing for an external function has to be implemented as described in section
12.9.6 of the Modelica Specification [5].
The basic steps for adding external functions to a type are explained in the
following. A simple example shows these steps and important details for specific
applications are described thereafter.
/*
Simple example of an external function.
SimulationX 3 8-37
User Manual 8. Customizing and Extension
*/
Step 1:
The local type Function serves as an interfaces between SimulationX and external
functions. Add a Function f(x) to the Local Types of the type where you want to
use the external function and give it an appropriate name (see also section 8.2.2.3).
In Figure 8.31, you see the function times_two_fct among the components of
the type times_two. It is the interface to the external function times_two_c.
8-38 SimulationX 3
TypeDesigner
Step 2:
Declare the external function call in the function dialog window. You can open this
window by clicking on the Edit button (on the right side in Figure 8.31).
The inputs and outputs of the function are defined on the Arguments page (see
Figure 8.32). The usage of this page corresponds to that one of the Parameter page
in section 8.2.2.3.
In the External Library field enter the name of the DLL library exporting the
external function.
The switch Calling Convention determines how the arguments of the external
function are put onto the program stack and how the stack is cleaned up after the
function call. You can choose between C/C++ and PASCAL/WIN32-API calling
SimulationX 3 8-39
User Manual 8. Customizing and Extension
At Function Call you declare the external function. Especially the name of the
external function, the order of its arguments and its return value are fixed here.
In the example the string y=times_two_c(x) corresponds to the definition of
times_two_c in the C-source code. The external function times_two_c takes
the real input x as an argument of type double and returns a value of type
double to the real output y.
Step 3:
After adding a function to the local types of a type according to steps 1 and 2 you
are ready to use the function in the behavioral description of the type.
In Figure 8.34 this is demonstrated for the function times_two_fct from the
example. The so defined type times_two is applied in the demonstration model
times_two_model.ism to multiply the input signal by two (you find this
model in the example collection of SimulationX).
8-40 SimulationX 3
TypeDesigner
Important Details:
Remarks about the Arguments page in the Function dialog:
This page is similar to the page Components in the TypeDesigner. An
important difference is that there are only input parameters and output
parameters available on this page. You can use the input parameters as
arguments and output parameters as results for the external function.
Name: As already mentioned, you can refer to the input or output, resp., by
this name in the input field Function Call. In the behavioral description of the
type this is the identifier you use to specify the arguments of the function by
name (see the explanations below).
Type: Modelica-Type of the input or output, resp. In section Functions of
the chapter 10 and in 8.2.7 is listed how the data types of the arguments and
return values of the exported C-function correspond to Modelica types.
In the running example the function times_two has an argument of type double
and a return value of type double. That corresponds to an input of type Real
and an output of type Real.
Dimension: It is possible to transfer real-valued, integer-valued, or boolean-
valued vectors or matrices as inputs or outputs to external functions. Available
settings for the dimensions are:
Scalar: inputs and the return value of the function are passed by
value. For example, a scalar of Modelica type Real is passed as
value of C-type double to the external function.
On the other hand, if an output is used in the argument list
SimulationX passes a pointer to the memory where to store the result.
E.g., for a Real output parameter in the argument list a pointer with C-
type (double*) is passed.
SimulationX 3 8-41
User Manual 8. Customizing and Extension
Those are:
the directories listed in the environment variable PATH
the directory where SimulationX resides (simx.exe)
(usually: c:\Programme\ESI Group\SimulationX 3.*)
Alternatively to direct entering the path you can click on the folder symbol and
search the directory tree of your computer for the DLL file.
DLL-libraries made from Fortran sources in general follow C/C++ calling
conventions. Note, nevertheless that scalars are normally passed by reference to
Fortran routines. Use data fields of size one in these cases. Also, note that contrary
to C/C++, Fortran stores data fields in column major mode. That means, that if you
call a Fortran function via the C-interface all data fields are transposed in the
Fortran routine.
8-42 SimulationX 3
TypeDesigner
At Function Call you give the name of the external function followed by the coma
separated argument list in parenthesis. Additionally you can use the size
operator.
size(Array, n)returns the size of the n-th dimension of Array
Please, regard also the hints in the next section.
Example: y = times_two(x)
Alternatively, you can use output variables in the argument list of the external
function. In this case SimulationX passes pointers to data fields (in C: double*
or int*) where the external function saves its results.
SimulationX 3 8-43
User Manual 8. Customizing and Extension
If the function has just a single output value, then the output variable stands at the
left side.
Example: y = f(a1,a2);
For a function with more than one output at the left hand side the outputs are listed
in a coma separated list in parenthesis.
Example: (y1,y2) = f(a1,a2);
The function name followed by a coma separated list of inputs enclosed in
parenthesis stands on the right hand side.
There are two ways to specify the function arguments: per name and per order.
Each argument by name is given as a sequence of the name of the function input,
an equality sign "=" and the value to be assigned to the input.
Example: f(a1=x1, a2=1.0)
If you write the arguments in exactly the same order as in the component table of
the function then you can leave out the input names and the equality signs. This is
meant by passing arguments by order.
Example: y = f(x1,1.0)
You can also combine arguments by order with arguments by name. In this case
you must first specify the arguments per order and then the arguments by name.
Example: y = f(x1, a2 = 1.0)
8-44 SimulationX 3
TypeDesigner
SimulationX 3 8-45
User Manual 8. Customizing and Extension
8-46 SimulationX 3
TypeDesigner
SimulationX 3 8-47
User Manual 8. Customizing and Extension
Trace Function
The trace function generates messages in the output-area for supporting the error
search.
The representation in the output-area consists of a short (always present) and a
long character string (only present if you have clicked on the '+' before the
message).
The trace function can be called with a variable number of parameters.
Function call Output (short) Output (long) Comment
trace("test") test test simple string
trace("test",t) test 0.23 additional
argument
trace("time:%1,dt: time:0.23,dt:0.01 time:0.23,dt:0.01 format
%2",t,dt) specification in
the first argument
trace("time:%1\ndt time:0.23 dt:0.01 long and short
:%2",t,dt) output different
trace("time+dt=%1" time+dt=0.24 time+dt=0.24 expression as
,t+dt) argument
The first argument is a format specification. It can contain place holder of the form
'%n', where n refers to the n-th further argument.
8-48 SimulationX 3
FluidDesigner
The separation between short and long character string takes place via first '\n' in
the format specification.
The further arguments can be arbitrary expressions, whose current value is filled
into the indicated place holder.
The return value of the function is always 1. Thus it can be called also in
parameters.
To get the output in the output area, the trace-flag (menu Simulation/Settings, page
Tracing, Modelica/trace-function) has to be turned on and the global parameter
traceOn has to yield true.
The functions 'message' and 'warning' work similarly. They also show messages
and/or warnings in the output area. However, the global settings to release the
trace-function have no influence on them.
8.3 FluidDesigner
The FluidDesigner can be used to create user-defined Fluid Types for the libraries
Hydraulics and Pneumatics.
The toolbar below the FluidDesigner is available for all pages and has following
functions:
go to the next site
go to the previous site
create the fluid and finish the FluidDesigner
cancel the work
switch on the Online-Help
In addition to the internally predefined Fluid Types in the library 'Hydraulics' you
can create your own Fluid Types. The new Fluid Types are displayed in the dialog
of the hydraulic connection and can be used for the simulation.
SimulationX 3 8-49
User Manual 8. Customizing and Extension
With selecting New Fluid (see Figure 8.36) the FluidDesigner starts.
If you wish to edit or modify a user-defined Fluid Type select this type in the menu
Options Fluids and proceed with the Edit button.
8.3.1.1 General
At this page you can define the name of the new Fluid Type, add a comment, select
a classification (see Figure 8.37) and change the security settings.
The classification provides suitable default values for the fluid properties on the
following pages. For fire-resistant fluids and environmentally-safe fluids, a
sub-classification should be selected as well.
8-50 SimulationX 3
FluidDesigner
When activating the security settings, the Fluid Type will be encrypted. That
means, for reading the fluid properties SimulationX and the FluidDesigner are
needed. With giving passwords for usage and editing, misuse of the user-defined
fluid data can be prevented. For further information please note the security
settings of the TypeDesigner in section 8.2.2.11.
The new Fluid Type will be saved by default in the directory 'My Fluids/
Hydraulics'. The user can change the directory by the menu Extras Options
in the register card Directories. All Fluid Types, which are located in this
directory, will be loaded automatically upon program start. After editing an
existing Fluid Type, a backup copy of the previous Fluid Type is stored in the
directory. The copy gets a counter behind the Filename Extension '.mo'.
On the following dialog pages, the physical properties of the fluid must be defined.
It should be noticed, that
- For defining the pressure dependency of any physical property, the absolute
pressure should be used, which is calculated in each hydraulic connection. The
variable p in the FluidDesigner does always refer to the absolute pressure (of
the hydraulic connection).
- By means of the FluidDesigner, only the physical properties of pure liquid
should be defined, i.e. without considering cavitation or any gas fraction. The
SimulationX 3 8-51
User Manual 8. Customizing and Extension
effect of cavitation and gas fraction (air release) is still considered in each
hydraulic connection, by assuming the fluid as a mixture of liquid, vapor and
gas (air). For that purpose, the user defines such properties as vapor pressure or
Bunsen coefficient in the FluidDesigner (pages Aeration and Vapor
Pressure).
- By setting the fluid properties with user-defined functions and curves, please
regard, that some properties depend on each other, that are the bulk modulus,
the compression coefficient, the density, the heat expansion and the specific
heat. Furthermore cavitation and gas fraction influence the compressibility and
every depending property. By giving imprecise functions or curves for density
and compressibility, the mass balance cannot be fulfilled.
8.3.1.2 Viscosity
By this page you specify the kinematic viscosity of the pure liquid (without
aeration and cavitation). You can select between 4 options for the definition of the
viscosity:
ISO 3448 Viscosity Class
Default setup function with coefficients
Arbitrary setup function
Viscosity-temperature/viscosity-pressure data table (Figure 8.38).
8-52 SimulationX 3
FluidDesigner
The two data tables T (T ) and p ( p ) define the viscosity-temperature behavior (at
the pressure pRef ) and the viscosity-pressure behavior (at the temperature TRef ),
respectively. From these two data tables, a 2D data array ( p, T ) is built-up
internally, by using the following formula:
1
( p, T ) = (T ) p ( p ) (8.1)
T (TRef ) T
The above formula is based on the assumption, that both data tables give the same
value for the viscosity at the reference point ( pRef , TRef ) :
8.3.1.3 Density
This page specifies the density of the pure liquid (without aeration and cavitation).
Following approaches are available:
default setup function
arbitrary setup function
density-temperature/density-pressure data table
By setting the fluid properties with user-defined functions and curves, please
regard that the compressibility and density depend on each other. By giving
imprecise functions or curves, the mass balance cannot be fulfilled.
When giving a function or curve for the compressibility, it is recommended to
define the density with the default setup function. The resulting density (which
shows then the influences of aeration and cavitation) can be compared with the
given values and eventually be adjusted.
8.3.1.4 Compressibility
This page defines the compressibility of the pure liquid (without aeration and
cavitation). You can select between the following approaches:
constant compressibility
default setup function
SimulationX 3 8-53
User Manual 8. Customizing and Extension
8.3.1.8 Aeration
By this page you can specify the aeration behavior of the pure liquid as well as the
gas properties. You can use default settings or input individual values.
8.3.1.10 Limits
By this page you can specify the maximum and minimum values for pressure and
temperature. You can select between default and arbitrary values.
8-54 SimulationX 3
FluidDesigner
8.3.2.1 General
By this page you name the created gas and add a comment (see also 8.3.1.1).
By default, the created Fluid Type will be saved in the directory 'My
Fluids/Pneumatics'.
The user can change the directory by the menu Extras Options in the register
card Directories.
8.3.2.2 Viscosity
This page specifies the dynamic viscosity of the gas. Following approaches are
available:
constant viscosity
Sutherland's Law
arbitrary setup function
viscosity-pressure/viscosity-temperature data table.
SimulationX 3 8-55
User Manual 8. Customizing and Extension
8.3.2.7 Limits
This page defines the upper and the lower bound of the pressure and the
temperature.
Operator commands are given in irregular (sporadic) intervals. The plant sends
data cyclic and/or acyclic to the control unit. In respect of information technology
the user commands can be interpreted as messages with various arguments. Plant
data are usually scalars. In the state machine introduced in this document the
information transfer will be differentiated into signal events and change events.
Time events will be used for organizing chronological sequences which are
generated by the state machine itself.
8-56 SimulationX 3
Statechart Designer
Run /
commands Stop control signals
Halt / Halt /
x < LimitLeft /
GoLeft GoRight
status x > LimitRight / sensor data
State machine
Basic components of state diagrams are states and transitions between these states.
A sequence of transitions starts at an initial state with an initial transition to the
target state. Figure 8.41 shows the basic components and their relations.
Initial State
Initial Transition
Transition
State
Transition
State
8.4.2.1 States
A state represents a situation in which an invariant condition is valid. This
invariance can be either static (e.g. waiting for an event) or dynamic (e.g.
executing an activity).
SimulationX 3 8-57
User Manual 8. Customizing and Extension
Simple states are not subdivided in terms of hierarchy, i.e. they do not contain
further states. Composite states contain one or more regions. These regions consist
of states and transitions and represent parallel control operations. Submachine
states include complete substate machines in the state machine. Submachine states
are semantically identical to composite states.
State Name
entry / Activity
exit / Activity
In case a state is active then the internal activities will be executed. Their behavior
is specified by the keywords entry and exit.
An entry activity is executed once after the state was entered and became active
respectively. The exit activity is executed when the state becomes inactive and has
been exited.
8.4.2.2 Transitions
A transition is a passage from one state to another which is associated with these
conditions:
the transitions source state is active
a trigger initiates the state change
a logical condition called guard is true.
8-58 SimulationX 3
Statechart Designer
An optional activity can be associated with the transition. This activity is without
duration and not interruptible and will be executed when the transition is taken.
Passing a transition does not consume time, i.e. is transient and without duration.
An implicit completion-trigger will be associated with the transition as long as
there is no explicit trigger associated with it.
Figure 8.43: Different kinds of transitions
Completion-triggers are implicit triggers. They are activated when states have
completed their activities.
8.4.2.3 Pseudostates
Pseudostates are transient states with no duration. They are used to define an initial
state as well as more complex transitions. Figure 8.44 shows pseudostates used in
respect of industrial controls.
Junction pseudostates are junctures splitting one incoming transition into multiple
outgoing transitions (split)
or merging multiple incoming transitions into one outgoing transition (merge).
SimulationX 3 8-59
User Manual 8. Customizing and Extension
Initial State
/ Activity
Junction
Split
Trigger
[ Guard ] / Activity
[ else ] / Activity
Merge
[ Guard ] / Activity
[ Guard ] / Activity
Trigger
8.4.2.4 Trigger
Signal-Trigger
Signal-triggers are noted with the name of the causing event and an enumeration of
arguments:
8-60 SimulationX 3
Statechart Designer
Change-Trigger
Notation:
Time-Trigger
Notation:
The time expression is a period of time which starts when the transitions source
state has been entered. After this period has elapsed a time event will be generated
as long as the source state is still active.
SimulationX 3 8-61
User Manual 8. Customizing and Extension
A transition with the change-trigger fires if and only if the predecessor state is
active, the successor state is inactive, the guard condition is fulfilled and the
Boolean condition of the change-trigger evaluates to true. In opposite to the
signal-trigger no positive edge is necessary.
Completion-Trigger
8.4.2.5 Guards
A guard is an additional Boolean condition for firing a transition and will be
evaluated when the transitions trigger event is generated. As long as the guard is
evaluated to FALSE the transition will not fire and the trigger event will be
deleted. Special to change-triggers
is that their trigger events exist as long as the corresponding Boolean expressions
are TRUE.
Notation:
8.4.2.6 Priorities
As soon as multiple outgoing transitions of a state may fire simultaneously a
decision must be made which of these transitions is allowed to fire. Therefore, each
transition will be given a number (1, 2, 3, etc.) according to its priority. If there are
some identical priority numbers, a decision is made at random for these transitions.
8-62 SimulationX 3
Statechart Designer
1 1
2
The priority number is written at the transition close to the source state.
State Name
entry / Activity
A time-trigger belonging to the states outgoing transition will restart its internal
clock every time the self-transition is firing and hence the state is exited and re-
entered.
Internal transitions are listed within a state with trigger, guard, and activity.
Guards are optional. Internal transitions are executed as long as the state is active
and all conditions are complied. Contrary to self-transitions the firing of internal
transitions does not execute entry and exit activities of the state. The transitions
SimulationX 3 8-63
User Manual 8. Customizing and Extension
may use an identical trigger event while a guard specifies which transition will
fire. Parameters contained in the trigger event can be evaluated in the transition
activity.
State Name
entry / Activity
exit / Activity
The composite state may contain the following compartments (cf. Figure 8.48):
name compartment with the states name
internal activities compartment with internal activities
internal transitions compartment with internal transitions
decomposition compartment with substates.
Internal transitions of the composite state are also valid for all substates. When
such a transition is triggered it will be executed within the active substate without
leaving the substate. Transitions of a hierarchically lower substate are of higher
priority than the transitions of the superstate (lower-first priority).
8-64 SimulationX 3
Statechart Designer
State Name
entry / Activity
exit / Activity
SimulationX 3 8-65
User Manual 8. Customizing and Extension
In case a transition tj (t1, t4) and transition t0 could fire by signal-triggers T0,
T1, T4 at the same point then tj will fire. Trigger T0 will have no effect.
1 T0 /
T1 / 1 t4
t0
T4 /
t1
2
1 T2 /
T5 / 1
t2
1
t3 T3 /
8-66 SimulationX 3
Statechart Designer
Highest Priority
0 T0 /
T1 / 1 t4
t0
T4 /
t1
2
1 T2 /
T5 / 1
t2
1
t3 T3 /
SimulationX 3 8-67
User Manual 8. Customizing and Extension
Modeling
View
Properties
Manager
Model Explorer
and/or Signal
Event Definition
To facilitate the modeling process the interface is divided in 3 parts. The modeling
view is the central part in which the statecharts are created. Beside this the
properties manager displays the corresponding properties of the selected element.
8.4.3.2 Modeling
The selection of the notation element is done via the symbol panel. Once selected,
the element (e.g. state) can be drawn on the modeling view using the mouse.
8-68 SimulationX 3
Statechart Designer
Statechart scaling
Self-Transition inserting
Transition inserting
ShallowHistory inserting
Junction inserting
State inserting
Chart Export/Import
SimulationX 3 8-69
User Manual 8. Customizing and Extension
Insert a State
By clicking into the diagram view of the statechart-designer a state with a given
standard size can be created. A state can also be created by drawing a rectangle
with the pressed left mouse button.
Insert a Transition
Beginning in the start state a transition can be pulled towards the target state using
the pushed left mouse button.
All described items of a transition can be specified in the Property Manager. The
label can be moved and resized at will by the simple use of the mouse. Accessorily
the anchoring of the label on the transition may be defined via Label Anchor in the
Property Manager.
8-70 SimulationX 3
Statechart Designer
By clicking on any part of the transition a new marker point is created, which can
be used to change the course of the transition. To remove a marker point, use the
context menu that opens by a right-click on it.
Creation of Self-Transitions
A self-transition is automatically created when pulling the left-pressed mouse out
of the state.
SimulationX 3 8-71
User Manual 8. Customizing and Extension
Trigger
The following triggers are explicitly supported in the Statechart Designer:
SignalTrigger:
ChangeTrigger:
TimeTrigger:
The trigger of a selected transition can be specified via the Property Manager. The
trigger type is defined in the selection box Type. The sense of the code in the
Expression-box depends on the trigger type. When a SignalTrigger is selected
automatically a default-SignalEvent is created, if not already present. (see section
Definition of Signal Events).
Creation of Pseudostates
Pseudo-states that cant be resized are created by a click on the Modeling View. In
the following some indications concerning the Pseudo-states:
The transition beginning in the InitialState has neither trigger nor condition.
Each InitialState mustnt have more than one outgoing transition.
There is only one trigger per Compound Transition.
Using History-States allows in a composite-state to determine dynamically
which state becomes active first at the activation of the composite-state.
All states are admitted as sub-states of a composite-state.
8-72 SimulationX 3
Statechart Designer
Event name: Name of the event displayed in the label of the transition (runE).
Event: Boolean expression (e.g. run > 0)
Model Explorer
The Model Explorer displays all used transitions and states of the model (including
pseudo-states), as well as their hierarchic structure and facilitates thus the
navigation in complex models. As a state is selected in the Model Explorer the
model is moved, where required, to display the corresponding state in the
Modeling View. Vice-versa a state is automatically highlighted in the Model
Explorer when selected in the Modeling View.
Zoom
To improve clearness of complex models the Zoom function allows
to increase or to decrease the displayed part of the model in the Modeling View.
SimulationX 3 8-73
User Manual 8. Customizing and Extension
Printing of Models
Models designed with the Statechart Designer can be printed or simply previewed
using the print-button ( ) on the toolbar. Thereby the model-scaling, defined in
the options, is used for printing.
8-74 SimulationX 3
Statechart Designer
SimulationX 3 8-75
User Manual 8. Customizing and Extension
Further it is possible to record the animation using the integrated recording tool of
SimulationX. Afterwards the recording can comfortably be replayed.
Operator commands Run and Halt as well as the position x of the mass are
controller inputs. An output is the voltage to the DC-motor.
8.4.4.1 States
The controllers state machine includes a transient initial state and several states
which require periods of time (cf. Figure 8.56).
The names of the states are corresponding to the activities of the drive: Stop,
GoLeft, GoRight, and Pause. The value assignments to the control signals take
place in the entry activities after entering the states. In general these activities are
basic Modelica algorithms.
The Modelica code encapsulates the entry activities into when-clauses which detect
an entry into the corresponding state. After entering the Stop state the drives
voltage U and the counting variable count are set to zero. In states GoLeft and
GoRight voltage U is set to a predefined value and counting variable count is
incremented. Furthermore, the enumeration variable dir is set according to the
8-76 SimulationX 3
Statechart Designer
current moving direction. These activities are executed once when the state
becomes active.
Initial State
State
Entry Activity
Exit Activity
SimulationX 3 8-77
User Manual 8. Customizing and Extension
8.4.4.2 Transitions
A trigger, guard or activity can be optionally assigned to a transition between states
(Figure 8.57). An exception is the initial transition which is not allowed to have
trigger or guard. Modelica coding combines all transitions in an if-clause that will
detect the active state and set the state variable to the subsequent state. The
determination of the subsequent state is done by evaluating each transitions
trigger and guard.
Transition
Trigger
Guard
Activity
8-78 SimulationX 3
Statechart Designer
8.4.4.3 Signal-Trigger
Signal-triggers will cause state transitions when expected messages arrive. These
messages may contain several arguments or are single commands such as Run or
Halt (Figure 8.58). The reception of a message is signaled by toggling a Boolean
variable. In case of a command the command variable and toggle variable are
identical. To recognize the reception of a message or command the Modelica
function change() is used.
Signal Trigger
SimulationX 3 8-79
User Manual 8. Customizing and Extension
8-80 SimulationX 3
Statechart Designer
8.4.4.4 Change-Trigger
Change-triggers are firing state transitions when system variables fulfill predefined
conditions. These conditions are Boolean expressions. The trigger will become
active as soon as the expression is evaluated to TRUE and will stay active as long
as the expression continues to be TRUE. Regarding the linear drive the exceeding
of the left and right threshold are implemented as change-trigger (Figure 8.60).
Change-triggers are represented in Modelica as if-clauses containing the state
charts Boolean expression.
Change Trigger
SimulationX 3 8-81
User Manual 8. Customizing and Extension
8.4.4.5 Time-Trigger
Time-triggers cause state transitions after predefined times have elapsed (Figure
8.61). The time values are associated with after-clauses. They are relative to the
points in time at which the transitions source states are entered.
Time Trigger
8-82 SimulationX 3
Statechart Designer
8.4.4.6 Guards
Guards are additional Boolean expressions used for firing transitions. They are
evaluated only when the associated triggers are triggering. Regarding the linear
drive guards are needed to differentiate the Run command (Figure 8.62).
According to the requirements of the drive the last activity is resumed after a
restart. Therefore, a variable dir is defined which is set anew when the different
motions of the drive are started. Variable dir is evaluated in the Boolean
expressions of the guards which are associated to the transitions outgoing from the
Stop state. In the Modelica coding triggers and guards are related by AND-
operators.
SimulationX 3 8-83
User Manual 8. Customizing and Extension
Guard
The condition of the transition from GoRight to Pause can be expressed as change-
trigger (Figure 8.60) or guard (Figure 8.63).
8-84 SimulationX 3
Statechart Designer
Guard
Boolean Complete;
Integer N_Max;
when( ) then
// ...
elsewhen ( state == StateT.GoRight ) then
U:= 10; count := count + 1; dir := DirT.Right;
Complete := not Complete;
end when;
In case a guard is the only condition associated with a transition then this guard
will be related with a completion trigger in Modelica coding. A when-clause
SimulationX 3 8-85
User Manual 8. Customizing and Extension
detects the entry into the source state of the transition from GoRight to Pause and
releases the completion event as last operation. This is done by toggling the
Boolean variable Complete.
The transitions if-clause contains the AND-relation of the completion-trigger
change(Complete) and the guard.
8.4.4.7 Priorities
The priority numbers noted at the transitions are determining the sequence for the
test whether transitions can fire or not. In case of the linear drive the Halt
command was given the highest priority in order to safely stop the drive in any
circumstance.
Priority Number
8-86 SimulationX 3
Statechart Designer
Transition-Activity
SimulationX 3 8-87
User Manual 8. Customizing and Extension
The hierarchical state diagram for the linear (Figure 8.66) drive uses a transition
from Stop to Go which is split by a junction and explicitly activates the substates
GoLeft or GoRight within the Go state.
In the Modelica section Transitions of Main (Figure 8.71) this transition from Stop
to Go is resolved in an if-elseif-clause with assigning the target GoLeft or GoRight
to the entry variable entryGoState. The target state on the main level is Go.
Priority number zero is assigned to the high-level transition from Go to Stop. This
transition is thereby upgraded to the highest-priority transition of the composite
state Go.
In the Modelica section Transitions of Go the signal event Halt, which is the
condition for transition from Go to Stop, is evaluated first in any substate. When
evaluation yields a positive result the target state Stop is assigned to the onto
variable ontoState and InActive is assigned to the state variable of Go.
8-88 SimulationX 3
Statechart Designer
In Entry Activities of Go (Figure 8.70) the state InActive is detected and hence, the
Boolean variable completeGo is toggled. Modelica section Transitions of Main
recognises this signal event and starts via variable ontoState the transition to the
target state.
This procedure is repeated for each level of hierarchy, i.e. for every composite
state nested within another composite state. Alternatives exist because of the
different entry options:
explicit entry (Figure 8.65)
history entry (Figure 8.72)
default entry (Figure 8.75)
SimulationX 3 8-89
User Manual 8. Customizing and Extension
model Controller
// Initialization
when initial() then
state := StateT.Stop;
ontoState := StateT.Stop;
goState := GoStateT.InActive;
entryGoState := GoStateT.InActive;
initialGoState := GoStateT.InActive;
historyGoState := GoStateT.InActive;
completeGo := false;
timeout := false;
t_pause_finished := 0;
Limit_Left := -0.4;
Limit_Right := 0.4;
t_pause := 3;
N_max := 10;
dir := DirT.Left;
end;
Figure 8.68: Modelica-coding of the drives controller: initialisation
// Event Generation
when ( time >= t_pause_finished ) then
timeout := not timeout;
end when;
8-90 SimulationX 3
Statechart Designer
// Entry Activities of Go
when ( goState == GoStateT.GoLeft ) then
U := -10;
count := count + 1;
dir := DirT.Left;
elsewhen ( goState == GoStateT.GoRight ) then
U := +10;
count := count + 1;
dir := DirT.Right;
elsewhen ( goState == GoStateT.Pause ) then
U := 0;
count := 0;
t_pause_finished := time + t_pause;
elsewhen ( goState == GoStateT.InActive ) then
completeGo := not completeGo;
end when;
// Transitions of Main
if ( pre( state ) == StateT.Stop ) then
if ( change( Run ) and ( dir == DirT.Left ) ) then
state := StateT.Go;
entryGoState := GoStateT.GoLeft;
elseif ( change( Run ) and ( dir == DirT.Right ) ) then
state := StateT.Go;
entryGoState := GoStateT.GoRight;
end if;
elseif ( pre( state ) == StateT.Go ) then
if ( change( completeGo ) ) then
state := ontoState;
end if;
end if;
// Transitions of Go
if ( pre( goState ) == GoStateT.GoLeft ) then
if ( change( Halt ) ) then
ontoState := StateT.Stop;
goState := GoStateT.InActive;
elseif ( x < LimitLeft ) then
goState := GoStateT.GoRight;
end if;
SimulationX 3 8-91
User Manual 8. Customizing and Extension
// Annotations
// ...
end Controller;
The re-entry in state Go via a history state (Figure 8.72) is done by the history
variable historyGoState which stores the identifier of the last active substate. The
assignment is carried out in the entry activities of the substates of Go (Figure
8.73).
For activation of Go in the section Transitions of Main the value of the history
variable historyGoState is assigned to the entry variable of Go (Figure 8.73).
When activating the state machine the historyGoState variable is initialised with
value GoLeft for first-time use in state Go.
8-92 SimulationX 3
Statechart Designer
// Entry Activities of Go
when ( goState == GoStateT.GoLeft ) then
U := -10;
count := count + 1;
historyGoState := GoStateT.GoLeft;
SimulationX 3 8-93
User Manual 8. Customizing and Extension
Figure 8.73: Modelica coding of the history functionality: setting the history variable
of Go
// Transitions of Main
if ( pre( state ) == StateT.Stop ) then
if ( change( Run ) ) then
state := StateT.Go;
entryGoState := historyGostate;
end if;
elseif ( pre( state ) == StateT.Go ) then
if ( change( completeGo ) ) then
state := ontoState;
end if;
end if;
...
// Transitions of Go
if ( pre( goState ) == GoStateT.GoLeft ) then
// wie in Bild 3.12-5
end if;
Figure 8.74: Modelica coding of the history functionality: setting the entry variable
of Go
8-94 SimulationX 3
Statechart Designer
SimulationX 3 8-95
User Manual 8. Customizing and Extension
model XY
Declaration
Initialization when-initial-clause
Transitions if-clauses
end XY
8-96 SimulationX 3
by
Interfaces
Data formats
9 Interfaces
9.1 Data formats
A number of formats are provided in SimulationX for the exchange of data with
other Windows applications by means of data media. A large variety of formats
can be generated and read through the availability of a wide range of options for
text and binary formats. Some elements save a data format to MS-Office
Applications (e. g. curve2D to *.xls) directly.
Please note that not every format is supported at every place in the program where
data is read and/or written.
SimulationX 3 9-1
User Manual 9. Interfaces
box in the file dialog box ( ). The Options button is then enabled. Click on this
button to open the dialog box for the text format settings (see Figure 9.1). You can
make the settings for the separators in this dialog box. Select the separator you
want using the radio buttons. What is meant by separator here is the column
separator.
The decimal separator is selected separately for the output of numbers. This
selection is independent of the current country setting of your computer.
If the check box Show dialog before saving chart is checked off, the global
settings are queried before each save, without the Options button having been
activated. If the check box is not marked, the settings for each file to be saved in
text format are valid until a new global setting is made (click on Options in the
file dialog box).
The format CSV (*.csv) is available as an additional text format. If you have
selected this format as the type of file from the combo box, no optional settings can
be made. A comma (,) is given as the column separator and a dot (.) as the decimal
separator.
Select the text file (*.txt, *.csv) as the type of file in the file dialog box. All
files of this type are shown. Select the file you want to import and click "Open".
The import wizard is then activated.
The first line of data to be imported is set in the Start import with field (thus
skipping over possible captions).
The lower area of the first page shows the data as contained in the file. Click on
one or the other option to update the display. Thus you have to know the specific
format of the data to be imported, and you can check in advance on whether or not
the format settings will supply the desired result.
9-2 SimulationX 3
Data formats
To make the selection, enter the column number in the Column field or click on the
buttons next to the input field. The selected column is highlighted in color and
the values are converted and displayed in accordance with the separator setting. In
addition, the description and unit can be selected and displayed (see Figure 9.3). If
necessary, corrections can be made on page 1.
SimulationX 3 9-3
User Manual 9. Interfaces
9-4 SimulationX 3
Data formats
activated. If the check box is not marked, the settings for each file to be saved in
binary format are valid until a new global setting is made (click on Options in
the file dialog box).
The first page (see Figure 9.5) lets you select the format for the present file. In this
connection see also the settings that were made under Save File (further above).
The lower area of the first page shows the data as it would be imported in ac-
cordance with the setting made. Click on one or the other option to update the
display. Thus you have to know the specific format of the data to be imported, and
you can check in advance on whether or not the format settings will supply the
desired result.
Import IEEE-Binary Format Page 2
On page 2 you can choose whether the arguments (x-values) for the points are to
be read in from the file.
SimulationX 3 9-5
User Manual 9. Interfaces
To make the selection, enter the column number in the Column field or click on the
buttons next to the input field. The selected column is highlighted in color and
the values are displayed in accordance with the format setting (page 1) (see Figure
9.6). If necessary, corrections can be made on page 1.
On this page (see Figure 9.7) you can select the column which contains the
y-values. To make the selection, enter the column number in the Column field or
click on the buttons next to the input field. The selected column is highlighted
in color and the values are displayed in accordance with the format setting
(page 1).
9-6 SimulationX 3
Interfaces to MS Office, Data Exchange
9.1.4 XML-Format
It is a universal data format for import and export of data to other applications,
such as Internet applications and word processing.
An import in this format is not supported.
9.1.5 DIAdem-Headerformat
This format permits a storing of result curves in the DIAdem format of the GfS
GmbH Aachen. A <name.dat> file with all process-describing parameters and a
<name.bin> file, which contains the actual function values, are developed. You
find a specification of this format in your DIAdem manual.
9.2 Interfaces to MS Office, Data Exchange
There are Add-Ins for the data exchange with MS Office . In addition to the
installation the appropriate setup files are already put down on hard disk. Over
Start->ITI Software->SimulationX 3.7->Office Add-Ins these can be
implemented then.
The examples specified in this section are written in VBScript. Figure 9.8 shows
all classes integrated in ITI SimulationX (in parentheses the types mentioned).
SimulationX 3 9-7
User Manual 9. Interfaces
Application
Documents (Document)
SimObjects (SimObject)
Parameters (Parameter)
Results (Result)
Curves (Curve)
Connections (Connection)
Parameters (Parameter)
Results (Result)
NaturalFrequencies (NaturalFrequency)
Deviations (Deviation)
EigenVectorElements (EigenVectorElement)
Energies (Energy)
InputOutputAnalysis*
Inputs (Input)*
Outputs (Output)*
ResultWindows (ResultWindow)
ResultPages (ResultPage)
ResultPanels (ResultPanel)
ResultSeries (ResultSerie)
ResultLines (ResultLine)
ResultTransformations (ResultTransformation)
9-8 SimulationX 3
COM Interface
9.3.1 Classes
9.3.1.1 Application
The class Application represents the application frame of ITI SimulationX. It
manages simulation models as documents.
You start the program by creation of an object of class Application.
The property Visible defines the visibility of ITI SimulationX. Initially the main
window is invisible. It appears executing
sim.Visible = true
With the class Document, they control the simulation calculation. Using the
following VBScript statements, you start a transient simulation and wait until the
calculation is complete. The property SolutionState informs you about the current
state of the computation.
const simStopped = 16
doc.Reset
doc.Start
While doc.SolutionState <> simStopped
Wend
MsgBox "Ready..."
SimulationX 3 9-9
User Manual 9. Interfaces
The method Start has an optional parameter SimCalculationMode that allows the
selection of the simulation method (transient or stationary). With the following
sequence of statements a steady-state simulation is started. Note the differences in
waiting for the completion of the calculation.
const simReady = 2
const SimCalculationModeSteadyState = 2
doc.Reset
doc.Start SimCalculationModeSteadyState
While doc.SolutionState <> simReady
Wend
MsgBox "Ready..."
The new property Documents.Solver gets and sets the solver method. The
following values (depending on the available license options) are supported
simSolverBDF =0
simSolverMEBDF =1
simSolverCVODE =2
simSolverFixedStep =3
doc1.SimObjects.Add "Mechanics.Translation.Mass"
Optionally, you can give as additional parameters the name of the new element and
its X and Y position (in pixels) within the diagram view.
doc1.SimObjects.Add "Mechanics.Translation.Mass", "mass1", 90,
90
With a "for each" statement you have access to all elements of a model or of
the current selection.
9-10 SimulationX 3
COM Interface
Both statements give the same result. The value of a parameter is represented by
the property value, to which numbers and functional expressions can be assigned.
doc1.Parameters("mass1.m").Value = 1.0
doc1.Parameters("source1.F").Value = "9.81*mass1.m"
The property Parameter.Start gets and sets the start attribute of parameters.
The values of a curve are accessed in SI units by default. The unit to be used can
be forced by an optional parameter.
SimulationX 3 9-11
User Manual 9. Interfaces
Set x1 = doc1.Results("connection1.x")
Set x2 = doc1.Connections("connection1").Results("x")
Both statements lead to the same result. The protocol of a result variable can be
enabled by setting the property Protocol. For interpretation of the simulation
results the class Result provides the properties MinValue, MaxValue (minimum
and maximum), MeanValue, RMSValue (root mean square value) and
LastValue. The following statements display the minimum and maximum value of
the result variable x1 in a message box:
MsgBox "Min: " & x1.MinValue & ", Max: " & x1.MaxValue
The values of result variables are provided in SI units by default. The used unit can
be forced by an optional parameter.
' in SI unit
For Each val In x1.ProtValues(TRUE)
MsgBox "Value: " & val
Next
' in current unit
For Each val In x1.ProtValues(FALSE)
MsgBox "Value: " & val
Next
9-12 SimulationX 3
COM Interface
The following code fragment copies the data of a result curve of the steady-state
simulation into the column of an Excel spreadsheet.
const simSteadyStateArgument = 0
const simSteadyStateAmplitude = 1
const simSteadyStateFluctuationCoefficient = 2
const simSteadyStateExcitation = 3
const simSteadyStatePhase = 4
const simSteadyStateRealPart = 5
const simSteadyStateImagPart = 6
const simSteadyStateSumMask = 16
const simSteadyStateMeanMask = 32
res = simSteadyStateExcitation
order = 2.0
row = 2
col = 1
For Each v In val
excel.Cells(row, col) = v
row = row + 1
Next
To access the respective sum curve and the mean curve, the result type will be
provided with the appropriate mask. The order parameter has no meaning in this
case.
om.SteadyStateProtValues(res+simSteadyStateSumMask,
om.SteadyStateProtValues(res+simSteadyStateMeanMask,
9.3.1.8 Selection
The class Selection provides access to the current selection in a simulation model.
Access to the currently selected elements and connections is possible using the
SimulationX 3 9-13
User Manual 9. Interfaces
Application
ResultWindows (ResultWindow)
ResultPages (ResultPage)
ResultPanels (ResultPanel)
ResultSeries (ResultSerie)
ResultLines (ResultLine)
ResultTransformations (ResultTransformation)
The following statements open a new window for the result variable
"Connection1.x" and set the display area for the X-and Y-axis.
The properties of all the relevant classes of SimulationX results window you can
query and set with the method GetProperty or SetProperty. The names of the
properties of each class can be found in the property bar of the result window (see
Figure 9.9).
For compatibility reasons, existing properties and methods have been retained.
9-14 SimulationX 3
COM Interface
9.3.1.10 NaturalFrequencies
The collection class NaturalFrequencies provides access to the results of the
natural frequency analysis.
Application
Appli
Documents
Appli (Document)
Appli
NaturalFrequencies (NaturalFrequency)
Deviations (Deviation)
EigenVectorElements (EigenVectorElement)
Energies (Energy)
With the following instruction sequence, you can run a natural frequency analysis:
set nf = doc.NaturalFrequencies
nf.DoCalculation vbFalse
row = 1
excel.Cells(row, 1) = "No."
SimulationX 3 9-15
User Manual 9. Interfaces
excel.Cells(row, 2) = "Re"
excel.Cells(row, 3) = "Im"
excel.Cells(row, 4) = "Abs"
excel.Cells(row, 5) = "Arg"
excel.Cells(row, 6) = "f[Hz] (damped)"
excel.Cells(row, 7) = "f[Hz] (undamped)"
excel.Cells(row, 8) = "D[-]"
excel.Cells(row, 9) = "Time Constant[s]"
ApplyFormat row, 1, 9, vbTrue, vbFalse, RGB(0, 0, 0)
for each f in nf
row = row + 1
excel.Cells(row, 1) = "f" & CStr(row-1)
excel.Cells(row, 2) = f.Re
excel.Cells(row, 3) = f.Im
excel.Cells(row, 4) = f.Abs
excel.Cells(row, 5) = f.Arg
excel.Cells(row, 6) = f.FDamped
excel.Cells(row, 7) = f.FUndamped
excel.Cells(row, 8) = f.D
excel.Cells(row, 9) = f.T
next
for each f in nf
row = 0
for each e in f.PotentialEnergies
row = row + 1
excel.Cells(row, 1) = e.Owner.GetRelIdent(doc)
excel.Cells(row, 2) = e.Value
next
for each e in f.KineticEnergies
row = row + 1
excel.Cells(row, 1) = e.Owner.GetRelIdent(doc)
excel.Cells(row, 2) = e.Value
next
for each e in f.LossEnergies
row = row + 1
excel.Cells(row, 1) = e.Owner.GetRelIdent(doc)
excel.Cells(row, 2) = e.Value
next
for each e in f.AddedEnergies
row = row + 1
excel.Cells(row, 1) = e.Owner.GetRelIdent(doc)
excel.Cells(row, 2) = e.Value
next
next
9-16 SimulationX 3
COM Interface
9.3.1.11 InputOutputAnalysys
The class InputOutputAnalysis permits automated access to transfer behavior.
This allows for easy variation calculations of a models transfer behavior. The
following steps describe how to set up script-based calculations of the transfer
behavior.
Application
Appli
Documents
Appli (Document)
Appli
InputOutputAnalysis
Inputs (Input)*
Outputs (Output)
Inputs and outputs of the transfer function are specified with the corresponding
listing classes. This requires calling the add-method for the respective listing class
with the ident of the parameters corresponding input or output.
const simIODivisionLinear = 0
const simIODivisionLogarithmic = 1
const simIOKindExcitationAmplitudeAndPhase = 0
const simIOKindExcitationRealAndImaginary = 1
const simIOKindExcitationPeriodicalTimeSignal = 2
set io = doc.InputOutputAnalysis
io.Inputs.RemoveAll
io.Outputs.RemoveAll
io.Inputs.Add("MotorTorque.in1")
io.Outputs.Add("carMotion.a")
Excitation can be specified for each input individually. For constant excitation,
absolute value and phase or real and imaginary part need to be provided.
SimulationX 3 9-17
User Manual 9. Interfaces
io.Inputs(1).SetConstantExcitation simIOKindExcitationAmplitudeA
ndPhase, 1.0, 0.0
It is also possible to use characteristic lines (absolute value and phase or real and
imaginary part over the frequency) as an array (n x 3) or a periodical time signal as
an array (n x 2) for the parameterization of the excitation.
The calculation is started with the method DoCalculation.
io.DoCalculation
All results are returned as an array (n x 2) that means as a list of pairs consisting of
a real and an imaginary part. A complete example
InputOutputAnalysisAnalysis.vbs can be found in the SimulationX sample browser.
9.3.2 Examples
The following examples demonstrate the utilization of the COM interface of
ITI SimulationX.
' Constants
simStopped = 16' Start of ITI SimulationX with a new Document
'sim.visible = true
9-18 SimulationX 3
COM Interface
// Constants
var simStopped = 16
// sim.visible
// building a simple model
doc.SimObjects.Add( "Mechanics.Translation.Mass", "mass1", 90, 90);
doc.SimObjects.Add( "Mechanics.Translation.Spring", "spring1", 180,
90);
doc.SimObjects.Add( "Mechanics.Translation.Damper", "damper1", 180,
150);
doc.Connections.Add( "mass1.ctr2", "spring1.ctr1", "connection1");
doc.Connections("connection1").AddLine( "damper1.ctr1", 145, 105);
SimulationX 3 9-19
User Manual 9. Interfaces
doc.SimObjects("mass1").Parameters("m").Value = 0.5;
doc.SimObjects("spring1").Parameters("k").Value = 1000;
doc.Connections("connection1").Parameters("x0").Value = 0.01;
doc.Connections("connection1").Results("x").Protocol = true;
doc.Connections("connection1").Results("v").Protocol = true;
' Constants
simStopped = 16
doc.SimObjects("mass1").Parameters("m").Value = 0.5
doc.SimObjects("spring1").Parameters("k").Value = 1000
doc.Connections("connection1").Parameters("x0").Value = 0.01
doc.Connections("connection1").Results("x").Protocol = True
9-20 SimulationX 3
COM Interface
SimulationX 3 9-21
User Manual 9. Interfaces
functions that are implemented in a LIB or DLL (Dynamic Link Library). The so-
specified libraries will be added when creating the executable model during the
link process.
Parameter Description
prjType This parameter specifies the Code Export project type.
The following project types are supported:
Project type Val.
simCodeExportProjectWithoutSolver 0
(C-Code without Solver)
simCodeExportProjectEmbeddedSolver 1
(Executable model)
simCodeExportProjectSFunction 2
(Matlab/Simulink S-Function)
simCodeExportProjectFMIModelExchange 3
(FMI for Model Exchange)
simCodeExportProjectFMICoSimulation 4
(FMI for Co-Simulation)
simCodeExportProjectSimpack 5
(SIMPACK)
simCodeExportProjectScaleRT 6
(SCALE-RT)
simCodeExportProjectDSpace1006 8
(dSPACE DS1006)
simCodeExportProjectNIVeriStand 9
(NI VeriStand)
simCodeExportProjectNILabVIEW 10
(NI LabVIEW CDS)
simCodeExportProjectVehicleSim 12
(CarSim, BikeSim, TruckSim component)
simCodeExportProjectEtasLabcar 13
(ETAS Labcar)
simCodeExportProjectAutomationStudio 14
(B&R Automation Studio)
simCodeExportProjectFMIModelExchange2 15
0
(FMI for Model Exchange 2.0)
simCodeExportProjectFMICoSimulation20 16
(FMI for Co-Simulation 2.0)
9-22 SimulationX 3
COM Interface
SimulationX 3 9-23
User Manual 9. Interfaces
9-24 SimulationX 3
COM Interface
version <Version>
solverType (1) fixStepSolver
cvodeSolver
SIMPACK uforce [20-40]
dSPACE additionalCFiles <file names>
DS1006
compilerOptions <Compiler
Options>
initialSimState Stop
Pause
Run
maxOverrunCount <number>
overrunType stopSim
queue
Count
simStop stop
Never
SimulationX 3 9-25
User Manual 9. Interfaces
Example (VBScript)
In the following example, a model that exists basically of two connected function
elements (function1, function2) shall be exported. The output of function1 is the
output of function2, where the output is to be controlled by a parameter function1.
Function2 computes a sinus. As output variables, the corresponding outputs of the
two function elements are chosen. Function1.x is just chosen as the input variable
in order to provoke a warning.
sim.Visible = true
sim.Interactive = true
9-26 SimulationX 3
Co-Simulation Interface
size = -1
On Error Resume Next
size = UBound(msgs)
On Error GoTo 0
ITI SimulationX can take control over the simulation process as master or can be
controlled as slave by the co-simulator.
The communication protocol between the two partners can be described as follows.
To make the communication as easy as possible the receiver should know the exact
length of each incoming package. Therefore it is useful that client and server make
a agreement at the beginning of the communication about the structure of packages
SimulationX 3 9-27
User Manual 9. Interfaces
The Package Code contains additional information about the package. In the
current prototype it contains only a sign for distinction between control and data
packages.
The standard way to communicate over sockets is to use the TCP/IP byte order for
all packages. Before sending each communication partner should convert his data
into this format by using the C-Runtime function htonl (host to network).
9-28 SimulationX 3
Co-Simulation Interface
The receiver of the package can use the C-Runtime function ntohl (network to
host) to reconvert the data to its machine dependent number format. Therefore, it
isn't necessary to have an option parameter in the coupling element's property
dialog to switch between both data representations. Anyway the coupling element
includes such an option for testing co-simulation.
Both simulators can use their own calculation step size between the
communication steps. Values between the communication points can be calculated
by linear extrapolation. Therefore, the previous value of each variable and the
corresponding calculation step size are included in the exchanged packages.
SimulationX 3 9-29
User Manual 9. Interfaces
9-30 SimulationX 3
Co-Simulation Interface
Before using the co-simulation makes sure that the following settings in
ITI SimulationX and Simulink are equal:
Simulation time
Communication step size
SimulationX 3 9-31
User Manual 9. Interfaces
9.4.3.2 Workflow
The following steps have to be carried out for doing co-simulation between
SimulationX and VehicleSim:
Prepare the VehicleSim model
Prepare the SimulationX model
9-32 SimulationX 3
Co-Simulation Interface
Figure 9.14: SimulationX model of the engine with a very simple dual mass flywheel
model
All engine parameters are kept at their default values. The changed parameters of
the other model objects are shown in the following table.
Name Value Unit
dms1.J 0.02 kgm
dms1.om 800 (fixed) rpm
dms2.J 0.02 kgm
dms2.om0 800 (fixed) Rpm
springDamper.kind Spring-Damper
springDamper.k 10000 Nm/rad
springDamper.b 10 Nms/rad
injection.F 1
SimulationX 3 9-33
User Manual 9. Interfaces
The block diagram changes as shown in Figure 9.15. In order to replace the
internal engine model the engine speed is to be computed by the SimulationX
model and to be fed to CarSim as IMP_AV_ENG. The reaction torque of the
driveline (EXP_M_EngOut) has to be fed back to the powertrain in SimulationX.
On this screen change one of the Misc. Links to I/O Channels/I/O Channels:
Import as shown below
9-34 SimulationX 3
Co-Simulation Interface
Create a new dataset as usual and add the variable IMP_AV_ENG to the list of
Active Import Variables.
Select Replace for mode as shown in the above figure. If the Mode selector is
disabled open the associated Parsfile and do the change there.
How this variable is connected to a SimulationX output and how CarSim outputs
are connected to SimulationX inputs is shown in the next section.
SimulationX 3 9-35
User Manual 9. Interfaces
The powertrain speed will be sent to CarSim and assigned to the variable
IMP_AV_ENG. Hence we add a speed sensor (Mechanics.Rotation.Sensor) to our
model.
9-36 SimulationX 3
Co-Simulation Interface
A file selection window opens when you press the button at the end of the edit box
of the parameter simfile in the property window of the VehicleSim co-simulation
block. Go to the current database folder and select the current CarSim simfile.sim.
SimulationX 3 9-37
User Manual 9. Interfaces
Step Size ts
This step size is used to communicate with CarSim and to update inputs and
outputs. The CarSim step size should have the same value. If the CarSim step size
is different, an error message is shown and the simulation run does not start.
As stated in [7] chapter "4. Extending Math Models Using Import and Export
Arrays") a one-step time delay is introduced between CarSim and SimulationX.
This may lead to numerical instabilities for closed loop models with a tight
coupling. Reduce the step size ts in such cases.
For our sample model we use a step size of 1 ms.
Number of Inputs nu, Number of Outputs ny
The block communicates via the signal input u and the signal output y with the
enclosing SimulationX model. These signal connectors can carry vectors of
variables. The dimension of these vectors is defined by nu (for input u) und ny
(for output y).
For connecting scalar signal connectors to these vector connectors, the
multiplexers and demultiplexers of the package CoSimulation.MuxDemux can be
used (see below).
In our example one signal (the powertrain speed) is sent to CarSim. Hence we set
nu = 1. The reaction torque of the CarSim model is fed back to the powertrain
model. Additionally we want to observe the speed of the car computed in CarSim.
Thus set ny = 2.
9-38 SimulationX 3
Co-Simulation Interface
At the end of the described modifications the block should have the following
properties:
As last step the co-simulation block is to be connected with the powertrain model.
We connect the input u with the output of the speed sensor (speed.om). The output
has the dimension ny=2. Hence we need a demultiplexer
(MuxDemux.Demultiplex2) to split this vector into scalars.
9.4.3.6 Co-Simulation
After the following settings on the CarSim "Self Contained Solvers" page, the
co-simulation can be started. Change now to CarSim and open the dataset we
created at the beginning by clicking on the SimulationX button on the Run
Control screen.
SimulationX 3 9-39
User Manual 9. Interfaces
Furthermore input 0.001 s as Time step. This value must be equal to the parameter
ts of the SimulationX co-simulation block.
Now the simulation run can be started by pressing the Run Math Model button
on the CarSim Run Control Screen. Make sure that SimulationX is running and the
model containing the VehicleSim co-simulation block is the active one. Instead of
the CarSim internal computation routine the "VehicleSimXStarter" application is
started. This application executes the following actions:
Connects itself to the running SimulationX instance, or opens a new
SimulationX instance.
Connects itself to the active model.
Checks whether this model contains a VehicleSim co-simulation block.
9-40 SimulationX 3
Co-Simulation Interface
The simulation run can be started as usual from SimulationX too. In this case it is
possible that the CarSim model data are not transferred to the database files which
are loaded by the CarSim API during co-simulation. Even if you save the CarSim
database the data are not written to these files. This is done by CarSim, when you
start the external wrapper program, the VehicleSimXStarter in our case. Hence it is
safer to start the co-simulation from CarSim. It is safe to start the co-simulation in
SimulationX if you already started it once by using CarSim and did not change the
CarSim model meanwhile.
SimulationX 3 9-41
User Manual 9. Interfaces
SimulationX Model
Exported C-Code
9-42 SimulationX 3
Code Export
SimulationX 3 9-43
User Manual 9. Interfaces
Depending on the intended purpose of the model code interface functions are
generated, which ensure compatibility with the target system.
All available project types are shown in the following table:
Project type Comment
C-Code (without Solver) Only the model functionality will be exported
Executable Model Model functionality and solver
For accelerated simulation runs on any
hardware platform
Model integration into other simulation or
dimensioning tools
MATLAB/ Automatic generation of s-function code for
Simulink S-Function MATLAB/Simulink
Further processing with the Simulink Coder
(former Real-Time Workshop) is possible.
Thus the following HiL platforms can be
addressed:
dSPACE
ETAS
OpalRT
NI VeriStand Real-time test and simulation software NI
VeriStand from National Instruments
NI LabView Control Design Integration of SimulationX models in NI
& Simulation LabVIEW
FMI for Model Exchange Exports the model functionality in a FMU (for
Model Exchange)
FMI for Co-Simulation Exports the model functionality in a FMU (for
Co-Simulation)
9-44 SimulationX 3
Code Export
If you would like to use the Code Export with other targets, you can choose the
project type C-Code (without solver) and can also write the corresponding
interfaces by your own. If you need further help, please contact us.
The wizard guides you through all necessary steps for the chosen project type. All
settings will be saved together with the simulation model.
SimulationX 3 9-45
User Manual 9. Interfaces
Possible other settings depend on the selected project type. These settings will be
discussed in later sections.
Set the check box Enter additional libraries when the model contains external
functions and you want to specify for which libraries code should be generated to
dynamically call functions in a DLL. For more information of this topic, see
section 9.5.2.6.
With the button you start the code generation for a project which has
already been defined. The dialog pages for inputs, outputs and parameters are
skipped in this case.
The assignment of the parameters and of the inputs and outputs is stored in the file
"Readme.txt" for documentation.
9-46 SimulationX 3
Code Export
In addition, there is the option to select all signal inputs of the model by pushing
the button or to select all topmost inputs by pushing the button .
SimulationX 3 9-47
User Manual 9. Interfaces
Furthermore, you can automatically add all Modelica connectors at model level as
inputs by clicking this button .
With you can move the signal input in the selection upwards or downwards.
The selected order will be used for instance in the project type Simulink S-
Function to create the inputs in the resulting block. To delete a selected input, use
the button .
By using this button you can open the Filter- and Sort Dialog.
This dialog offers the possibility to filter the tree view according to the specified
criteria and sort the tree elements. The sorting is case-sensitive and the individual
layers are sorted separately.
Note:
The table with the selected elements can be sorted by clicking on a column of the
table header. Thus, it is possible to find a particular item in a long list of selected
elements.
The same control functions as for the signal inputs can be applied. In addition,
there is the option to select all result variables of the model by pushing the button
or to select all topmost results by pushing the button . Furthermore, you
can automatically add all Modelica connectors at model level as outputs by
clicking this button .
9-48 SimulationX 3
Code Export
On this page parameters of the model can be made accessible from outside for the
Code Export. The appliance is the same as for signal inputs.
SimulationX 3 9-49
User Manual 9. Interfaces
Note: You can select only one parameter of a parameter set as a parameter in the
Code Export wizard, so that no assignment equations are generated in the GSA.
Furthermore, parameters that refer to other parameters are not eligible.
9-50 SimulationX 3
Code Export
With this page the generation of the code actually starts, but before a symbolic
analysis of the model take place. The aim of this analysis is the transformation into
a system of ordinary differential equations (ODE). During this process the
calculation algorithm will be optimized, too.
During the export process you can follow the progress in the code generation
window (Figure 9.35).
All files generated by the Code Export are stored in the specified project directory.
They can be used for further processing (e.g. compiling, linking) on the target
platform now.
The names of the generated files are listed in the file "generated.txt".
The file Readme.txt contains a list of the inputs, outputs, and parameters of the
model.
SimulationX 3 9-51
User Manual 9. Interfaces
When the generation of the exported code finished successfully, you will get a
message as in Figure 9.36.
9.5.2.8 Post-Processing
On this page you can compile and start the generated project. This dialog page is
available only for:
Executable Model
MATLAB/Simulink S-Function
NI VeriStand
NI LabVIEW Control Design & Simulation
FMI for Model Exchange
FMI for Co-Simulation
CarSim, BikeSim, TruckSim component
ETAS Labcar
FMI for Model Exchange 2.0
FMI for Co-Simulation 2.0
Select the development environment under which your project to be translated.
SimulationX automatically detects the following on your system installed
Microsoft C compiler:
Microsoft Visual C/C++ 6.0
Microsoft Visual C/C++ .Net
Microsoft Visual C/C++ .Net 2003
Microsoft Visual C/C++ Toolkit 7.0
Microsoft Visual C/C++ 2005 (ab Standard Edition)
Microsoft Visual C/C++ 2008 Express Edition (kostenlos)
Microsoft Visual C/C++ 2008 (ab Standard Edition)
Microsoft Visual C/C++ 2010 Express Edition (kostenlos)
Microsoft Visual C/C++ 2010 (ab Professional Edition)
Microsoft Visual Studio Express 2012 fr Windows Desktop (kostenlos)
Microsoft Visual C/C++ 2012 (ab Professional Edition)
Microsoft Visual Studio Express 2013 fr Windows Desktop (kostenlos)
Microsoft Visual C/C++ 2013 (ab Professional Edition)
Microsoft Visual Studio Express 2015 fr Windows Desktop (kostenlos)
Microsoft Visual C/C++ 2015 (ab Professional Edition)
Microsoft Visual C++ 2015 Build Tools
In section 2.1.2 you can find more information about the development
environments that are supported by SimulationX.
9-52 SimulationX 3
Code Export
SimulationX 3 9-53
User Manual 9. Interfaces
On the project page it is possible to choose a solver. The following options are
available:
Sundials CVODE (Suitable for stiff models)
ITI Fixed-Step Solvers (Solver with constant step size, suitable for stability
tests for real-time simulations)
Further yon can specify how the simulation results (outputs) are saved during the
simulation process:
Save all (Save outputs at every valid step)
Save equidistant (Save outputs equidistantly with dtProtMin)
At least after dtProtMin (previously called Save similar to SimulationX)
At least after dtProtMin and after Events
At least after dtProtMin, before and after Events
At least after dtProtMin and Event steps
Last Value
The accuracy and step size settings for the solver are saved in the source code of
the model (file <project_name>.h) as well as in the file "solversettings.txt". You
can use this file to change the settings without recompilation.
If the executable model finds this file in the start directory these settings will be
used, otherwise the settings from within the model are used.
9-54 SimulationX 3
Code Export
If you start the executable model with the command line parameter "/s <file
name>" the specified file is used.
SimulationX 3 9-55
User Manual 9. Interfaces
The default value of mode is 1. That means that the Fixed-step solver uses the
two-step method ITI Standard. This solver is used for the real-time projects
dSPACE, NI Veristand, ProSys-RT, SCALE-RT, too. CVODE uses a BDF variant
(with maximum order equal to 5) which is well suited for stiff models. Therefore
the default value of iMaxOrder is 5. If you set mode=0 keep in mind that the
maximum order of the Adams variant is 12.
9-56 SimulationX 3
Code Export
Post-processing:
Select here the development environment under which the generated project is to
be compiled. SimulationX recognizes automatically the Microsoft C compilers
installed on your system.
Advanced options:
Here you have the possibility to specify additional libraries (.lib files) and the
appropriate directories where these files are located. This is necessary if the
exported model contains external functions, which are implemented in a DLL
(Dynamic Link Library). In such a way specified libraries are then added to the
executable model during the link process. Subsequently, you can start the
execution of the model by clicking the run button.
Click this button to use a convenient dialog for specifying the
additional libraries and corresponding directories. If you manually
enter the libraries and directories please ensure to separate the
libraries and directories by a semicolon.
SimulationX 3 9-57
User Manual 9. Interfaces
Parameter table
Result lists
The text file ("parameters.txt") is created during the export. It contains the current
SimulationX parameters in the first row. For more variants you can add new rows
with the corresponding values. When executing the model the appropriate
simulation runs are accomplished and a separate result file is stored for each
variant. In order to exclude a parameter record from the variant calculations, insert
at the beginning of the corresponding row the comment characters "//".
Due to the high optimization level of the C code, the simulation speed is
considerably higher compared to the simulation time in SimulationX. This enables
even faster simulation runs, parameter studies or optimization cycles.
The file "parameters.txt" is automatically read by the executable model if it can be
found in the start directory.
If you start the executable model with the command line parameter /p <file
name> this file is used. If no parameter file can be found, the executable model
uses the values set in SimulationX.
Attention:
When using the external functions which are not thread-safe, it can lead to
unexpected results.
9-58 SimulationX 3
Code Export
SimulationX 3 9-59
User Manual 9. Interfaces
9-60 SimulationX 3
Code Export
To ensure that you can use the installed MATBAB version in the Code Export
wizard, the used versions of SimulationX and MATLAB have to be compatible.
SimulationX 3 9-61
User Manual 9. Interfaces
That means, if you use SimulationX as a 64 bit version, the installed version of
MATLAB should be a 64 bit version as well.
After every export of the model the "mex" command must be executed again to
create the S-Function code from the changed source code. The source code of the
S-Function defines a mask with the names, default values and units of the exported
SimulationX parameters. The outputs of the S-Function are labeled with the names
of the corresponding connectors in SimulationX. This avoids mistakes during
parameterization and linking of the S-Function.
The built S-Function now can be used in a Simulink model via an S-Function
block. You can either generate the block by the Code-Export wizard or add the
block manually.
Be aware that an already existing block with the same name will be replaced.
If you apply the changes for the first time, you could get an error message about
missing parameters. You can ignore this message. The field S-function
parameters will be filled automatically after the error message.
When the parameter dialog is closed, your block has the inputs and outputs and the
functionality of the exported SimulationX model. It may be connected to any
Simulink block.
9-62 SimulationX 3
Code Export
In order to use dSPACE the files can also be added to the User-Make file (section
USER_SRCS).
9.5.3.4 NI VeriStand
With the project type NI VeriStand the real-time testing and simulation software
NI VeriStand from National Instruments is directly supported. It allows the real-
time simulation of SimulationX models.
SimulationX 3 9-63
User Manual 9. Interfaces
The default value of the minimum calculation step size dtMin is not suitable for
real-time simulations. Therefore this step size needs to be adapted before the code
export process in the general simulation settings.
The minimum output step size dtProtMin is required to be an integer multiple
of the minimum calculation step size dtMin.
The minimum output step size dtProtMin has to be equal to the primary control
loop rate of NI VeriStand.
The default value of the primary control loop rate is 10000 sec which is suitable
for PC based tests. However a smaller rate may be required for tests on the real-
time hardware. The primary control loop rate (in micro seconds) can be adapted in
the NI System Explorer window when the Controller node of the system definition
file is selected.
The exported model is integrated with LabVIEW utilizing the NI External Model
Interface. This interface has the following limitations:
only one discrete sample time is supported
the sum: parameters + inputs + outputs must not exceed 25
9-64 SimulationX 3
Code Export
SimulationX 3 9-65
User Manual 9. Interfaces
9.5.3.6 FMI
The illustration in Figure 9.41 shows the schematic workflow of a FMI (for Model
Exchange) code export.
SimulationX
Model Solver
h lib
C
Steps:
C-code generation (model equations)
Compilation and binding
Generation of model description
Packaging of files
9-66 SimulationX 3
Code Export
FMI
Configuration
Option Description
SimulationX 3 9-67
User Manual 9. Interfaces
Inputs On the inputs page select the input variables. The values of
these variables are defined outside of the model.
Outputs On this page select the output variables. These variables are
designed to be used in a model connection. So output variables
might be used in the calling function as input values to other
FMUs or other submodels.
Parameters On this page select the model parameters. The values of these
variables are constant after initialization, but may be changed
before a simulation run is started. For this example model no
parameters are specified.
External This page is only available from version 2.0 of FMI for Model
Resources Exchange. This page enables you to include external files into
the FMU. For more information, see section 9.5.3.6.3.
Code Generation With this page the generation of the code actually starts, but
before a symbolic analysis of the model takes place. All files
generated by the Code Export, including the XML model
description file, are stored in the specified project directory. At
the end of this process a zip-file is created to distribute the
FMU. The extension of the zip-file is .fmu.
Click on this button to specify additional
options for Post-processing. You can find
detailed information about these options
in the section 9.5.3.2.
Compiles and creates model-DLLs based
on the FMI configuration page. The
results of this process are displayed in the
output area. Then the generated DLLs
will be integrated into the FMU.
9-68 SimulationX 3
Code Export
Tool
Model Solver
Library (DLL)
Slave
FMU
Model Solver
Code Export
h lib
C
Steps:
C-code generation (model & solver)
Compilation and Binding
Generation of model description
Packaging of files
FMI for Co-Simulation defines interface routines for the communication between a
master and the individual simulation tools (slaves) in the co-simulation
environment. The most common master algorithm stops at each communication
point tci the time integration of all slaves, collects the outputs y (tci ) ( )from
all subsystems, evaluates the subsystem inputs u (tci ) ( ), distributes these
subsystem inputs to the slaves and continues the (co-)simulation with the next
communication step tci tci +1 = tci + hc +1 = + with fixed
communication step size . In each slave, an appropriate solver is used to integrate
one of the subsystems for a given communication step 1 tci tci +1 .
SimulationX 3 9-69
User Manual 9. Interfaces
For FMI 2.0 you can select which solver is added to the
FMU either CVODE or the Fixed-step solver. The
Fixed-step solver is recommended for integration of the
FMU with real-time platforms like hardware-in-the-loop
systems. Please take care on correct specification of the
step-size parameters in that case and check whether the
model can be simulated in a stable and accurate way.
When enabling the checkbox Delete existing project files
all files listed in "generated.txt" are deleted before a new
code generation.
FMI Configuration
Option Description
Inputs On the inputs page select the input variables. The slave
receives the values of these input variables before a
subinterval is simulated.
9-70 SimulationX 3
Code Export
Outputs On this page select the output variables. After the simulation
of the subinterval, the values of these outputs are transmitted
to the master.
Parameters On this page select the model parameters. In addition to that
the step-size and tolerance settings of the integrated solver
are provided as parameters.
External This page enables you to include external files into the
Resources FMU. For more information, see section 9.5.3.6.3.
Code Generation With this page the generation of the code actually starts, but
beforehand a symbolic analysis of the model takes place. All
files generated by the Code Export, including the XML
model description file, are stored in the specified project
directory. At the end of this process a zip-file is created to
distribute the FMU. The extension of the zip-file is ".fmu".
Post-processing Click on this button to specify additional
options for Post-processing. You can
find detailed information about these
options in the section 9.5.3.2.
The page External Resources enables you to integrate such files in order to get
an executable FMU. The FMI for Model Exchange 1.0 project type does not
support the integration of external resources because version 1.0 does not define a
location of the resources folder during the runtime of a FMU.
The list at the External Resources page contains all string parameters of the
model. Activate the checkbox for all parameters referencing to a file, which has to
be integrated into the FMU.
SimulationX 3 9-71
User Manual 9. Interfaces
The Code Export copies the checked files into the resources subdirectory during
the code generation of the FMU. The values of the parameters are internally
adjusted in order to find the files automatically during the execution of the FMU.
If you selected a parameter as a FMU parameter and import the FMU in your target
tool, then you can assign an absolute path at the target computer or refer to a file in
the resource directory (e.g."fmu://resources/test.txt").
9-72 SimulationX 3
Code Export
SimulationX models that are exported to VehicleSim contain a fixed step solver.
Before carry out the code export it is useful to test in SimulationX whether the
model can be computed by a fixed solver and which step size should be used. The
step size can be changed in VehicleSim.
SimulationX 3 9-73
User Manual 9. Interfaces
Code Generation With this page the generation of the code actually starts, but
beforehand a symbolic analysis of the model takes place. All
files generated by the Code Export are stored in the
specified project directory.
Post-processing Select here the development environment under which the
generated project is to be compiled. SimulationX recognizes
automatically the Microsoft C compilers installed on your
system.
For information about development environments supported
by SimulationX, refer to section 2.1.2.
The result of the compilation is an executable program. It
contains all necessary calls to the VehicleSim API functions
to connect the inputs and outputs and to execute the
necessary computations.
Click on this button to specify additional
options for Post-processing. You can find
detailed information about these options in
section 9.5.3.2.
Select Use external wrapper program and select the executable model
generated by SimulationX as shown in Figure 9.46.
9-74 SimulationX 3
Code Export
The computation starts as usual by clicking on Run Math Model on the main page.
To change parameters enter their name followed by the new value (in SI units) to
the to the command edit field.
The solver parameters of the SimulationX model can be changed here too. The
generated executable adds parameters for the integration step size (SIMX_DT) and
the integration method (SIMX_MODE) as parameters to the VehicleSim database.
They can be changed as shown above.
SimulationX 3 9-75
User Manual 9. Interfaces
3 RKF23
4 DOPRI5
For more information see the ITI Tutorial 20 "Model Export to CarSim, BikeSim,
TruckSim"
(http://www.iti.de/fileadmin/Ressourcen/Tutorials/20_Code_Export_CarSim.pdf).
SimulationX models that are exported to ETAS LABCAR contain a fixed step
solver. Before carry out the code export it is useful to test in SimulationX whether
the model can be computed by a fixed solver and which step size should be used.
The source files generated by the code-export are copied when a configuration is
deployed on the real-time platform. There the source code is compiled.
The following settings can be specified in the Code-Export wizard:
9-76 SimulationX 3
Code Export
SimulationX models that are exported to B&R Automation Studio contain a fixed
step solver. Before the code export, it is advisable to test in SimulationX whether
the model can be computed by a fixed solver and which step size should be used.
SimulationX 3 9-77
User Manual 9. Interfaces
Post-processing This page starts the actual C-code generation once the global
symbolic analysis is complete. All files generated during the
code-export are saved in the specified project directory.
In addition to the code of the model, also the configuration
files are generated to provide a convenient way of integrating
them as program object into B&R Automation Studio.
Choose "Insert/Insert Object" and then the category "Program" with the template
"Existing Program" to import the exported model in a B&R Automation Studio
project.
On the next dialog page, select the project folder that was created for the code-
export. This folder is marked with an icon (see Figure 9.47). On the following
page, complete the import process with the "Finish" button. Once done you can use
the inputs, outputs and parameters as variables in your own code.
For more information on the topic "Program Objects", please refer to the B&R
Automation Studio help section "Programming/Programs" and take special note of
"ANSI C POUs".
9-78 SimulationX 3
Code Import
After selecting the FMU in the "Open File" dialog the dialog for importing a FMU
appears (see Figure 9.48).
Option Description
Expose Interval Variables By activation the local FMU variables will be
provided beside output variables for logging of
results. You should use these local variables in
result windows only but not inside the
SimulationX model. According to the FMI
specification this is only allowed for
FMI-outputs.
SimulationX 3 9-79
User Manual 9. Interfaces
Use Modelica Pins for Inputs The FMU inputs and outputs are not created as
and Outputs ITI connectors (signal inputs and signal outputs)
but as Modelica connectors.
Press the button Info to see general information about the FMU. The import
recognizes automatically whether it is an FMU of version 1.0 or 2.0 and adapts the
import procedure accordingly.
If you exit the dialog with OK, an element type is created, according to the
FMU and your settings. The generated block has exactly the inputs, outputs and
parameters which are defined inside the FMU. On the page "FMI Settings" of the
properties window you can change the following parameters:
9-80 SimulationX 3
Code Import
Parameter Description
FMU File The complete filename of the FMU is stored in this
parameter. Please use it only to adapt the location of the
imported FMU-file if you moved the FMU to a different
folder. Dont use this parameter to reference to another
FMU. If the referenced FMU is not identical to the
imported one an error message will be generated by the
FMU. The content of this error message is FMU specific
but it should point out that the GUID (general unique
identifier) of the referenced FMU is not equal to the
imported one.
Keep unzipped FMU Just before the simulation starts the FMU is unzipped to a
temporary folder which is deleted after the simulation
run. If you want to avoid that you need to activate that
parameter. In that case the FMU is unzipped to the folder
specified by the parameter "FMUUnzipFolder" and can
be reused in subsequent simulation runs. This saves time
especially for larger FMUs.
Folder for unzipped When "keep" is active this parameter is enabled. You can
FMU enter the folder for unzipping the FMU. Please take care
to use different folders when you use multiple FMUs
simultaneously.
Visibility of FMU This setting is transferred directly to the FMU and is used
by certain FMUs. According to the FMI specification the
parameter might be used to display a GUI which might
be included within the FMU.
Logging of FMU This setting is transferred directly to the FMU and is used
by certain FMUs. According to the FMI specification the
parameter might be used in order to switch on logging of
messages for debugging. The possibly generated
messages are displayed in the SimulationX output
window.
Is Tolerance defined? This setting is transferred directly to the FMU and is used
(not for FMUs for by certain FMUs. According to the FMI specification the
Co-Simulation parameter might be used to inform the FMU whether the
Version 1.0) applied solver is tolerance-controlled.
When the Fixed-step solver is applied, false can be used.
For the other solvers true is recommended.
SimulationX 3 9-81
User Manual 9. Interfaces
FMI Mime Type This setting is transferred directly to the FMU and is used
(only for FMUs for by certain FMUs. According to the FMI specification this
Co-Simulation parameter can be used to reference to the used simulation
Version 1.0) model for tool based co-simulations.
FMU Time Out This setting is transferred directly to the FMU and is used
(only for FMUs for by certain FMUs. According to the FMI specification this
Co-Simulation parameter can be used to specify a time out for network
Version 1.0) based co-simulations.
Strict FMI The FMI specification version 1.0 lets some room for
Compatibility Mode interpretation regarding the allowed calling sequence of
(only for FMUs for functions. FMUs generated by certain tools require a
Model Exchange more strict calling sequence than others which might
Version 1.0) reduce the performance of the simulation. The FMU
import recognizes such FMUs normally and sets this
parameter automatically. If problems occur anyway you
can try to solve it by changing this parameter.
For FMUs for Co-Simulation the additional dialog page "Master Algorithm" is
generated. Here you can enter the communication step size. SimulationX embeds
Co-Simulation FMUs as discrete subsystems. That means the data exchanges
happens at certain communication time instances only. In between inputs and
outputs are considered as being constant and an additional delay is introduced.
This might lead to stability and accuracy issues especially when you interconnect
continuous FMUs for Co-Simulation. Reduce the communication step-size in that
case. If you dont succeed you should use FMI for Model Exchange instead.
9-82 SimulationX 3
Code Import
The Simulink coder generates in both cases source code for a DLL which can be
used in SimulationX. The DLL uses the fixed step solver of Simulink which has
been selected before the creation of the DLL. The simulation calculation runs
separately in SimulationX and the generated DLL. The data transfer between the
DLL and SimulationX will be done at the sample time steps.
SimulationX 3 9-83
User Manual 9. Interfaces
The Simulink Coder generates from the Simulink model a FMU for Co-
Simulation, which can be imported by the FMU Import of SimulationX (see
section 9.6.1).
The interface of the FMU provides access to external inputs, outputs and
parameters of the Simulink model. Only scalar values of type Real, Boolean and
Integer can be transferred between SimulationX and the FMU.
Installation
The code export target has to be installed by a separate setup. The setup contains
the target template and a sample model. The setup copies the FMI Co-Simulation
Target for Simulink Coder to <MATLABROOT>\rtw\c\fmicosim. The directory
<MATLABROOT>\rtw\c\fmicosim\m must be added to the search path of
MATLAB. The C compiler of the Microsoft Visual Studio (Version 2010 or
higher) is supported as compiler.
Creation of FMU
The following options must be set for the solver in Simulink before the code
generation can start.
Key word Value
StartTime 0.0 (StopTime will be defined in SimulationX)
Type Fixed-step
Fixed-step size Needed communication step width (Auto is not allowed!)
Mode Single Tasking
9-84 SimulationX 3
Code Import
Then the template makefile has to be selected according to the used MATLAB
Release and the target platform for the FMU.
You can assume the appropriate setting from the following list:
MATLAB Release 2010 and later
o x32 Windows: fmi_malloc_vc.tmf
o x64 Windows: fmi_malloc_vcx64.tmf
Now you can start the code export and import the output file <modelname>.fmu in
SimulationX by using the FMU Import.
SimulationX 3 9-85
User Manual 9. Interfaces
Installation
The code export target SimulationX has to be installed. The installation is done by
copying the folder simx from the samples directory
<Samples>\Co-Simulation\src\matlab\RTWImport to the targets folder of
Matlab <MATLABROOT>\rtw\c. Then SimulationX is available in the target
9-86 SimulationX 3
Code Import
selection list. The C compiler of the Microsoft Visual Studio (Version 2003 or
higher) is supported as compiler.
When you have selected simx.tlc as system target file then you can build the DLL
for usage in SimulationX.
The SimulationX model uses the element type Realtime Workshop Import of the
library Signalblocks/Co-Simulation to integrate the DLL. The parameter
RTW DLL allows selecting the DLL which has been created by Simulink.
The dimension of the input- and output vector must be set according to the in- and
outputs of the Simulink model.
SimulationX 3 9-87
User Manual 9. Interfaces
It is important to make sure that the environment is set up properly to allow the
SimulationX component to interact with the SimulationX software.
Isight Vs 3.5-1 must be installed
SimulationX Vs 3.7 must be installed
SimulationX Component Vs 2.0.6 must be installed
9-88 SimulationX 3
Interfaces to other Tools
SimulationX 3 9-89
User Manual 9. Interfaces
6. You can delete one or more mappings by selecting the mapping(s) from the
mapping table and clicking the Remove button.
7. Click the OK button to save the mapping information.
9.7.4 FEM-Import
If the SimulationX FEM-Import is installed it can be directly started by the menu
Extras Tools FEM-Import. Please check the documentation in the
Mechanics Library Manual (Mechanics/Import Flexible Body) and the installed
tutorials for more information on the FEM-Import. Setup to install the FEM import
can be found on the installation DVD.
9-90 SimulationX 3
SafetyDesigner
9.8 SafetyDesigner
9.8.1 Introduction
In many industry sectors, potential risks are assessed by applying classical risk
analysis techniques, such as Failure Mode and Effects Analysis (FMEA) or Fault
Tree Analysis (FTA). The considerable effort required for this type of analysis is
justified by the nature of the hazards that may arise during operation and by the
financial stakes involved. FTA and FMEA provide valuable information about
various systems, but are primarily manual methods. As a result, it is not
uncommon for FTA and FMEA to take place only once or twice in the life cycle of
a system. In order for FTA or FMEA to be incorporated into the design process
efficiently, the SafetyDesigner in SimulationX helps overcome the problems
inherent to such manual techniques by estimating the reliability of the system
repeatedly throughout the product life cycle.
Upon instantiation, i.e. when a component is added to the system model, only a
few parameters have to be adjusted if the failure data of this instance differs from
the type in the library. The rest of the data is inherited automatically. The resulting
models, annotated with failure data, can be stored in libraries.
Since the goal is to provide all the required data for FTA and FMEA within the
framework of SimulationX, the SafetyDesigner converts the intrinsic topological
SimulationX 3 9-91
User Manual 9. Interfaces
information of the physical model to the description language for HiP-HOPS, the
tool which is used as the analysis backend for FTA and FMEA.
Comparing analysis results with the defined safety goals may require model
modifications (replacing components, structural changes). As modifications may
change the systems failure behavior, the synthesis should be performed
immediately to allow for a new analysis to incorporate any changes.
Automatically generated fault trees are less error-prone than manually generated
ones, while the process is also faster and allows for more iterations. It can thus be
used already at early stages of the development to ensure a high quality of the
results.
9.8.3.1.1 Requirements
When parts of a model are replaced, the modified model must meet particular
requirements with respect to the original model. The new model must be a
functional and physically correct model that can still be simulated. Secondly,
safety tools (synthesis and analysis) and the optimization algorithm must remain
applicable to the changed model.
Model Requirements
In order to maintain a working model after replacing any model parts, some
connection conditions must be fulfilled:
9-92 SimulationX 3
SafetyDesigner
Connections between the replacing part and the rest of the model must
remain intact including names and parameters of the connections.
Parameter and variable references from the unchanged part of the model
must be kept.
Optimization Requirements
In order to continue the optimization after the modification,
all optimization parameters and
all variables affecting the objective function
must be maintained.
For more complex changes of the model topology, the developer must take
additional measures in order to maintain the connection conditions. The
substitution of a simple pump by a redundant configuration using two pumps with
a switching device would be an example.
A template type needs to be defined for the replaceable type specifying the
minimum interface requirements that each model variant must meet. It contains
connectors and parameters that are used outside these types.
SimulationX 3 9-93
User Manual 9. Interfaces
2. Identify the interface with the rest of the system (connectors, parameters and
variables communicating with the environment).
3. Build a sub-model containing this interface.
4. Repeat steps 1 to 3 with other potential variants (components or structures).
Ensure both models have the same interface.
5. Define a template type with this interface.
6. Create a type with the replaceable type using this template type.
Any complex changes to the structure adhering to the basic functionality of the
model can be converted in this way and must be taken into account during the
development of the model.
This data is used by the optimizer to determine the minimum or maximum of the
object function for the given limit states and alternatives. The result of the
optimization is a list of trade-offs in which one implementation is selected for each
location of variation. When the designer selects one trade-off from the list, the
corresponding implementations need to be applied to the model, which requires
each list of parameters for the implementation to be set for the model. Replaceable
type parameters may be included in this list as well and allow for simple structural
changes to be handled like parameter changes.
9-94 SimulationX 3
SafetyDesigner
Input File
SimulationX
run HTML
HiP-HOPS
Each page has a headline with the name of the page and a short description of the
available settings.
The SafetyDesigner consists of the following pages which are listed on the left side
of each section:
1. General Information
2. Basic Events
3. Common Cause Failures
4. Output Deviations
SimulationX 3 9-95
User Manual 9. Interfaces
Pages
Implementations
The name for each implementation is derived from the name of the model or
instance and is unique within this model or component, but it can also be changed.
9-96 SimulationX 3
SafetyDesigner
The origin of the failure data for each component can be selected from a combo
box (Figure 9.63).
SimulationX 3 9-97
User Manual 9. Interfaces
The field Costs can be filled with an arbitrary number. This number comes without
any unit and is used to calculate the cumulative costs for the entire system and is
used during optimizations.
Risk Time is common to all implementations. This number specifies the time when
failures of this instance may occur. If this parameter is not set, the global value
defined in the options of the Fault Tree Generation Wizard applies (see section
9.8.4.3.1).
The button Reset Data to default reads the data inherited from the model and
copies it to the instance. All former changes of the data in the instance are lost. All
text entries are colored blue and changes to the model data have effect on the
instance again.
Basic events are defined and listed on the left side of the page. The two buttons
above the list are used to create new basic events or to remove existing ones. On
the right side, properties of the selected event are shown with a short description.
9-98 SimulationX 3
SafetyDesigner
The combo box for the Calculation Mode (Figure 9.65) defines how the
probability of occurrence of this event is calculated with various modes, each
having a definite set of parameters.
SimulationX 3 9-99
User Manual 9. Interfaces
9-100 SimulationX 3
SafetyDesigner
Dormant failure Failure rate This mode can be used when a component
mode with MTTR is a standby component and only activated
periodic inspection when its primary fails.
Inspection
interval
Variable Slope Calculates the three segments of the
Failure Rate Parameter 1 bathtub curve (1 decreasing, 2 constant, 3
Scale increasing failure rate) from 3 different
Parameter 1 Weibull distribution curves
End Interval 1
Scale
Parameter 2
End Interval 2
Slope
Parameter 3
Scale
Parameter 3
Table 9.3: Calculation modes for basic events
Potential common cause failures (PCCF) are placeholders for external events that
affect different components at the same time. They can be used like local basic
events for defining output deviations, but occur globally. That means that more
than one component can react to global events. The actual common cause failures
(ACCF) and the mapping of PCCF to ACCF can be defined with the Fault Tree
Generation Wizard (see section 9.8.4.3.2 and 9.8.4.3.3 resp.)
A list of currently defined PCCFs is displayed on the left side of this page. The two
buttons above the list are used to create new PCCFs or to remove existing ones.
SimulationX 3 9-101
User Manual 9. Interfaces
Output deviations are propagated over connections and become input deviations
for the next connected component. They are defined on the page Output
Deviations (Figure 9.67).
Output deviations are defined and listed on the left side of the page. The buttons
above the list are used to create output deviations, to remove existing ones or to
define failure classes.
The name of an output deviation consists of two parts separated by a dash: a failure
class name (e.g. OE) and a port name (e.g. B). The class name defines the failure
class which is propagated and the port name defines the output port.
9-102 SimulationX 3
SafetyDesigner
If an output deviation is added to the list, a new unique name is generated from the
name of the known failure classes and a name of a port that belongs to the selected
component.
Both classes are predefined and can be selected from the combo box at the top of
this page. If more classes are needed, they can be added by pressing the third above
the list of output deviations (see section 9.8.4.2.5).
SimulationX 3 9-103
User Manual 9. Interfaces
The next field is used to choose a port from a list of ports of the current model or
instance respectively. If the chosen failure class or port have different names, the
name of the output deviation is changed.
The last field on this page defines a logical expression. It combines the different
sources of events using logical operators, e.g. and, or etc. Sources for events
are:
basic events (local failure modes)
PCCFs
failure classes defined as input through a port.
They are referenced by name and are logically true if an event occurs. When the
complete logical condition is fulfilled, the event is propagated as failure class via
the associated port.
A context sensitive menu is shown with valid inputs to help the user enter
expressions (Figure 9.68). They can be selected with the cursor keys and added by
pressing Enter.
9-104 SimulationX 3
SafetyDesigner
By default, this list is stored for each user separately. By using this page, the user
can specify a file on a network share, for example, to use a common list across
different instances of SimulationX or a specific technical domain.
Such failure class files are XML files and can be opened via the corresponding
button. The list of failure classes is stored in the specified path.
Using the New and Delete buttons in the toolbar above the list of failure classes the
user can easily introduce new failure classes or remove them, when they are not
needed anymore.
When changing the name of a failure class, the dialog ensures that the user always
puts in a non-empty unique and valid identifier and reports the error otherwise.
Clicking the Close button clears the connection to the XML file and removes the
file name from the text box.
The button Export can be used to share a list of failure classes. Save as also
changes the path that SimulationX uses to store and restore a list of failure classes
while saving a list to the specified location.
With the New and Delete buttons on the toolbar above the list of failure classes, the
user can easily add new failure classes or remove them when they are no longer
SimulationX 3 9-105
User Manual 9. Interfaces
needed.
When the name of a failure class is changed, the dialog returns a notification if a
duplicate or otherwise invalid identifier has been entered.
The page works similar to the page Output Deviations (see section 9.8.4.2.4).
A list of defined propagation rules can be found on the left hand side. Their names
consist of two components: the name of a failure class (e.g. O) and the relative
identifier (e.g. KB1.ctr1) of one port of this connection.
Figure 9.71 shows the connected ports KC1.ctr1, KB.ctr1, and carrier_D1.ctr2.
They can be used as output ports or they can be referenced as inputs of failure
classes.
The Default combo box on the right is used to define the default behavior for the
selected connection. If it is not defined how a failure class is propagated over this
connection, the default behavior applies. Possible values are:
OR If a failure occurs at one port, the failure occurs also at all other
ports.
9-106 SimulationX 3
SafetyDesigner
AND If a failure occurs at n-1 ports, the failure occurs also at port n, if n
ports are connected.
OUTPUT For directed connections, e.g. signal connections, failures are
propagated from the output port to all connected input ports.
The combo box Class can be used to select a propagated failure class for output
deviations. This combo box can also be left empty. Then all failure classes are
propagated to the selected port when there is no other rule defined for this failure
class.
The combo box Port allows the user to select a port from the connected ports as
target for the propagation rule.
In the field Logical Expression the propagation rule can be defined similar to
output deviations (see section 9.8.4.2.4).
Additional keywords can be used for logical expressions: ANDPORT, ORPORT,
OUTPUTPORT and DEFAULT. They can be used for a particular port in the
same fashion as described above for the Default combo box. The keyword
DEFAULT refers to the current setting in the Default combo box.
Handling of Modelica Connections
In contrast to ITI connections which may connect more than two components at
once, an individual Modelica connect statement only connects two components. In
SimulationX 3 9-107
User Manual 9. Interfaces
For example the Modelica model shown in Figure 9.72 contains several Modelica
connect statements: one defines the relation between damper1 and mass1 and
another one the relation between spring1 and mass1. These two connect
statements define how the three components damper1, spring1 and mass1 are
linked together. A combination of basic events in damper1 and spring1 should
lead to a failure in mass1. This kind of propagation would be difficult to model if
failure propagation could only be defined for individual Modelica connect
statements, e.g. one would have to introduce additional intermediate components
which make the simulation model more complicated and are not necessary for
transient simulation.
The wizard consists of several pages which can be selected by using the
corresponding buttons at the bottom.
The second and the third page focus on common cause failures. These pages are
only shown if Potential Common Cause Failures are specified in the model.
9-108 SimulationX 3
SafetyDesigner
The combo box Analysis Type is used to select the desired mode of analysis.
Three options are available:
Qualitative Analysis
Quantitative Analysis
Reliability Optimization
For the quantitative analysis, it is possible to set the parameter Risk Time. It serves
as base unit for the probabilities within the model.
SimulationX 3 9-109
User Manual 9. Interfaces
Table 9.4 summarizes a list of tool options with their values. The settings page
shows the default values in blue.
Model settings are available within a model for fault tree analysis. They are only
valid for a particular FTA model and are stored as annotations in the Modelica
code. Global settings apply to all FTA models. The global settings are stored
under the registry key HKEY_CURRENT_USER\Software\ITI
9-110 SimulationX 3
SafetyDesigner
The following table shows which values are used for fault tree analysis, depending
how and where they are defined.
Global Settings
Model Settings value defined value undefined
default value (not global value default value
modified)
user-defined value model value model value
A user-defined value can be identical to the default value. In this case, the value is
shown in black, which denotes that the value was modified by the user. Values
shown in blue were not modified by the user or were reset to its default value.
The value for the advanced options, however, is an exception. Both values from
the model and the global settings are merged and passed on to the HiP-HOPS
executable. Caution is advised for this operation.
This page (Figure 9.75) is used to define ACCF (see section 9.8.4.2.3).
SimulationX 3 9-111
User Manual 9. Interfaces
ACCF are defined similar like Basic Events. Please refer to section 9.8.4.2.2 for
details.
In this table, multiple rows can be selected. If only one row is selected, an ACCF
can be assigned to a PCCF by using the combo box in the ACCF column.
Alternatively or if more than one row is selected an ACCF can be chosen from
the combo box beneath the table. It can be assigned to all selected PCCFs with the
Set button. The Clear button can be used to remove the ACCF setting from the
selected PCCFs.
The user has the possibility to sort the PCCFs. By clicking on the column headers,
the rows are sorted according this column alphabetically.
If holding the Shift-key during selection, more than one consecutive row can be
selected by clicking on the first and the last row.
If holding the Ctrl-key during selection, more the one row is selected or deselected,
when clicking on the row. They must not be consecutive. Using Ctrl-A all rows
can be selected at once.
9-112 SimulationX 3
SafetyDesigner
The page System Output provides a tree of checkboxes for each output deviation
in the model. At least one output deviation must be selected.
Each selected output deviation can be modified with a separate severity value. This
value is shown in the output data for the corresponding top level event.
Pressing the Finish button saves all settings of the wizard to the model. Pressing
Cancel closes the wizard without saving any changes.
SimulationX 3 9-113
User Manual 9. Interfaces
These dialogs can be opened through the context menus shown in Figure 9.79:
Furthermore, the simulation mode control toolbar for selecting the analysis mode
has been extended by the fault tree mode (cf. Figure 9.80).
9-114 SimulationX 3
SafetyDesigner
Figure 9.80: Selecting the fault tree mode from the toolbar
If this mode is selected, the behavior of both the Run button and the property
dialog button changes.
The property dialog button opens the Fault Tree Generation Wizard on the first
page.
The Run button opens the Fault Tree Generation Wizard on the analysis page. A
fault tree analysis can thus be started with the settings from the previous run by
simply clicking the analysis button.
If the fault tree mode is set, double-clicking on types and components opens the
SafetyDesigner instead of the TypeDesigner or the parameter dialog respectively.
Both can still be opened through the context menu regardless.
The fault tree analysis is subject to the license model in SimulationX. In order to
run it, a license is required which can be obtained as a hardware key or license file.
SimulationX 3 9-115
User Manual 9. Interfaces
This feature also supports printing of failure data (Figure 9.82). It can also be used
to get an overview of all failure data specified in the model.
9-116 SimulationX 3
Polygon Editor
9.8.4.6 COM-Interface
Most parts of the SafetyDesigner are also accessible for scripting using the COM
interface in SimulationX. An example script for the SafetyDesigner can be found
in the Scripting folder of the SimulationX samples directory.
9.9 Polygon Editor
The Polygon-Editor allows you to create, modify and optimize contact geometries
used in planar Polygon-Polygon contact elements. Using the 3D View the user may
modify these polygons to match the desired shape of the objects for which the
contact is modeled and for removing unnecessary points to reduce computation
time during simulation.
9.9.1 Preparation
The Polygon-Editor is opened using the menu: Extras->Tools->2D Polygon-
Editor. To start the editor you have to meet the following points:
The model has an open 3D View
A Polygon-Polygon contact element is present in the model and selected.
9.9.2 Overview
The window of the Polygon-Editor is split into three components:
3D View (1)
The 3D View covers the biggest part of the editor. It is used to visualize contents
related to the contact element as well as for interactive data modifications.
Toolbar (2)
A toolbar sits at the upper part of the window. It contains several functions and
tools to be used in/with the 3D View.
SimulationX 3 9-117
User Manual 9. Interfaces
Figure 9.84: Top-down view: Objects connected to the contact element are cut by the
contact plane to show the contact polygons at their exact position.
9.9.3 3D View
The 3D View draws contact polygons, elements and positions. The contact plane
splits the geometries into three parts: things above and below the plane as well as
things on the plane. Everything above the contact plane is removed per default to
get a better view of the two dimensional contact space and its polygons.
The camera is controlled by mouse/keyboard and/or the toolbar, just like the 3D
View in SimulationX. Polygons can be edited here.
9-118 SimulationX 3
Polygon Editor
Orientation
Select Normal to enter the normal vector of the contact plane.
Select Matrix to enter orientation matrix of the contact plane.
Position
Select Distance to origin to enter the contact plane distance w.r.t. to the
model origin.
Select Global Position 1 to use and modify the global position of the contact
elements pin point 1. This point is the contact plane reference.
Select Global Position 2: to use and modify the global position of contact
elements pin point 2. This is the only translation kind which will not change
the position of the contact plane. It is only used for placing polygon2 within
the plane.
Select Plane Point to enter an arbitrary global point which is part of the
contact plane.
Hint:
Every modification will be applied to the model immediately.
9.9.5 Toolbar
The toolbar contains different tools and functionalities to be used with the 3D
View. It is split into the following sections:
Visualization:
Provides different visualization modes for the displayed elements:
everything below the contact plane
everything above the contact plane
everything cut by the cutting plane
intersection plane
Edit
deactivates interactive polygon editing
Redo/Undo changes made to the polygons
Camera Views
turns the camera 90 around one of the view axes
predefined plane views
intersection plane top-down view
SimulationX 3 9-119
User Manual 9. Interfaces
Camera tools
free rotation
rotation around views X axis
rotation around views Y axis
rotation around views Z axis
Anti-Aliasing
toggles anti-aliasing
Figure 9.85: Menu to select the desired polygon from all extracted polygons
Selection
Select a polygon point by clicking on it. A selected point is highlighted with a
yellow circle. You may select more than one point by pressing SHIFT while
clicking more points, or by using the rubber band selection mechanism keeping the
left mouse button pressed.
To select neighbor point(s) of the already selected one(s) use the cursor keys.
Pressing SHIFT will add the left/right neighbors just as if they were clicked.
9-120 SimulationX 3
Database Link
Edit
To remove selected points press DEL. If you click and hold a point with the left
mouse button you may move it anywhere on the contact plane. When having
multiple points selected all of them will be moved accordingly.
Figure 9.86:
Undo/Redo
To undo changes to the polygon(s) use the buttons in the toolbar, CTRL+Y and
CTRL+Z respectively.
SimulationX 3 9-121
User Manual 9. Interfaces
The database link provides the opportunity to use existing OLEDB data sources for
parameterization of ITI SimulationX models. Which data sources you can use
depends on the installed database driver (e.g. Access, Excel, SQL).
The database link can be adapted to existing data structures of an OLEDB data
source.
The tables of a database contain the data of the objects. Each column (field)
represents a parameter; the rows (records) contain the values of the parameters. An
object is identified by the values in the key columns.
The database link in SimulationX creates the assignment between the parameters in
SimulationX and the columns in the tables and transfers the data from the database
to the parameters of the simulation object. The database link supports the
following types of component:
Scalar parameters (real, integer, boolean, enumeration)
Strings
Characteristics
Curve sets and curve maps
Maps (2D/3D)
9-122 SimulationX 3
Database Link
At first you have to derive a new type from the existing type. Then you can add the
database link to the derived type using the type designer.
Example:
Click with right mouse button on the icon of the Spring-Damper-Backlash element
in the library bar and provide a derived type. The TypeDesigner opens. Now give
the derived type a name (e.g. SpringDamperDB2). Then go to the tab
Components und insert a Database Link (see Figure 9.88).
Afterwards they press the button Finish. For the further work Drag-and-Drop
the derived type into the diagram view.
The database link can be defined in the type designer (Button Binding) or
later in the properties window of the element.
After opening the properties dialog of the derived type the database control is
visible under parameters. Figure 9.89 shows the parameters, although still there is
no link to the data base.
The "Database link" control shows the information about the selected record. It is
possible to define the database link and to select data using the control.
SimulationX 3 9-123
User Manual 9. Interfaces
9-124 SimulationX 3
Database Link
should be stored in the database table. The toolbar buttons allows creating and
removing additional columns. These additional columns can be bound to
components by entering the component name. The type of unbound columns can
be changed.
In addition to the columns in the list, a key column with the Name ID will be
created. The key column allows identifying each row in the database table (see
column explanations in section 9.10.3.2).
The button Finish creates (or extends) the table in the specified database. A
record with the values of the current components will be created too.
The database link stores the assignment of components and table columns
(linkage) and selects the new record. The created linkage can be edited afterwards.
Characteristics, curve maps, curve set and maps are stored in subordinated tables.
The schema is described in section 9.10.6.
SimulationX 3 9-125
User Manual 9. Interfaces
If the UDL file name is used, then the contents of the UDL file will be used as
source for the connection string whenever the database link opens the database.
You can easily change the connection by modifying the UDL file.
9-126 SimulationX 3
Database Link
On the property page Connection information about the connection and login
can be entered. The appearance of the connection page depends on the selected
provider. The correctness of your input is tested with the button "Test
Connection".
If you do not allow to save the password, you will be asked for the password when
using the database link. You can enter additional parameters at the pages
Advanced and All depending from the selected provider.
SimulationX 3 9-127
User Manual 9. Interfaces
Example:
Open the properties of the data link and select the desired provider (for the
example see Figure 9.95). After this you set under Connection the database
"Components.mdb" and the login data (user "Admin" and blank password). Now
you can test the data link.
9-128 SimulationX 3
Database Link
After the selection of the table SimulationX automatically tries to determine the
key columns and to define as key column. If that is not possible, then you define
these attitudes over the button Properties, at least one key column and a selector
column. This is verified in the properties of the table.
Explanation of columns:
Key column: Every row in the database table is identified by the values in
the key columns of the table. The values of the key columns
will be stored in the ITI SimulationX model to find the
selected record at a later time.
SimulationX 3 9-129
User Manual 9. Interfaces
Selector column: The content of the selector column of the current record is
shown by the selector.
A table must have at least one key column and one selector column.
Example: Link the parameters k and b to the respective columns in the table.
The definition of the database link is now complete and the settings will be stored.
The following data selection defines the default record of the database link.
The database link supports also the linkage of curves and maps. In this case a
button opens the dialog for the definition of bindings. The linkage of curves and
maps is described in section 9.10.6.
It is possible to select a record either by using the arrow buttons of the selector or
via a tabular view ( ). The tabular view shows a chart with the records contained
in the table.
9-130 SimulationX 3
Database Link
The first row of the column captions contains the name of the respective parameter
and the unit of measurement of the values in the table. The second row displays the
column name in the database.
The parameters which are set from the database are highlighted in the properties
dialog of the element. The marking will be removed once the value was changed
manually.
SimulationX 3 9-131
User Manual 9. Interfaces
First select a Field (Column) which should be used in the condition. Depending
from the selected field you can select a relation. The combo box of the values
shows all occurring values of the current query. You can select one of these values,
but you can also enter a value.
Example:
k>=9000 b=20
(k>=900 AND b=20) OR (b=25)
b=25
9-132 SimulationX 3
Database Link
9.10.6.1 Curves
Curve, CurveSet and CurveFamily consists of two or more sequences (x, y[1],
y[2]).
Each sequence in a curve contains the same count of values. Thats why curves can
be stored in the following way.
The curves table contains a column containing the ID of the curve and a column
for each sequence in the curve. The element table references by the column Curve
to the curve ID.
The advantage of the type of storage is the readability in the database and changes
in the database are easy.
SimulationX 3 9-133
User Manual 9. Interfaces
Example: Derive a new type from an element Curve of the library Signal Sources.
Add by the help of the TypeDesigner a component Parameter and a component
Database-Link to this type. Finish the extension of the type.
Now open the properties dialog of the extended element. As next you have to link
the database by linking the table Elements (see section 9.10.3.1).
Select the ID as key column and as selector column in the properties dialog.
Now you can switch between the curves of the table by using the control surface.
9-134 SimulationX 3
Database Link
9.10.6.2 Maps
Maps are also built out of the following sequences:
o 2D-Map: x, y, f
o 3D-Map: x, y, z, f
The sequences in a map can contain different count of values. Therefore each
sequence will be stored separate in the sequences table and the element table
contains ID fields (SeqX,SeqY,SeqF) for each sequence of the map. A record of the
SimulationX 3 9-135
User Manual 9. Interfaces
sequence table contains the ID of the sequence the value (Val) and the position
(Line) of the value in the sequence.
The gear contains two wheels (Wheel1, Wheel2), their database links are linked to
the table Wheels. This table contains the properties of the wheels. The database
link of the gear uses the table Gears. This table defines the possible combinations
of wheels and contains the ratio of the wheel combination. The aim is the
automatic selection of the wheels depending from the selected gear.
Before the Gear can be linked to the database, the database link of both wheels
must be completely defined. This can be done by defining the database link at the
wheel type or by separate definition for each wheel element.
The parameter of the gear is linked to the corresponding column of the gears table.
9-136 SimulationX 3
Database Link
The linkage of the subordinated database links will be done by the following
dialog:
The first line of the grid column captions contains the name of the database link
and the second line contains the table used by the database link. The relations
between the tables are set by the combo box.
For each wheel will be a relation defined:
SimulationX 3 9-137
User Manual 9. Interfaces
When a gear will be selected, then automatically Wheel1.dbLink selects the record
with the ID of Gears.Wheel1 and Wheel2.dbLink selects the record with the ID of
Gears.Wheel2.
9-138 SimulationX 3
by
Modelica
General Hints
10 Modelica in SimulationX
10.1 General Hints
SimulationX is a simulation and modeling tool which uses the modeling language
Modelica for describing models. This language is continually improved and has
become a de facto standard in the world of multiphysics modeling. The language is
developed by the Modelica Association (www.modelica.org).
Since SimulationX 3.7 is supported the Modelica standard 3.2r2 for the
interpretation of model code.
When working with SimulationX it is not necessary to look into the language
standard to a great extent. Models can be created with the help of the libraries via
the graphical user interface as described in section 4.2. The storage of the models
follows the Modelica syntax, but includes a SimulationX specific basic type for
simulation data. It is also possible to create models by typing the Modelica source
code and run those within SimulationX.
Attention should be paid to the fact that libraries which are supplied with
SimulationX or additionally acquired cant be used in other simulation
environments due to the licensing mechanism. Also, the concept of SimulationX
connections is beyond the Modelica specification. Other Simulators so far do no
support this concept of connections. Please, keep this in mind should you want to
develop models for other target systems than SimulationX. The same applies for
the utilization of the respective element ports in user-defined types.
SimulationX 3 10-1
User Manual 10. Modelica in SimulationX
10-2 SimulationX 3
Modeling with the Modelica-Standard-Library
The library can be changed in SimulationX. If this should be prevented the data
have to be put to Read only in the file system. In that case the editing tools in the
TypeDesigner are invisible or deactivated.
In general the usage of the types of the Modelica Standard Library is carried out
analogically to the modeling with SimulationXs library elements. That is to say
they will be positioned by dragging with the mouse in the model.
By the context menu of a type and the function Open it can be opened in the
TypeDesigner, or in different views for a process (see also 4.2.2.1). Also note the
settings for Modelica files in section 7.6.5. Saving the changes can be made
according section 5.2.1.
However, there are some differences that shall be described in the following.
1. Not all displayed entries in the library bar (section 4.2.2) of the Modelica
Standard Library are types that are usable in a model as element (i.e. via
Drag & Drop in the diagram view placeable). The bar shows all contained
packages (packages, libraries), documentations, functions, icons, ports,
classes (types) and complete sample models. Packages will be displayed in
the library bar as blue boxes (see Figure 10.2). A small symbol having the
form of a folder or of a paper sheet on the left indicates additionally the
saving location of the package. For more information about this refer to
section 4.2.2.
2. The Modelica Standard Library does not contain any connections like
SimulationX, i.e. the graphical connection between Modelica objects are not
model objects. Consequentially they do not have names nor results or initial
values. Those are only changeable and/or readable at connected elements.
SimulationX 3 10-3
User Manual 10. Modelica in SimulationX
3. The usage of functions of the Modelica Standard Library is either carried out
by giving the complete Idents (e.g.
x=Modelica.Math.leastSquares(A,b)) or by import of packages
(see Chapter 7) and simple calls in the model ( x=leastSquares(A,b)).
The Ident is to be taken from the lower part of the library bar (Figure 10.3).
Figure 10.3: Information about the library elements in the lower window of the library
bar
10-4 SimulationX 3
Differences in SimulationX
In the following the notation and the differences (extensions and/or restrictions) are
described. The arrangement is according to the Modelica specification.
Models that use the SimulationX specific extensions are not conform to the MLS
and cannot be processed by other Modelica-supported tools if necessary.
SimulationX 3 10-5
User Manual 10. Modelica in SimulationX
while within
These keywords must not be used for names and the designators.
In SimulationX there are the following additional keywords:
When using these operators with vectors and matrices special rules apply. (e.g.
scalar product, see MLS chapter 10.6) For an element-wise linkage of multi-
dimensional values special operators can be used:
.+ Element-wise addition
.- Element-wise subtraction
.* Element-wise multiplication
./ Element-wise Division
.^ Element-wise Exponentiation
10-6 SimulationX 3
Differences in SimulationX
SimulationX 3 10-7
User Manual 10. Modelica in SimulationX
type_prefix :
[ flow ]
[ discrete | nondiscrete | parameter | constant ]
[ input | output ]
[ _iti_parameter | _iti_parameter | _iti_special ]
10-8 SimulationX 3
Differences in SimulationX
SimulationX 3 10-9
User Manual 10. Modelica in SimulationX
10-10 SimulationX 3
Differences in SimulationX
10.4.6 Equations
Equations are described in Chapter 8 of the MLS.
Syntax:
Reference = Expression ;
(OutputExpressionList) = FunctionCall;
Example:
when initial() then
reinit(state,y0);
end when;
der(state) = G/Ti * x;
y = state + G*x;
xv = vector(x);
if size(B,1)>1 then
p = B[1:n] / B[n1];
if size(A,1) >= size(B,1) then
q[1:n]=(A[1:n]-A[n1]* B[1:n]/B[n1])/B[n1];
q[n1] = A[n1]/B[n1];
else
q[1:n]=A[1:n]/B[n1];
end if;
der(z[:,1])= - p[1] * z[:,n] + q[1] * xv;
for k in 2:n loop
der(z[:,k])=z[:,k-1]-p[k]*z[:,n]+q[k]*xv;
end for;
yv = z[:,n] + q[n1] *xv;
else
yv = A[1]/B[1] * xv;
end if;
SimulationX 3 10-11
User Manual 10. Modelica in SimulationX
Examples:
for i in 1:10 loop ... end for
// i gets the values 1,2,3,...,10
The for statement declares a local variable only visible inside the loop body. It can
shadow external variables with the same name.
In for statements within equation sections the ranges must be constant.
is equivalent tou
10-12 SimulationX 3
Differences in SimulationX
x[i+j]=i+j;
end for;
end for;
Loops which have a constant range are expanded by the symbolic analysis if
required.
10.4.6.2 If Statement
Syntax:
if Expression then
{ Equation ; }
elseif Expression then
{ Equation ; }
else
{ Equation ; }
end if;
The when statement consists of a when section which can be followed by several
elsewhen sections.
SimulationX 3 10-13
User Manual 10. Modelica in SimulationX
The expression in the when statement must be a discrete Boolean expression. It can
be a scalar or a vector. The statements inside the body of the when-statement are
only executed when the expression becomes true. This happens only at
discontinuities (discrete expression). During continuous integration, the body is
never executed.
if b is a scalar, then
when b then ... end when;
it is equivalent to
if edge(b) then ... end if;
if b is a vector then
when b then ... end when;
it is equivalent to
if edge(b[1]) or edge(b[2]) or ... edge(b[n]) then
... end if;
In SimulationX (even more than two) connectors from pre-defined libraries can be
connected in any quantity with (one) suitable connecting object (connection) by
means of connect equations. The direct connection of two of these connectors is
not supported.
10.4.8 Arrays
Arrays are described in Chapter 10 of the MLS.
Array is the general denotation of a value of higher dimensions. Scalars have the
dimension 0, Vectors the dimension 1, and Matrices the dimension 2.
10-14 SimulationX 3
Differences in SimulationX
The Elements of an array are the (scalar) values contained in it. Functions defined
for scalars have been extended to arrays; they are applied element-wise. They
return an array with the same dimensions.
Variables hold values. They have a name and can be referenced in expressions.
Real x[*]
The dimension of x is deduced from the context in which the x is used. It can be
also a scalar.
In algorithms the assignment operator is ":=", the character '=' cannot be used
there. Assignments are processed in the order in which they were put down.
Examples:
Y = if(t<0.2) then 0 else 1
or
when sample(start,interval)then
y:=x;
end when;
z:=sign(sin(pi*x/I));
when{change(z),initial()}then
if(x/I)<0 then
y:=I*ceil(x/I);
else
y:=I*floor(x/I);
end if;
SimulationX 3 10-15
User Manual 10. Modelica in SimulationX
end when;
10.4.9.3 If Statement
Syntax:
if Expression then
{ Algorithm ; }
elseif Expression then
{ Algorithm ; }
else
{ Algorithm ; }
end if;
The when statement consists of a when section which can be followed by several
elsewhen sections.
The expression in the when statement must be a discrete Boolean expression. It can
be a scalar or a vector. The statements inside the body of the when-statement are
only executed when the expression becomes true. This happens only at
10-16 SimulationX 3
Differences in SimulationX
if b is a scalar, then
when b then ... end when;
it is equivalent to
if edge(b) then ... end if;
if b is a n Vector then
when b then ... end when;
it is equivalent to
if edge(b[1]) or edge(b[2]) or ... edge(b[n]) then ... end if;
In addition to the for statement exists the while statement. This could be used
inside of algorithms. The expression in a while statement must be a scalar Boolean
value. The loop body is executed as long as the expression evaluates to true.
10.4.10 Functions
Functions are described in Chapter 12 of the MLS.
10.4.12 Annotations
Annotations are described in Chapter 17 of the MLS.
SimulationX 3 10-17
User Manual 10. Modelica in SimulationX
10-18 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Check.ArgumentTypeMismatch
When calling the function "%1", the type "%3" of the
argument "%2" is not compatible with the expected type "%5"
for the input parameter "%4".
The types of the arguments when calling a function do not match the types of the
function parameters. Change the function call to match the function.
Check.BusSameType
All variables, which are connected via a bus line, must
have the same value type. This applies to %1
Variables connected through a bus component (vector element) must be of the
same type. Change the variables type that does not match the transmitted signal
over the bus connection. (see 10.5.8) .
Check.ConnectorComponentsDim
The dimension of the components %1 (%2) and %3 (%4) of the
connected connectors must be equal.
If two conservative ports are connected with each other, the dimensions of the port
components must match. Change the dimension declaration of the affected
components.
Check.DerivativeReferenceSelf
The derivative annotation of function %1 refers to itself.
In the functions derivative annotation, the name of the derived function is the
function itself. Please change the name to the function of the derivative.
Check.DimAssignEach
In a modification with each, the lower %1 dimensions of the
variable must have the same dimension as the expression on
right hand side (left dimension: %2, right dimension
%3).").
For modifications with each, all components of the array declared at this point are
given the value of the modification. The dimension of the values must match the
dimension of the modified components. Please adjust the values dimension.
Check.DimMustBeKnownAtCompileTime
The dimension of %1 must be known at compile time.
All information about the variables dimension outside the function must be
available for calculations during the symbolic analysis.
SimulationX 3 10-19
User Manual 10. Modelica in SimulationX
Check.DimMustMatchBusGenVar
The dimension of variable %1 (%2) must match the dimension
of the bus generator variable %3 (%4):
All ports connected over signal connections (bus generator variables in this case)
must have the same dimension.
Check.EquationTypeMismatch
The types of the left and right expression in the equation
must be compatible. left: %1 right: %2
Types on the right side in the equation do not match the type on the left. Please
correct this.
Check.EventsDependFromNonDiscrete
An event generating expression %1 may not depend from
noEvent-conditions: %2.
An expression (comparison or function) triggering an event must not depend on a
noEvent expression since discontinuities may no longer be found properly.
Check.FixedAndStartAttrMissing
The following variable %1 have fixed=true but no start
value is defined. %2 will be used.
If there is no start attribute given, the default value (0) is used.
Check.IfThenElseAltTypes
The alternative expressions of if ... then <expr1>. else
<expr2> must have the same value type. Here: if ... then %1
else %2.
Types of alternative expression of if/then/else do not match. Please correct this.
Check.RealEquality
In a %1 relation the arguments (here %2) cannot be of Real
type.
Comparison for equality (==) or unequality (<>) with real variables are not
permitted as numeric errors may occur. Please use the operators <= or >= instead.
Check.RecordCompModification
The record %1 is modified in %2 and the component %3 is
modified in %5 (=%4).
The component modification will be ignored.
Records can be modified on several levels. Either you modify the record as a
whole or just its components. A record modification always overwrites the
modification of components, also if it is lower in the hierarchy.
10-20 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Check.SubscriptOnEmptyArray
The array "%1" is empty (%2) but there is a subscription on
it.
If an array is empty meaning that the value of at least one dimension is 0, accessing
components through subscription is not possible. This can be fixed the value is
tested with size(v,d)>0 beforehand.
Check.WhenInLoop
A when statement cannot be used in a for or while loop
statement.
Algorithms must not contain when in loops as they do not include information
about the number of passes and hence required events cannot be generated
correctly. Please use a loop within a when block instead.
IndexRecduction.NotDifferentiableEqns
The equations:
%1cannot be differentiated for symbolic index reduction.
If equations cannot be differentiated, index reduction is impossible and the model
cannot be simulated at worst. There are several ways to fix this:
Restructure the model to make index reduction redundant (e.g. integration of
elasticities in rigid connections)
Manipulate the choice of state with stateSelect to avoid derivatives of the
equation
Reduce expressions, usually in functions, to allow for differentiations again.
InitialSystem.IterationVar
There is no unique solution for the variable %1. If
applicable, add a fixed initial value, initial equation or
initial assignment.
The initial system is underdetermined (missing equations). This may cause an
undesirable initial state of the model. This can be fixed with additional fixed initial
values.
InitialSystem.MissingInitialAssignment
For the variable "%1" is no assignment in the initial
system. The startvalue "%2" is used.
The initial system is underdetermined (missing equations). This is fixed by the
analysis through assigning a start value (automatic fixation).
SimulationX 3 10-21
User Manual 10. Modelica in SimulationX
InitialSystem.MultipleAlgorithmOutputVar
The variables:
%1 are outputs of several algorithm sections. The result
system is may hard to solve.
The calculation of a variable is calculated in multiple algorithms results in an
equation, which requires the variable to receive the same value in each of the
algorithms. This however is usually not the purpose of such calculations. Merge
the algorithms in order for the variable to be calculated only in one algorithm or
introduce new variables to achieve the same condition.
InitialSystem.TooManyInitialEqns.Initial
The initial System is overdetermined. Remove some of the
following initial equations: %1
The initial system contains more equations than variables. If it is numerically
consistent, it can be simulated. If not, you need to undo the fixations of initial
values or remove initial equations.
InitialSystem.TooManyInitialEqns.Start
The system of equations for the initial value computation
is overdetermined.
Free some of the following fixations: %1
The initial system contains more equations than variables. If it is numerically
consistent, it can be simulated. If not, you need to undo the fixations of initial
values or remove initial equations.
InitialSystem.TooManyInitialEqns.StartInitial
The system of equations for the initial value computation
is overdetermined. Free some of the following fixations: %1
They are in conflict with the following initial Equations:
%2
The initial system contains more equations than variables. If it is numerically
consistent, it can be simulated. If not, you need to undo the fixations of initial
values or remove initial equations.
InitialSystem.WhenStatement
When-statements not valid in an initial section!
%1
When statements in initial equation sections are not needed. They would always
apply (when initial()) or not at all (all other conditions). Please correct this
accordingly.
10-22 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Modelica.AssignedFlowVar
The not connected flow variable %1 has an assignment. It
will be implicitly set to zero.
Flow components of unconnected Modelica connectors are always set to 0.
Remove the extra equation.
Modelica.AssignmentFromNonDiscreteToDiscrete
From the following discrete variables %1 need to be are
assigned from the following non discrete equations: %2
The discrete variables may change because of that during
the continuous calculation.
Discrete variables should always be calculated with discrete equations. This is
ensured if you place the equation in a when block.
Modelica.CondRecordComps
Conditional declarations inside of records are not
implemented. The declaration condition "%2" of component
%1 is ignored.
To avoid this warning, remove the declaration condition for the record
component.
Modelica.DiscreteRealnoWhen
The variable "%1" was declared as "discrete" but is not
assigned inside a when-statement.
The keyword discrete calls for the calculation of the variable in a when block.
If this is not desired, remove the expression.
Modelica.EachGenerated
The missing "each" for "%1" was generated.
If nonscalar parameters and attributes are modified with a scalar, this warning is
displayed and an each expression that may be required is automatically generated.
To avoid that, create a modification with the right dimension or write each
explicitly before it.
Modelica.FunctionInputAssigned
In the Function "%1" is an assignment to input "%2" in the
statement "%3".
Input variables must not be assigned in functions. Add an auxiliary variable and
use it to achieve the desired behavior.
SimulationX 3 10-23
User Manual 10. Modelica in SimulationX
Modelica.MultipleWhenAssignedVar
The variable %1 is assignend in the following when-
equations: %2
Use when .. elsewhen .. end when do ensure a defined
priority
Merge the assignments from several when statements into one.
Modelica.NonRealAlgebraicLoop
The following algebraic loop contains only non real type
variables: %1.
The algebraic loop contains discrete variables. This often causes long iteration
times or results in a cycle in the event iteration. In order to avoid this, please break
the loop by referencing an included variable v with pre(v).
Modelica.NonScalarRelationOperand
The operands of: %1
have to be scalar expressions. %2%3%4.
Rephrase the comparison in a way that only scalar quantities are compared directly
with each other.
Modelica.TypeInconsistentAssignment
The assignment: %1
is not type safe. It is an assignment from %3 to %2.
The data types in an assignment or a modification do not match. Please correct
this.
Modelica.VariabilityMismatched
The Variability "%1" of the defined Variable "%2" is lower
than the Variability "%3" of the definition expression
"%4".
The reason for that is that the following Variable(s) have
a higher variability: %5
Variables can only be modified with expressions of equal or lower variability.
Increase the variables variability (constant-> parameter-> (variable)) or use a
constant expression.
Modelica.WhenConditionDependsFromLoop
The conditions: %1
of the following when-clauses depends on the unknowns of
the same algebraic loop: %2
You may be able to cut the dependency by using "pre(...)"
around the references in the when-condition.
Please avoid the algebraic loop.
10-24 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Modelica.WhenInAlgebraicLoop
The following when-clauses are part of an algebraic loop.
They are evaluated more than once because of the solution
algorithm: %1.
Please avoid the algebraic loop.
StateSelection.AlgebraicReinit
The variable %1 is not a continuous time state, therefore
the reinit has no effect.
Please remove reinit.
StateSelection.InvalidNever
There is no assigning equation for the variable %1, which
is market with StateSelect.never.
Please remove StateSelect.never.
StateSelection.InvalidReinit
The variable %1, which is used in an "reinit" operator, was
not selected as continues time state, The "reinit" call
will not succeed!
Please remove reinit.
StateSelection.InvalidReinitNever
The variable %1 is used in an "reinit" operator but is also
market with StateSelect.never.
Please remove StateSelect.never.
StateSelection.NotSelectableCandidate
The following variables have stateSelect =
StateSelect.always:
%1 requiring them to be continuous time state variables.
However, that is at least %2 to many.
It is necessary to modify the stateSelect attributes or the
model.
Please remove StateSelect.always.
StateSelection.NotSelectableCandidateAlwaysReinit
The following variables are used in reinit or have
stateSelect = StateSelect.always:
%1 requiring them to be continuous time state variables.
However, that are at least %2 to many.
Please remove StateSelect.always and/or reinit for a variable.
SimulationX 3 10-25
User Manual 10. Modelica in SimulationX
StateSelection.NotSelectableCandidateReinit
The following variables are used in reinit:
%1 requiring them to be continuous time state variables.
However, that is at least %2 too many.
Please remove reinit for a variable.
StateSelection.NotSelectableStates
The equation:
%1 constrains the continuous time variables:
%2 requiring them to be continuous time state variables. It
is necessary to modify the stateSelect attributes or the
model.
Please remove StateSelect.always for a variable.
Value.SampleIntervalPositive
The second argument of %1 must give a positive (>0) value
(currently %2).
Make sure that the second argument of sample is >0.
This so-called event iteration now consists of two stacked iteration loops:
the outer event iteration and
the inner event iteration.
The inner event iteration is new since SimulationX 3.7. For models with algebraic
loops as functions of discrete variables, this can lead to other discrete states after
the iteration and hence to different results. Up to SimulationX 3.6, only the outer
event iterations were taken into account. Algebraic loops with discrete variables
would not be solved, but assigned only once.
10.5.3.1 Terms
Appendix C of the Modelica specifications includes the equation system to be
solved:
relation()
(, )
10-26 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
0 = (, )
known variables: x, t, p
unknown variables: dx/dt, y, m, pre(m), c
// pre(m) = value of m before event occurred
loop
solve (1) for the unknowns, with pre(m) fixed
if m == pre(m) then break
pre(m) := m
end loop
The shown loop describes the outer event iteration, while solve(1) is called
outer event step. If the systems contains algebraic loops as functions of discrete
variables, solve(1)requires an iteration for solving the equation system. This is
the inner event iteration and is performed within the outer event step.
SimulationX 3 10-27
User Manual 10. Modelica in SimulationX
Yes
reinit(x,xr)
If reinit is executed,
always pre (m) <> m
applies as it happened in
When Block -> New
pre(m):=m pre(m)==m External Event step
No ?
Yes
Valid Step
Afterwards, consistent initial values are calculated for the continuous and real-
discrete part of the equation, while the discrete, non-real variables remain constant.
The inner event iteration runs as long as the values of the discrete state variables m
and the logical value of the condition c have become stable. For the active
reinit instructions, the saved values are then assigned to the variables x in (1).
The test checks whether the discrete variables have changed compared to the pre-
values. If so, they are updated and a new outer event step is performed. If not, the
step is validated and the continuous simulation is resumed. Also performing
reinit assignment trigger a new outer event step (cf. Figure 10.4).
The introduction of the inner event iteration has the following effects:
As the equation system with constant pre-values is calculated several times,
also instructions in when blocks are executed multiple times. This also
affects when sample() blocks.
The discrete/continuous system is solved, that means the discrete state
followst he changes in the continuous system at the iteration point
immediately so long as it stops changing. This is rather awkward for
modeling discrete controllers with a proportional part.
10-28 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
model Modell1
extends SimModel;
algorithm
when sample(0, 0.1) then
Modelica.Utilities.Streams.print(String(time));
end when;
end Modell1;
The same character string is completely written down several times (twice each).
Reason: the inner event iteration:
when is transformed into
Boolean b;
...
if b and not pre(b) then end if;
as long as pre(b)is not set to the value of b, the condition remains true
This is the case at least twice:
o First event step: b changes -> another step must be performed
o Second event step: a test is run to look for changes
Only then are the pre-values being applied
Problem:
when is intended for content to be executed only once
variables in algorithm which are assigned in when are discrete by default
and are set to the pre-value at the beginning of the algorithm
SimulationX 3 10-29
User Manual 10. Modelica in SimulationX
Modelica.Utilities.Streams.print(String(time));
end if;
end when;
end Modell1;
So t1 keeps the value from the previous pass and the test t1 < time fails the
next time and the content of the if block is not executed another time.
model modelicaConformEventIter
extends SimModel; //< (just for running as ism
model)
Real x;
Real y(start=0.5,fixed=true);
equation
x = time - y;
when x >= 0 then
y = -x/2;
end when;
end modelicaConformEventIter;
-
1.0 x
y
0.8
0.6
0.4
0.2
0.0
-0.2
-0.4
s
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
10-30 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Now:
The Modelica specifications say, however, that the equation in the when block
becomes active and the overall system must be solved once the expression x > 0
is true. For the point the when condition is met, the equation system that must be
solved looks as follows:
x = time y;
y = - x/2;
Integrating the second equation into the first one and solving it for x returns x =
2*time. For time index time=0.5, x = 1 and y = -0.5. This is also reflected
in the result curve calculated with SimulationX 3.7 shown in Figure 10.6. Note the
occurring deviations from the curve calculated with SimulationX 3.6 starting at
time index ab time = 0.5 as shown in Figure 10.5.
x
y
-
-0
s
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
Solution:
SimulationX 3.7 delivers the same results as SimulationX 3.6 for equations and
relations who are directly or indirectly embedded in the when condition if you use
the known limit pre(y) from the left side instead of the discrete variable. For
discrete variables like y, pre(y) is the value in the first event for y from the
calculation of the initial value before the simulation. Usually, this is the fixed
initial value of the variable. In the subsequent event step, pre(y) takes the value
of y from the previous event. The value pre(y) is no longer variable in the
current event and can be regarded as given for the equations in the current event.
Therefore, all equations and relations in the following model
modelicaConformEventIterWithPre can be treated sequentially in the
appropriate order without the need to solve the equation systems in iterations. The
model returns the same result as the one shown in Figure 10.5 which was
calculated with SimulationX 3.6 for the model modelicaConformEventIter.
SimulationX 3 10-31
User Manual 10. Modelica in SimulationX
model modelicaConformEventIterWithPre
extends SimModel; //< (just for running as ism
model)
Real x;
Real y(start=0.5,fixed=true);
equation
x = time pre(y);
when x >= 0 then
y = -x/2;
end when;
end modelicaConformEventIterWithPre;
10.5.4 Initialization
During the initialization, the model consisting of discrete and continuous variables
and their equations is put in a consistent state.
For the initialization, a special equation system is created. It consists of:
the normal (transient) equations and algorithms,
the contents of the when initial() blocks,
equations pre(mk) = mk for all mk which are calculated in other when
blocks,
the initial algorithm and initial equation sections and
the equations for the fixed initial values.
All variables are considered unknowns. They include pre(m)and the states x
which are independent of their corresponding m or der(x)in contrast to transient
systems. They all form an algebraic system whose solution may require an
iteration. All equations in when initial()can be executed multiple times. Non-
fixed initial values are used as initial values for the iteration and are set in advance.
The initialization is treated as inner event iteration, but uses the initialization
system, and initial() returns always true and sample(0,) always false.
The iteration is complete when the system has reached a consistent state and the
discrete variables have stopped changing. At the end, the transient system is
calculated once executing the instructions in when initial(). After the
initialization, a normal event iteration is performed for the start time.
10-32 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
m' := m
Consistent Initialization System
pre(m) ' := pre(m)
Initial Values m, pre(m) is calculated
Event Step
No
m' == m,
pre(m)' == pre(m)
?
Yes
10.5.5 Variability
10.5.5.1 Observing variability
For modifications of constants, parameters and variables, it is vital to take the
variability into account:
Variability Meaning
constant Constant (literal). Is calculated during the global symbolic
analysis (GSA). Changes require a new GSA.
parameter Constant. Can be calculated during the GSA. Can be
changed without a new GSA.
parameter Is calculated through initial equations, is constant
(fixed=false) afterwards. If the parameter has a modification, the fixed
attribute is ignored.
SimulationX 3 10-33
User Manual 10. Modelica in SimulationX
During the modification of variables with different variability, other variables can
be referenced. The following limitations apply:
Example:
If a parameter p is modified with a variable v (p = v), the following error
message appears:
"The variability "parameter" of the defined variable "p" is lower than the
variability "variable" of the assignment "v".
v(variable)
This also happens if the variable v was modified with a constant value.
Up to SimulationX 3.6, the content of the modification determines the variability,
while variables declared as constant or parameter could be modified with
variables with a constant modification.
10-34 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Example:
model EventGeneratingFunctionsIf
Real x(start=0,fixed=true);
equation
der(x) + x =
if noEvent(time > 0.5) then
ceil(10*time) // depends from continuous
relations -> error
else
floor(10*time); // depends from continuous
relations -> error
end EventGeneratingFunctionsIf;
10.5.6 Algorithms
10.5.6.1 Initialization of variables in algorithms
According to the Modelica specifications, algorithms must not include any
repositories. The solver therefore resets all assigned continuous variables to their
SimulationX 3 10-35
User Manual 10. Modelica in SimulationX
In models with restricted assignments for variables within algorithms, this can
result in assigned values to not go through and variables to keep their initial value
or to remain 0.
Example:
In this model, y is supposed to be overwritten in certain time intervals:
Real[3] y(start={1,2,3});
algorithm
if sample(0,0.1) then
y := {1,2,3}*time;
end if;
Problem:
Variable y is calculated within the algorithm. Before each pass, y is initialized.
sample()returns true only during the first outer event step, so the initial value
remains unchanged during the second pass and thus also at the end.
Solution:
There are several options to solve this problem:
1. Variable y is calculated in an equation section.
However, this is not always possible, e.g. for algorithms with a variable that
overwrites itself (y:=y+1).
This would require fort the example to also have an else branch (as the
condition is not constant), which makes modeling the desired behavior more
difficult.
2. Variable y is calculated in the when block.
Real[3] y(start={1,2,3});
algorithm
when sample(0,0.1) then
y := {1,2,3}*time;
end if;
This makes the variable discrete and initializes it to the pre-value when the
algorithm is executed anew. As the latter is updated after an outer event step,
the desired value is preserved due to the second pass ignoring the
instructions in the when block.
3. Variable y receives the annotation
NoAlgorithmInitialization=true:
10-36 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Real[3] y(start={1,2,3})
annotation(NoAlgorithmInitialization=true);
algorithm
if sample(0,0.1) then
y := {1,2,3}*time;
end if;
SimulationX 3 10-37
User Manual 10. Modelica in SimulationX
For non-functional models with stateSelect, the attribute should be deleted for
the time being or set to StateSelect.default to investigate the model further.
This port is called generator port and determines the dimensions of the bus which
all connected input ports adapt. The data type of the vector element is derived from
the variables that are connected with the input ports through equations. Only
simple types, such as real, integer, Boolean, string and enumeration types, are
permitted.
The expression in the dimension of the generator port and the selectors of the
vector element at the input ports must be constant and calculable for the analysis
time during reading from and writing to the bus. Any changes later on require a
new analysis.
It is also tested whether the variable connected with a bus component have the
same value type. If not, an error message is shown.
10-38 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
The following example includes a simple bus system with a controller and an
actuator as well as a bus generator and two sensors. For better readability, all
graphical annotations have been removed.
// approach
varpR=cos(2*pi*self.time) "Real Bus Input";
varR =varpR + pR_res + pI_res + (if pB_res then 1 else 0);
varB = if varR>1 then true else false;
SimulationX 3 10-39
User Manual 10. Modelica in SimulationX
end Actuator;
model Sensor "Sensor"
input SignalBlocks.InputPin bus[:] "Signal Input";
Variable busOut "Selected Signal";
parameter SelectBusChannel channel "Select Bus Channel";
type SelectBusChannel = enumeration(
c1 "Bus Channel 1",
c2 "Bus Channel 2",
c3 "Bus Channel 1",
c4 "Bus Channel 2",
c5 "Bus Channel 1",
c6 "Bus Channel 2") "Select Bus Channel";
equation
// read bus signals
busOut = bus[channel];
end Sensor;
BusGenerator busGenerator1;
Controller controller;
Actuator actuator;
Sensor sensor1(channel=Sensor.SelectBusChannel.c1);
Sensor sensor2(channel=Sensor.SelectBusChannel.c2);
SignalBlocks.Connection bus;
equation
connect(bus,actuator.bus);
connect(bus,busGenerator1.bus);
connect(bus,controller.bus);
connect(bus,sensor2.bus);
connect(bus,sensor1.bus);
end Model1;
10.5.9 Miscellaneous
10.5.9.1 Assigning a variable in when blocks in the equation section
In the past (example):
when x>1 then
y = 1;
end when;
when x<-1 then
y = -1;
end when;
Problem: Error: The equation system is structurally singular. There are too many
equations.
Solution:
when x>1 then
y = 1;
elsewhen x<-1 then
y = -1;
end when;
10-40 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
At the point of initialization, the operator delivers the value for the start attribute.
As a new feature in SimulationX 3.7, the value is updated after the initialization
iteration, but before the first event iteration at the starting time. That way, it returns
the result of the calculation of consistent initial values before the first event
iteration, which corresponds more or less with the behavior during the simulation.
The existing value of the start attribute is especially useless for variables with
fixed =false as it is merely an estimate where the iteration is supposed to start
and is updated during the calculation of the initial value.
are now marked as inner so that they can be addressed through a local outer
declaration, e.g.
Example:
model A
model B
Real b=a; // <- Error: unknown variable a referenced
end B;
Real a=1;
B c;
end A;
A d;
model A
model B
Real b=a; // <- ok, a is a constant
end B;
SimulationX 3 10-41
User Manual 10. Modelica in SimulationX
Solution:
model A
model B
// resolved to enclosing inner with same name
outer Real A;
Real b=a; // ok: a is outer variable
end B;
inner Real a=1; // used variable
B c;
end A;
A d;
The former is now part of the index reduction. Models can no longer be simulated
without index reduction. These settings have become obsolete anyway as potential
conflicts which they were supposed to address no longer occur due to the
integration of both steps.
Also the switch for "Optimization for ODE" has been removed (now performed by
default).
10-42 SimulationX 3
Conversion of models for use in SimulationX (since version 3.7)
Therefore it was not clear, which value p.active gets at the end, because the
values of element1.p.active and element2.p.active may be different in
general.
To get the propagation also in case of multiple references from a dedicated inner
parameter, the references in all other inner parameters have to be put in
parenthesis.
Thus, are not counted as direct references anymore and will be ignored, e.g.:
element1.p=p;
element2.p=(p);
means
p.active:=element1.p.active;
SimulationX 3 10-43
User Manual 10. Modelica in SimulationX
10-44 SimulationX 3
by
FAQ
General
How can I get in touch with ITI for any technical questions?
Whenever questions and problems occur, you can rely on rapid and professional
back-up from the ITI support team. The simplest and quickest way is to use the
ITI HelpDesk online, which is open to everyone. Alternatively, send an email to
support@simulationx.com. Either option you chose we will respond as quickly
as possible.
Yes. We have a large number of authorized partners all over the world who
offer technical support. To find out your local partner, please have a look at our
partner list online on https://www.simulationx.com/iti/international-
distributors.html .
SimulationX 3 11-1
User Manual 11. FAQ Frequently asked questions
11.2 Installation/Licensing
Problem Reason/Help
I used the student Start SimulationX as Student Edition. Open the dialog
edition and would Licensing in the menu Extras Options of
like to use a certain SimulationX program. Select below SimulationX start as:
edition (Evaluation, the desired edition for the next program start.
Professional, etc.)
now.
Please examine first whether you use the license file on the
computer from which it has been requested.
11-2 SimulationX 3
Installation/Licensing
I receive the All licenses of this file are being used. The users are
following error displayed as follows (for single-user license - the computer
message when name, for network license - user+++computer name). Select
starting another license file.
SimulationX: If no user is present and you receive this message never-
"No free license theless, then the license file is probably damaged. Overwrite
available." the existing license file with the before provided backup
copy.
I do not see the Check under Extras Options in the tab Libraries and
newly acquired Modules, if the appropriate libraries selected for use. If
libraries. necessary, they put the appropriate hooks.
When you start For this problem there are several causes:
SimulationX 1. There is no key detected because the protective
the key is not software is not installed or is not running properly. To
recognized even check if the service for the protection software is
though it is running, go under Start Control Panel
plugged. Administrative Tools ->Services. A service like
Sentinel Protection Server should be running. If this
is not the case, start the service manually.
SimulationX 3 11-3
User Manual 11. FAQ Frequently asked questions
11-4 SimulationX 3
Simulation/Computation
11.3 Simulation/Computation
All troubleshooting actions which depend on the error message are marked by .
Since the causes leading to this warning or error message are rather complex in
most cases you should read the complete Reason/Help text before you begin to
localize the problem.
SimulationX 3 11-5
User Manual 11. FAQ Frequently asked questions
11-6 SimulationX 3
Simulation/Computation
SimulationX 3 11-7
User Manual 11. FAQ Frequently asked questions
11-8 SimulationX 3
Simulation/Computation
SimulationX 3 11-9
User Manual 11. FAQ Frequently asked questions
11-10 SimulationX 3
Simulation/Computation
SimulationX 3 11-11
User Manual 11. FAQ Frequently asked questions
11-12 SimulationX 3
Simulation/Computation
SimulationX 3 11-13
User Manual 11. FAQ Frequently asked questions
11-14 SimulationX 3
Simulation/Computation
There are too many corrector steps, steps with too big
residuals, steps with too big Newton updates.
The changes in the corrector iteration can be traced by
Solver Newton Updates and Solver Residual
Vectors. We recommend to reduce the tracing output
by the parameter traceOn (e.g. time > 0.56). It may
be also useful to trace the Solver States,
Solver Derivatives and Solver Jacobian for
a better understanding of the behavior. However good
model knowledge is required for the debugging.
If there are only steps with too big residuals but no
steps with too big Newton updates the too large
residuals are output in the following way
Residual name (Corrector step) (Residual Value)
The subsequent output of the too large residuals at the
end of the corrector iteration is
Residual name Residual value (Dependent state
variables and their derivatives).
The absolute value of the residual is compared with the
tolerance of the equations dblEquTol (if positive) or
the absolute tolerance of the equations (if set) or the
general absolute tolerance absTol. If the state
variable corresponding to the relevant equation has got
a necessary derivative (e.g. purely as protocol variable)
which does not contribute to the system of equations
then the tolerance is multiplied by
dblEquaAbsTolFacForDer. If the unavoidable
error during the computation of this equation is
comparatively large, the error bound will be increased
under consideration of dblResRelError. The
analysis of the tracing Equations Calculation of
the equations,Equations Calculations of partial
derivations,Solver Newton Updates and
Solver Residual Vectors may reveal why the
residuals do not decrease and where corrections are
required. If however the residual values should be
accepted then the exceeded tolerances or
dblResRelError need to be increased such that the
SimulationX 3 11-15
User Manual 11. FAQ Frequently asked questions
11-16 SimulationX 3
Simulation/Computation
SimulationX 3 11-17
User Manual 11. FAQ Frequently asked questions
11-18 SimulationX 3
Simulation/Computation
SimulationX 3 11-19
User Manual 11. FAQ Frequently asked questions
11-20 SimulationX 3
Simulation/Computation
SimulationX 3 11-21
User Manual 11. FAQ Frequently asked questions
11-22 SimulationX 3
Simulation/Computation
SimulationX 3 11-23
User Manual 11. FAQ Frequently asked questions
11-24 SimulationX 3
Simulation/Computation
SimulationX 3 11-25
User Manual 11. FAQ Frequently asked questions
11-26 SimulationX 3
Simulation/Computation
SimulationX 3 11-27
User Manual 11. FAQ Frequently asked questions
An error message follows the above output. It tells us when the error occurs
(during the initialization, at an integration step, during the reinitialization after a
discontinuity, etc.). That is important to find the block equations inside the tracing
Equations/Symbolic Jacobian.
In most cases one of the following four messages will be displayed before the
above error message. They give us more detailed indications why the solution of
the block equations fails.
Error message Reason/Help
"Residual is not in This message includes information about the size of the non-
the image of solvable block, the involved block variables, the number of
Jacobian ... with the the non-solvable linearized equation (if all preceding
DAE state(s) ..." equations could be solved) and if the Jacobian has only one
column the values of Jacobian and the residual.
Select the tracing Equations Symbolic Jacobian
and search for one or more involved block variables in
the displayed equations. After you have found the
sought block, try to find out why it is not solvable.
E.g. inconsistent initial values can be the reason for the output of this message
during the initialization:
21.Step: Residual is not in the image of 2*1-Jacobian with the DAE state
_der_connection3.phi: res[1] = 6.5741692360397401 (>4.4408920985006302e-
013) != jac[1][0] * s = 1 * 0
11-28 SimulationX 3
Simulation/Computation
Then we can easily identify the cause of the problem here: the given initial values
were fixed and are inconsistent.
Actually the values of all variables can only be examined by opening a result
window (dtProtMin should be sufficiently small). If the quantity is not directly
accessible, a general function element (f(x) in the Signal Blocks library) may be
used. Then its name must be entered as expression of the general function block.
SimulationX 3 11-29
User Manual 11. FAQ Frequently asked questions
11-30 SimulationX 3
by
Definitions
12 Definitions
3D-View For models with elements from the libraries MBS
Mechanics, Planar Mechanics, Power Transmissions,
and Animation Bodies a 3D-View is available, in which
the spatial arrangement and the geometry can be
represented and edited. Furthermore, the movement of
the elements can be visualized during simulation and
animation.
Algorithm Is a part of the behavioral description of a type for the
computation of result variables during the simulation.
Analysis Tools integrated in SimulationX, which are helpful for a
fast evaluation of a model. There are different kinds of
analysis:
Model analysis
Transient analysis in the time domain
Linear system analysis.
Natural frequencies and mode shapes of the
linearized system.
Input-Output analysis
Result analysis
FFT Spectral analysis of any physical signal after
the simulation in the time domain
Frequency Response Function (FRF) - computation
of the complex transfer function from input and
output signals simulated in the time domain
Order Analysis
SimulationX 3 12-1
User Manual 12. Definitions
12-2 SimulationX 3
specific physical discipline (e.g., linear mechanics,
rotational mechanics, hydraulics, electronics, etc.) The
availability of a certain domain (e.g. of a connector
type) may depend on the license. Since domains are
internally pre-defined in SimulationX, they cannot be
created by the user.
Element The element is a component of a model. It is created
from an element type. The type specifies the selection
and kind of parameters, the connectors, the result
variables and the algorithms and/or equations. The
element carries the values of the parameters and
variables. (e.g. an element mass1 in the diagram view
is derived from the Element Type
Mechanics.Translation.Mass and has its properties.)
Element Type Description of a class of elements, which have the same
connectors, parameters, algorithms, equations, internal
components, etc. (e.g., the Mass in the library Linear
Mechanics represents an Element Type with the
identifier Mechanics.Translation.Mass
Equation Equations formulate the properties, dependencies, and
physical laws, which hold for a model or a type. Apart
from parameters, equations usually contain several state
and result variables, thus several equations are coupled.
In order to compute the unknown quantities (the state
variables), the set of equations must be solved using a
Solver.
Equilibrium The equilibrium is the state of a model, where
a) the time derivation of all state variables is zero, or
b) the highest derivatives (e.g., the accelerations in
mechanics) are zero.
In mechanics case a) is often termed as static
equilibrium, in fluid power however as steady-state
equilibrium. A system (i.e., a model) can have exactly
one equilibrium, several equilibria, or also none.
Event Time instant during the simulation run, at which
a) state variables of the model (or their derivatives)
change discontinuously,
or
b) the model equations change their structure.
Examples for discontinuities are kinks or jumps in
characteristic curves. Structural changes arise at end
SimulationX 3 12-3
User Manual 12. Definitions
12-4 SimulationX 3
They can be used for computation of initial values of
variables or constant parameters (e.g., constant parame-
ters, which must be computed by an iteration loop).
Initial Equations Same as Equations, but they are only valid while initial
value computation. They are valid additionally to the
equations and algorithms.
They can be used for the computation of initial
constraints and describe also the initial state of a model
(or element). They can be used for the computation of
initial values of variables or constant parameters.
Input-Output Analysis Analytically certain response of a model at a defined
output after excitations at a defined input. Represented
as amplitude/phase or real and imaginary part of the
complex system response over the frequency.
ITI Script The integrated Script language of SimulationX for
controlling the simulation over the applications COM
interface.
Internal Types These are all types delivered with the software (contents
of the libraries).
Library Group of functionally related Element Types (e.g., the
Element Types, for a damper, a spring, or a friction, are
contained in the library Linear Mechanics).
Linear System Analysis At the linear system analysis a linearization of the
model takes place around the current operating point.
The results apply thus with nonlinear models only
within an (small) environment around this operating
point.
This are:
Natural Frequencies and Mode Shapes
Input-Output Analysis.
Library Bar Hierarchically structured view of the libraries (e.g.,
Mechanics, Linear Mechanics, Signal Blocks, etc.) and
the element types contained within (e.g., spring, mass,
damper). In the library bar the types appear as symbols,
which provide access to the corresponding type.
Local Types These types are defined within a (superordinate) model
and can be used only there. They are part of the model
and are transferred with it.
Model Representation of a system or a process using of
elements, connections, algorithms, and equations.
SimulationX 3 12-5
User Manual 12. Definitions
12-6 SimulationX 3
system (e.g. temperatures or pressures). They can be
measured at the nodes. The difference of the potential
quantities along a branch is also termed an across
quantity or potential difference.
Property Window Property windows serve for the displaying and
modification of properties of the components (elements,
connections) in a simulation model. On the individual
registration cards values, units, and protocol attributes
can be entered or set.
Protocol Attribute The Protocol Attribute indicates that the computed data
(i.e. time history) of a certain result variable is to be
stored together with the model and can be displayed
after the simulation in a result window.
Propagation Mechanism, which guarantees that all connections of a
Circuit use the same fluid type. Additionally, other
settings of the connection are propagated, i.e., passed on
to all other connections of the circuit. In hydraulics this
concerns the options for temperature and gas fraction
calculation.
Residual Result of the right-hand side of an equation, which was
rearranged in such a way that the left-hand side is zero.
For each vector of state variables, a vector of residuals
is computed. The Solver tries to minimize the residuals
using an iterative method.
Result Variable Variable of a Model, an element or a connection, for
which during the simulation an evolution in time is
computed.
Result Window Window for the representation of the simulation results
in graphical form, as x(t) or x(y) diagrams. There is the
possibility of representing several result processes in
one window.
Simulation In the simulation the evolution of the model behavior in
time is determined. This depends on the model structure
as well as the used parameters and initial values. As
result the user receives the evolution in time of all result
variables and can evaluate it.
Solver Package of numeric solution methods, with which the
state variables of a Model are computed for each time
instant during the simulation run.
Start values Usually, not all initial values in a model are set by the
user. Thus the solver must try to find iteratively
SimulationX 3 12-7
User Manual 12. Definitions
12-8 SimulationX 3
variations over time (e.g. speed of resonance crossings
or time-dependent change of quantities). In contrast to
the steady-state simulation the system is not in steady
state.
Type Description of a class of elements or connections,
having the same connectors, parameters, algorithms,
equations, internal components etc.
TypeDesigner Integrated tool in SimulationX for the development of
new element types.
Using the TypeDesigner, the user (type developer)
specifies a symbol, connectors, components, Activity
Groups, behavior (algorithm and equations), and
documentation of the new element type.
Wizard A program module, which leads the user step by step
through a task (e. g. optimization wizard or variant
wizard).
Zero-functions Zero-functions are used for the detection of
statedependent events. They cross zero at the time
instant of the event they are associated with. Zero-
functions are generated automatically by the symbolic
analysis. For example: The expression if x>10 then 0
else 5 generates the zero-function x-10.
SimulationX 3 12-9
User Manual 12. Definitions
12-10 SimulationX 3
Bibliography
13 Bibliography
SimulationX 3 13-1
User Manual
13-2 SimulationX 3
Index
14 Index
curve ............................................. 5-50
3 curve family ................................. 5-53
3D view .............................................5-60 curve set ....................................... 5-53
camera ...........................................5-61 data export .................................... 5-42
connect ..........................................5-73 data import ................................... 5-42
connector ......................................5-60 data input ...................................... 5-42
construction ..................................5-71 dialog............................................ 5-41
coordinate system .........................5-60 interpolation ................................. 5-43
disconnecting ................................5-73 properties...................................... 5-49
global settings ...............................5-62 toolbar .......................................... 5-42
local settings .................................5-67 Characteristic maps
origin .............................................5-60 2D-map ........................................ 5-53
positioning ....................................5-72 3D-map ........................................ 5-59
Realistic ........................................5-64 data export .................................... 5-55
select an element ...........................5-70 data input ...................................... 5-55
settings ..........................................5-62 dialog............................................ 5-53
Standard view ...............................5-64 properties...................................... 5-57
Technical view ..............................5-64 toolbar .......................................... 5-54
visualization ..................................5-67 Class
Wireframe .....................................5-64 application ...................................... 9-9
connections .................................. 9-11
A curves ........................................... 9-11
document ........................................ 9-9
Activity groups..................................8-23 parameters .................................... 9-11
Algotithm ..........................................8-27 results ........................................... 9-12
Analysis
selection ....................................... 9-13
equilibrium......................................6-1 SimObjects ................................... 9-10
linear ....................................... 3-7, 6-1
Code Export ..................................... 9-42
stady state .......................................6-1 C-code without solver .................. 9-53
transient ..........................................6-1
ETAS LABCAR .......................... 9-76
Animation ................................. 6-1, 6-42
Executable Model ........................ 9-53
play back .......................................6-45 MATLAB/Simulink S-Function .. 9-59
record ............................................6-45
NI LabView ................................. 9-64
save ...............................................6-45 Post Processing ............................ 9-52
Approximation
project ..... 9-45, 9-66, 9-69, 9-73, 9-76
by circular arcs..............................5-46 requirements................................... 2-1
by hyperbolas ................................5-45
source code.......................... 9-21, 9-42
quadratical ....................................5-47
VehicleSim................................... 9-72
tolerance ........................................5-52 wizard ........................................... 9-45
Code Import
C
FMU code import......................... 9-79
Characteristic curves .........................5-41 COM interface ........................... 7-60, 9-7
approximation ...............................5-43 Compare Models .............................. 5-81
continuation of the curve ..............5-48 Components...................................... 8-15
SimulationX 3 14-1
User manual 14. Index
14-2 SimulationX 3
Index
L O
Library Optimization ....................................... 1-1
library bar .......................................4-3 Isight ............................................ 9-88
License optiSLang ..................................... 9-90
license file .....................................2-26 OtiY.............................................. 9-88
managed ........................................2-28 Order Analysis ................................. 6-95
network ............................... 2-29, 2-30
Linear system analysis ......................6-70 P
input-output analysis.....................6-81 Parameter .......................................... 5-21
natural frequencies and mode shapes add ................................................ 4-16
..................................................6-72 description by characteristics ....... 5-33
Local type description by formulas ............... 5-32
enumeration ..................................8-20 Export ........................................... 5-30
function .........................................8-20 Import ........................................... 5-31
Simblocks ........................... 8-18, 8-21 logical terms ................................. 5-22
mathematical expression .............. 5-22
M multidimensional ......................... 5-26
Model nonlinear property ........................ 5-32
SimulationX 3 14-3
User manual 14. Index
14-4 SimulationX 3
Index
SimulationX 3 14-5
User manual 14. Index
14-6 SimulationX 3