I describe here the research I have done this summer as a NSERC-funded summer student in the Modelling, Simulation and Design Lab (MSDL) of McGill University, under the supervision of Prof. Hans Vangheluwe: Hybrid Systems Modelling and Simulation
Hybrid Systems are physical systems which are modelled with continuous components (using differential equations) and with discrete components (using some discrete events formalism). The long term goal for my summer research was to investigate which could be the best formalism to model Hybrid Systems (need expressiveness), and which could be the best formalism to simulate them (need efficiency). In order to study these concepts, my starting point was a prototype implementation of a Hybrid Systems (HS) modelling and simulation environment, programmed in Python.
The first part of my summer research has been to study the HS simulator from a physicist point of view, in order to find what could be improved in the modelling environment. Several physical models were implemented with the simulator (gravitational bodies with collisions, controlled heat flow problems, etc.). One of the suggestions I have made after this experimentation was that the modelling of complex physical systems could be significantly simplified if the simulator could support Differential Algebraic Equations (DAE) instead of only Ordinary Differential Equations (as was the case), since most of the physical laws (like conservation of energy) were primarily expressed as DAEs.
This has motivated the second part of my summer research, which has been the inclusion of a DAE solver into the HS simulator. Instead of building from scratch our own DAE solver, we have decided to reuse a standard DAE solver which had already been extensively used and tested in the scientific community: DASSL, written by Linda R. Petzold in Fortran in the 90s. In order to extend Python with the Fortran code of the DASSL solver, the tool f2py (a Fortran to Python interface generator) was investigated and used.
The HS simulator lacked a graphical user interface for the modelling environment, so the third part has been to implement one by using the meta-modelling visual environment tool called ATOM3, developed at the MSDL. The process of finding a precise meta-model for the Hybrid Systems formalism gave us more insight about the expressiveness power of each formalism. Amongst others, the statechart formalism was identified as a good candidate to model the concurrent continuous modes of operations of Hybrid Systems.
These were only a few investigations in the vast domain of
modelling and simulation of Hybrid Systems. Further contributions
could be to add the DAE support in the modelling environment of
the HS simulator (currently, only the simulation part supports
it), and also to include the statechart formalism in the modelling
environment. Those will be investigated as a project in my
Modelling and Simulation course of this semester.