Abstract: This blog post is aimed to describe the Find Connection command available in Dymola. This Dymola command is helpful for searching of signals created within large Modelica models especially using Modelica expandable connector. For demonstrating the features of this command, a Hybrid Electric Vehicle example available in a commercial Modelica library (VeSyMA) is used. It is shown that by using this command, systems modellers can not only search the signals of their interest efficiently but also switch back and forth the signals and their connected components of a system-level model in Dymola.
Keywords: Expandable, Connector, Signal, Find, Connection, Command, Modelica, Dymola, HEV, Component, Model.
Software/Tool/Language used: Dymola 2018 FD01, MSL 3.2.2
Download a copy of this blog post as a pdf: Modelica Expandable Connectors’ Signals and their Connected Components in Dymola
Dymola (DYnamic MOdelling LAboratory) is a systems-engineering software for modelling and simulation of multi-engineering & cyber-physical complex systems based on Modelica (an open source equation-based object-oriented) modelling language . While developing and/or analysing models in Dymola, it is quite common for users to have to work or deal with very large and complex models. Regardless of how these models are created (from scratch or pre-existing), it is very easy to lose track of where the signals are first created or used in systems models. If a signal is generated from Modelica expandable connector , then, the signal as well as its connected components, can become harder to trace without making use of built-in commands or features in Dymola. With the help of the Dymola built-in command, Find Connection, the searching of signals and toggling between their related components is made easy. To understand the effectiveness of this command, a top-level experimental model (the definition based on ) with several hierarchical levels of components and signal connections is preferable. Therefore, for the demonstration purposes, in this blog post, a Hybrid Electric Vehicle (HEV) model available in a commercial Modelica library (VeSyMA)1 ) is used.
The demonstration part of this blog post has three steps; they are as follows:
- Describe a system-level HEV model available in VeSyMA library and display its two hierarchical components. Also, show an expendable connector and a signal of interest in the 2nd hierarchical level of this selected HEV model.
- Explore Dymola Find Connection command using the above-selected example.
- Switch between a signal and the components it connects using Find Connection command in Dymola.
Step 1: A System-Level Modelica Model
A system level Modelica model of an HEV from the VeSyMA library is shown in Figure 1. This model can be used to simulate the vehicle behaviour on predefined and custom drive cycles. In addition to the drive cycle analysis, this model can also be useful for predicting (or simulating) vehicle performance, fuel consumption, energy flow and for analysing powertrain integration. Modelica Expandable Connector
Figure 1 – A hybrid electric car with an automatic gearbox available in VeSyMA library.
The model is used only to demonstrate the efficacy of Find Connection feature available in Dymola.
Figure 2 – Object right-click dialog box
By right-clicking on the vehicle model in Figure 1 and selecting Show Component option in Figure 2, the rear-wheel drive car with automatic gearbox model will be displayed (Figure 3). This model has several sub-components. It includes body, electric motor, energy storage, engine, transmission, driveline, wheels, mounts, driver environment, interfaces, cooling system, brakes, axle, motor & transmission controllers, hub, fuel tank and other sub-systems. The model shown in Figure 3 can be considered as the top hierarchical level of the HEV model shown in Figure 1.
Figure 3 – The top hierarchical level of the HEV (vehicle) model highlighted in Figure 1.
By right clicking on the fuel tank component highlighted in Figure 3, and selecting Show Component again, we can see the diagram layer of the fuel tank model (Figure 4).
Figure 4 – The HEV fuel tank model.
In Figure 4, the signal of interest (in this case, relating to vehicleSpeed) is marked as (1). It is connected from an expandable connector called chassisBus. However, unlike a standard bus connector in the Modelica modelling language , this expandable bus connector has no predefined variables. More details about working with expandable connectors can be found in . The origin and use of this kind of signal generated from expandable connectors are useful to both the developer and a user of this kind of complex model. Therefore, the next section is dedicated to exploring the Find Connection command option available in Dymola.
Step 2: Exploring the Find Connection command in Dymola
By right-clicking on the signal of interest shown in Figure 4, a pop-up dialog box will appear as shown in Figure 5. Modelica Expandable Connector
Figure 5 – Selection box appeared by right-clicking on a signal of interest highlighted in Figure 4.
Then, by clicking on the Find Connection option highlighted in Figure 5, another dialog box will open in Dymola Diagram layer (Figure 6). Modelica Expandable Connector
Figure 6 – Pop-up window appeared by clicking on the Find Connection option shown in Figure 5.
This dialog box has two parts.
(1) Details about the selected signal (top half of Figure 6).
(2) Connection set: details about where this signal is created and used (bottom half of Figure 6).
In the latter, one can see that there are two different symbols as shown below.
By inspecting Figure 6, it is easy to understand that the name of the selected signal is vehicleSpeed. The locations of this signal, where it is first created and where else it is used using the Find Connection command based on the above two symbols will be explored in the next section.
Step 3: Toggling between Signals and their Connected Components
Dymola Find Connection command is not only able to track the source (input) or sink (output) of a signal used in a Modelica model but also able to switch back and forth to the signal’s connected components. Please walk through the following steps for a self-demonstration:
Figure 7 – The Find Connection window in Figure 6, but, the signal source is selected.
By clicking on the signal source symbol, vehicle.body.sensors.velocitySensor.v in Figure 7, its corresponding model will open in the Dymola Diagram layer which is depicted in Figure 8.
Figure 8 – A sensor model used in HEV model which is accessed using the Find Connection.
By looking at Figure 8, we can also say that Find Connection command is not only able to open the corresponding model where the signal is first created but also highlights the component model in the list for us. As shown in Figure 9 and 10, one can repeat the above procedure to search for where else this signal is used (the signal sink) in the HEV model.
Figure 9 – a. Same Find Connection window in Figure 6 whereas the first signal sink (output) is selected.
b. A motor controller model used in HEV model which is opened using the Find Connection.
Figure 10 – a. Same Find Connection window in Figure 6, but, the second signal sink (output) is selected.
b. An automatic transmission controller model used in HEV model which is accessed using the Find Connection.
Figure 11 shows that by selecting the vehicleSpeed signal again on the same Find Connection window in Figure 6, it goes back to the signal of interest and its connected component location in the model. This is the location where searching for the signal of interest began. Modelica Expandable Connector
Figure 11 – a. Same Find Connection window in Figure 6, whereas, the signal of interest is selected again.
b. Same fuel tank model in Figure 4 switched back using Find Connection command.
This blog post presented a useful built-in command in Dymola called Find Connection. With the aid of a system-level HEV model taken from a commercial VeSyMA library, the efficacy of this command is demonstrated. It is shown that by using this command, a Modelica model user and/or a developer can search for signals and components where the signal is created or used within a large system model efficiently.
1 For accessing VeSyMA library or experimenting with the example provided in this blog post, you must have a license. However, the concept shown in this blog post is the same for all the publicly available Modelica libraries from Modelica association.
- Dassault Systemes, 2018 FD01. Dymola—Dynamic Modeling Laboratory, https://www.3ds.com/products-services/catia/products/dymola/. (01 March 18, last accessed).
- Hannah Hammond-Scott, Working with Expandable Connectors. http://www.claytex.com/blog/methods/working-with-expandable-connectors/. (01 March 18, last accessed).
- Raees B. K. Parambu, Handling of Modelica Model’s Parameter Values in Dymola, http://www.claytex.com/blog/handling-of-modelica-models-parameter-values-in-dymola/. (01 March 18, last accessed).
- VeSyMA Library, http://www.claytex.com/products/dymola/model-libraries/vesyma/ . (Last accessed: 05 Feb. 18).
- Modelica language specifications version 3.3 Revision 1, Copyright © 1998–2014 Modelica Association July 11, 2014, https://www.modelica.org/documents (03 Oct. 17, last accessed).
Written by: Raees B. K. Parambu — Systems (Project) Engineer
Please get in touch if you have any questions or have got a topic in mind that you would like us to write about. You can submit your questions / topics via: Tech Blog Questions / Topic Suggestion