Do you really need detailed knowledge of every component in your system and how to model each component in order to successfully simulate the system? In this blog post I’m going to consider this question, and how the existing Modelica libraries that Dymola supports affect the answer.
One thing I have come to recognise with experience, is that I can’t know everything about everything; even though the engineer in me is always curious to learn more. My knowledge includes a little about a lot of areas, and a greater depth of knowledge in a few areas. This is alright because I work in a team, which collectively has a much wider knowledge than my own. So as long as my team works together to share the knowledge, the outcome should be successful.
“Try to learn something about everything, and everything about something”Thomas Henry Huxley
I think, this idea also applies when you’re deciding how to approach simulation. To achieve your goal of successfully simulating your system, you probably don’t actually need to know everything about your system and how to model it. Because someone may have already figured out how to model it, and you can leverage that in your work. Dymola supports an existing ecosystem of Modelica libraries, covering a vast range of domains and applications that you can use to supplement your inhouse knowledge.
Modelica and Dymola Support Collaboration
Dymola uses the Modelica language. Together, Dymola and Modelica support us in sharing our knowledge by:
- Being object oriented – We use objects that represent the physical components that we put together to create more complex systems. It encourages hierarchical modelling, where we can reuse models and easily interchange components in a plug-and-play style.
- Being multi-domain (multi-physics) – We aren’t limited to creating one type of system. There are existing Modelica libraries in the mechanical, electrical, electronic, magnetic, hydraulic, thermal, control domains plus many others.
- Being open – You can see the code defining the majority of models in Modelica libraries. So you can understand how they work. This code can also be customised if required.
- Supporting FMI (Functional Mock-up Interface) – This lets you import models from other tools into Dymola, or export Dymola models for use in other tools. This feature eases the exchange and co-simulation of models.
- Allowing interfaces with external tools – There are a number of examples where interfaces exist to permit Dymola to work with other tools.
Idea into Practice
We’ve done a lot of modelling and simulation in the automotive industry here at Claytex. Cars are complex systems, covering a wider range of domains. While our libraries cover many of the vehicle subsystems (suspension, engines, powertrain and hydraulics), we recognise the benefits that can be gained by using the expertise contained in third party Modelica libraries to complete the remaining vehicle subsystems.
This is illustrated in our VehicleDemos library, where the Claytex VeSyMA suite and FluidPower libraries are combined with libraries from other developers to create a variety of vehicles.
In the VehicleDemos electric bus example, we wanted to be able to investigate the effect of the heating, ventilation and air conditioning (HVAC) systems on the buses battery performance. We have an electric bus model in the VeSyMA library, but the necessary thermal management and cabin models required models outside our own libraries. So we used the ThermalSystems and TSMobileAC libraries from TLK to provide this HVAC modelling capability.
To create an electrified car with a higher fidelity electrified powertrain than the existing vehicle in VeSyMA, we need a more detailed electrification model. We were able to create this using the ElectrifiedPowertrains library (EPTL) from Dassault Systemes coupled with the remaining subsystems of our existing VeSyMA vehicle. This vehicle is used to simulate a drive cycle to investigate energy consumption.
One important factor on the ease of being about to combine our libraries with those of other developers, is the hierarchical structuring of our libraries with extensive use of common templates and interfaces. This made it simple for us to replace the subsystems in the VehicleDemos I’ve talked about with the versions built from external libraries. We have a number of blog posts on this key topic, including Dymola Model Inheritance and When to Extend, Duplicate or Create From Scratch.
In addition to the extra functionality in the VehicleDemos library by using the knowledge stored in other developers libraries, we have extended the potential capability of our libraries by interfacing them with specialist external tools such as:
- FTire interface in VeSyMA-Suspensions for multiple contact point tyre modelling suited to high frequency, high fidelity and handling experiments.
- OpenCRG and OpenDrive compatibility in VeSyMA-Suspensions to produce complex road models.
- rFpro interfaces in the VeSyMA-DiL allow VeSyMA based vehicles to be deployed in Driver-in-the-Loop (DiL) simulators.
- rFpro Terrain Server interfaces in VeSyMA-TerrainServer enabling high fidelity track data to be used in the simulations.
Some Things to Consider
By making use of existing Modelica libraries and interfaces to external tools you can vastly increase the capability of your libraries. And because you’re not creating everything from scratch you can reach your simulations goals much quicker, which is great. But there are some things to consider first:
- Library structure – It will be far easier to work with external libraries if you use a hierarchical structure based on interfaces and templates in you models (plug and play approach).
- Understand the results – While using libraries from other developers allows you to skip having to learn how to best model the system, you still need a good understanding of the system and its behaviour so you can make best use of the simulation.
- What goes in, comes out – A simulation can only ever be as realistic as the data you put into it and this isn’t something you can overlook.
- End of Life – There are many Modelica libraries out there, both open source and commercial, so when selecting one you need to think about its end of life. You don’t want to start using a library that isn’t being actively supported which could prevent you upgrading to new versions of Dymola because they become incompatible.
Don’t be an Island
By treating our Modelica library as an island entire of itself, we miss the opportunity available to us to expand our modelling capability by using the wider Modelica library community surrounding Dymola. I hope this post has highlighted the gains that can be achieved by looking beyond your own Modelica library, and this means you don’t need to know everything about everything to create your simulation.
Please take a look at the collection of libraries we can supply and support here to see which of these Modelica libraries can help you accomplish your simulation goals.
Written by: Hannah Hammond-Scott – Modelica Project Leader
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