Quantized State System Simulation in Dymola/Modelica Using the DEVS Formalism Tamara Beltrame VTT, Industrial Systems PO Box 1000, VM3 02150 Espoo, Finland Tamara.Beltrame@vtt .fi Conference 2006 François E. Cellier Inst. of Computational Science ETH Zurich 8092 Zurich, Switzerland [email protected]
30
Embed
Quantized State System Simulation in Dymola/Modelica Using the DEVS Formalism Tamara Beltrame VTT, Industrial Systems PO Box 1000, VM3 02150 Espoo, Finland.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Quantized State System Simulation in Dymola/Modelica
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• A tool has been created for the simulation of highly discontinuous models in Dymola/Modelica that is based on Zeigler’s DEVS (Discrete Event Systems) formalism.
• ModelicaDEVS provides a reimplementation of the PowerDEVS software, a tool developed for the simulation of physical systems that is based on Kofman’s QSS (Quantized State Systems) algorithms.
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• When simulating continuous models on a digital computer, a quantization must take place, as digital computers can only perform a finite number of computations within any finite time span.
• Usually, it is the time axis that is being discretized, i.e., we are asking ourselves: given the current state at time t*, what value shall the state vector assume at time t* + h ?
• Yet, it is also possible to discretize the state axes, i.e., we can ask the question: given the current value of the quantized state variable qi , what is the earliest time when the variable will assume a value of qi ± Δqi ?
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• Numerical simulation algorithms can be based on either paradigm.
• Whereas almost all simulation algorithms currently on the market are based on the former approach, the QSS techniques are based on the latter.
• The QSS approach has some distinct advantages:– The method is naturally asynchronous.– QSS simulations can be more easily combined with discrete events.– Most state events turn into time events in QSS.– A QSS simulation of an analytically stable system is always stable.– QSS offers a global error bound.– It is possible to design “implicit” algorithms that are not truly implicit.
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• DEVS was introduced by B. Zeigler in 1976.
• DEVS is one among several discrete-event simulation methodologies. Other discrete-event techniques include: Petri nets, finite state machines, Markov chains, ...
• Specialty: DEVS models work with an infinite number of states. This is useful for numerical integration.
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
The DEVS Formalism 2
• Accept an input trajectory (external event), generate an output trajectory.
• Definition: M = <X, Y, S, δint, δext, λ, ta>– X = set of inputs– S = set of possible states– Y = set of outputs– δext = external transition– ta = time-advance function, often represented by σ– δint = internal transition– λ = output function
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• QSS operate on piecewise constant input and output trajectories.
• Systems with piecewise constant trajectories can be simulated using the DEVS formalism.
• QSS use a quantization function to transform a continuous system into a system with piecewise constant input and output trajectories.
• The quantization function is hysteretic in order to avoid illegitimate models.– Illegitimate models perform an infinite number of transitions in a finite
• Coordinators contain simulators or other coordinators.
• Coordinators control the interaction between their children. → Components on the same level do not communicate with each other, but only with their parent coordinator.
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
Atomic Models in ModelicaDEVS
• ModelicaDEVS models have one or more input ports and one output port.
• ModelicaDEVS signals/events consist of the following values:– Coefficients of Taylor series up to second order of the current function
value.– Boolean value. Indicates the creation of an event.
• Input event: uVal[1], uVal[2], uVal[3] and uEvent.• Output event: yVal[1], yVal[2], yVal[3] and yEvent.
• Components have two Boolean variables dint and dext ...– dint = true → execute internal transition.– dext = true → execute external transition.
• … and two real-valued variables lastTime and sigma.– lastTime stores the time of the last event.– sigma stores the amount of time that has to elapse before the next internal
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• A new Dymola/Modelica library implementing a number of Quantized State System (QSS) simulation algorithms has been presented. ModelicaDEVS duplicates the capabilities of PowerDEVS. The graphical user interfaces of both tools are practically identical. However, the underlying simulators are very different. Whereas PowerDEVS implements Zeigler’s hierarchical DEVS simulator, ModelicaDEVS operates on simultaneous equations and synchronous information flows.
• The embedding of ModelicaDEVS within the Dymola/ Modelica environment enables users to mix DEVS models with other modeling methodologies that are supported by Dymola and for which Dymola offers software libraries.
ETH ZürichDepartment of Computer ScienceInstitute of Computational Science
• Unfortunately, ModelicaDEVS is much less efficient in run-time performance than PowerDEVS. The loss of run-time efficiency is probably caused by Dymola’s event handling algorithms that have been designed for optimal robustness in the context of hybrid system simulation rather than run-time efficiency in the context of pure discrete-event system simulation.
• Although ModelicaDEVS offers a full implementation of a DEVS kernel and can therefore be used for the simulation of arbitrary discrete-event systems, the modeling blocks that have been made available so far in ModelicaDEVS are geared towards the simulation of continuous systems using QSS algorithms.