Wednesday, December 7, 2022
Home Buyers' Guides Modelling With Modelica In OpenModelica

Modelling With Modelica In OpenModelica

Modelling With Modelica In OpenModelica
fig 2
Fig. 2: Parametric plot of Van der Pol simulation

Generating outputs in mat format will allow you to post-process the same in MATLAB or OCTAVE. You can even specify the variables that should be passed onto the output file.

Using commands, you can also obtain a mathematical representation of a model using an Extensible Markup Language (XML) representation or a MATLAB representation.

As always, graphs can be generated for quick and clear analysis, and these can be time or parametric plots. There is also a 3D visualisation library called Modelica3D.

Make the most of your Python skills
Calling external functions from C comes automatically with OM. Calling external Python Code from the same, and vice versa, is an added advantage. OM also provides a scripting interface for Python, called OMPython, and PySimulator, a Python package that provides simulation and post processing/analysis.

Analyse, debug and optimise
If the model being simulated has non-linear equation systems, it is useful to enable performance analysis while simulating, as the tool would then take into account execution times of user-defined functions as well as linear, non-linear and mixed-equation systems. A profiling test also comes in handy for analysis.

Fault-tolerance levels can be studied using Figaro extensions, to get a grip of static or dynamic reliability analysis. Debugging involves going through the transformations made and the algorithms processed.

To optimise the model under scrutiny, OM offers a few facilities. Built-in dynamic optimisation is provided using OM and IpOpt. CasADi framework can also be used for the same. For the case of a static optimisation, the classical Parameter Sweep Optimisation using OMOptim is recommended.

OM finds its way to IIT Bombay
As mathematical modelling and simulation is indispensable for progress in all engineering areas, it is no surprise that OM has found users at IIT Bombay. Prof. Kannan Moudgalya from the institution says that the open source electronics design automation software eSim, developed by FOSSEE group at IIT Bombay, is dependent on OMOptim for optimisation. Using this, one can solve problems such as finding the value of the resistor that will make the rise time less than 0.3 seconds.

box 2

A complete set of self-learning instructional material will be launched soon through the award-winning Spoken Tutorial methodology developed at IIT Bombay. Keep watching

Peter Fritzson, director of Open Source Modelica Consortium, adds that the chemical engineering department at IIT Bombay is using OM for modelling and simulation. It is in the process of making chemical engineering building blocks and CAPE-OPEN thermodynamics available in the environment.

Learn as you model
OM has an electronic notebook sub-system, DrModelica tutoring sub-system and DrControl for teaching about control systems, together with Modelica. You can also import and export works between different Modelica tools or between certain non-Modelica tools.

Priya Ravindran is a technical journalist at EFY