Event Handling in the OpenModelica Compiler and Runtime System

Håkan Lundvall, Peter Fritzson, Bernhard Bachmann · 2008

Abstract This paper gives an introduction and overview of problems and solutions regarding simulating hybrid DAEs (systems of Differential Algebraic Equations) with event-handling, in the context of producing such equations from models in the Modelica language. Iimplementation and measurements are done in the OpenModelica environment. The basic hybrid DAE solution algorithm is presented, followed by a discussion of handling possibly varying structure of the active part of the hybrid DAE, and how to find consistent initial values at start or restart of simulation. The problem of detecting events during continuous-time simulation is dealt with using crossing functions and an algorithm for proper integration with a numerical solver, here DASRT. Event-related aspects of code generation from models are presented, followed by an example showing how the event mechanism works. Finally, preliminary results from translating and simulating two examples models, the bouncing ball and the full wave rectifier, are presented and compared with those from a commercial simulation tool (Dymola), giving identical results. 1

Read the paper · More papers on PaperTik