Modelling Hybrid systems. n Hybrid (combined) Modeling Framework –Use more than one formalism –Different formalisms to specify different levels of abstraction.

Slides:



Advertisements
Similar presentations
Signals and Systems – Chapter 2
Advertisements

Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Signals and Systems March 25, Summary thus far: software engineering Focused on abstraction and modularity in software engineering. Topics: procedures,
Extended DEVSML as a Model Transformation Intermediary to Make UML Diagrams Executable Jianpeng Hu Dept. of Computer Science and Engineering Shanghai Jiao.
FIRST AND SECOND-ORDER TRANSIENT CIRCUITS
Verification of Hybrid Systems An Assessment of Current Techniques Holly Bowen.
Combining Symbolic Simulation and Interval Arithmetic for the Verification of AMS Designs Mohamed Zaki, Ghiath Al Sammane, Sofiene Tahar, Guy Bois FMCAD'07.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Petri net modeling of biological networks Claudine Chaouiya.
Introduction To System Analysis and Design
Quantized State System Simulation in Dymola/Modelica Using the DEVS Formalism Tamara Beltrame VTT, Industrial Systems PO Box 1000, VM Espoo, Finland.
Dirk Zimmer François E. Cellier Institute of Computational Science Department of Computer Science ETH Zürich A bondgraphic modeling tool and its application.
Electrical and Computer Engineering iLights Nick Wittemen, EE Chris Merola, EE José Figueroa, EE Matt Ryder, EE Comprehensive Design Review.
Modeling The quadratic integrate and fire follows from a reduced form (1) where F(V) is a voltage dependant function which aims to capture the voltage.
Models of Computation for Embedded System Design Alvise Bonivento.
DEVS and DEVS Model Dr. Feng Gu. Cellular automata with fitness.
Electric Curcuits and Measurements Basic Electrical components and their functions Measurements of electrical circuits characteristics - Multimeter - Oscilloscope.
Digital to Analog Converters
Introduction to virtual engineering László Horváth Budapest Tech John von Neumann Faculty of Informatics Institute of Intelligent Engineering.
PULSE MODULATION.
Pulse Modulation 1. Introduction In Continuous Modulation C.M. a parameter in the sinusoidal signal is proportional to m(t) In Pulse Modulation P.M. a.
Signals and Systems March 25, Summary thus far: software engineering Focused on abstraction and modularity in software engineering. Topics: procedures,
Passive components and circuits
09/16/2010© 2010 NTUST Today Course overview and information.
MESB374 System Modeling and Analysis Introduction.
Nth-order Activity of Continuous Systems a,b,c Rodrigo Castro and c Ernesto Kofman a ETH Zürich, Switzerland b University of Buenos Aires & c CIFASIS-CONICET,
DEVSView: A DEVS Visualization Tool Wilson Venhola.
1/38 Passive components and circuits - CCP Lecture 5.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
Digital Signal Processing
1 Passive components and circuits - CCP Lecture 4.
Module 2 SPECTRAL ANALYSIS OF COMMUNICATION SIGNAL.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
SOFTWARE DESIGN.
By Ezequiel Glinsky Research Assistant, University of Buenos Aires, Argentina Supervisor: Prof. Gabriel A. Wainer SCE, Carleton University Thursday, November.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
Why building models? n Cannot experience on the real system of interest n Cost n Danger n The real system does not exist Why using simulation? n Reduced.
Definition of cell-shaped spaces. CCA = n C cell’s state variables; n S finite alphabet to represent each cell’s state; n n dimensional space; n N neighboring.
Modeling with Parallel DEVS Serialization in DEVS models Select function Implicit serialization of parallel models E-DEVS: internal transition first,
Lecture 25: Implementation Complicating factors Control design without a model Implementation of control algorithms ME 431, Lecture 25.
1 Copyright  2001 Pao-Ann Hsiung SW HW Module Outline l Introduction l Unified HW/SW Representations l HW/SW Partitioning Techniques l Integrated HW/SW.
Introduction to Clock Tree Synthesis
1/8/ L16 Timing & Concurrency III Copyright Joanne DeGroat, ECE, OSU1 Timing & Concurrency III Delay Model foundations for simulation and.
Digital Control CSE 421.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
DEVS-based Modeling and Simulation References: 1.B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing.
Meghe Group of Institutions
1 Specification A broad term that means definition Used at different stages of software development for different purposes Generally, a statement of agreement.
Approach and Techniques for Building Component-based Simulation Models Bernard P. Zeigler, Ph.D. Hessam S. Sarjoughian, Ph.D. Arizona Center for Integrative.
Review n System dynamics : A sequence of state transition n model : A set of rules for state transition System S X Y Discrete event system FSM (Automata)
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
1 Roadmap SignalSystem Input Signal Output Signal characteristics Given input and system information, solve for the response Solving differential equation.
1 st semester 1436 / Modulation Continuous wave (CW) modulation AM Angle modulation FM PM Pulse Modulation Analog Pulse Modulation PAMPPMPDM Digital.
Extension du formalisme SES pour l’intégration de la hiérarchie d’abstraction et la granularité temporelle au sein de la modélisation et la simulation.
Chapter 9 CAPACITOR.
MECH 373 Instrumentation and Measurements
Introduction to Discrete-Time Control Systems fall
Chapter 4 Dynamical Behavior of Processes Homework 6 Construct an s-Function model of the interacting tank-in-series system and compare its simulation.
PULSE MODULATION.
Digital Control CSE 421.
Dynamic structure modelling for Causal Block Diagrams
Chapter 4 Dynamical Behavior of Processes Homework 6 Construct an s-Function model of the interacting tank-in-series system and compare its simulation.
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
MANE 4240 & CIVL 4240 Introduction to Finite Elements
Capacitors and Inductors
FIRST AND SECOND-ORDER TRANSIENT CIRCUITS
DC Choppers 1 MH1032/brsr/A.Y /pe/DC CHOPPERS
Chapter 14 Spatial Threshold Systems
DEVS Background DEVS = Discrete Event System Specification
Presentation transcript:

Modelling Hybrid systems

n Hybrid (combined) Modeling Framework –Use more than one formalism –Different formalisms to specify different levels of abstraction –Top-down design –step-wise refinement –Ex: FSM + Difference equation Design and Implement the following waveform generator Observation Periodic, say-tooth waveform T c : Charging time T d : Discharging time Top-Level Spec in FSM M= S = { Ch, Dis} X = { charge, discharge} Y= { 0_to_V, V_to_0} TcTc TdTd V Hybrid Systems

n Ex. Hierarchical control Operator Planning/scheduling Discrete Event Controller PID controller analog/digital Plant Command Discrete state actuationSensor Event-based control Time-based control Supervisory control Example: hierarchical control

Motivation  Opto-electrical interfaces: transmitter and receiver  Conversion of electrical current into optical impulses, and viceversa.

Motivation Continuous systems analysis:  Different mathematical formalisms  Simulation: solutions to particular problems under certain experimental conditions of interest Classical methods for continuous systems simulation  Based on numerical approximation  Require time discretization => of time  Inefficient in terms of execution times  Complex composition; difficulties in integration, multiresolution models Benefits of DEVS for continuous system M&S  Discrete event models specification: continuous time base  Execution time reduction  Complex system definition using hierarchical modular models  Easier integration with discrete-event models

GDEVS Generalization of DEVS formalism  Polynomial of any degree to represent piecewise input-output trajectories  Introduction of a new event concept: coefficient-events Advantages of GDEVS  Greater accuracy for continuous systems modeling  Unified approach to model hybrid systems Piecewise linear trajectory specification w  A a trajectory on a continuous time base finite set of instants t 0, t 1,…,t n  associated with constant pairs (a i ; b i ) such that t , w(t) = a i t + b i, and w = w *w *…*w

Discontinuities tt+ h t-ht- 2h f 1 (x,u) f 2 (x,u) t+d Event at t+d

Overview of Hybrid OO modelling. n The occurrence of events should be notified to the simulation runtime. n Time events: calendar of events is known beforehand. State events: triggered by state of simulation tt+ h t-ht- 2h f 1 (x,u) f 2 (x,u) t+d

Quantized DEVS Continuous signal represented by crossing of an equal spaced set of boundaries, separated by a quantum size Check for boundary crossing for every change in the model Outputs generated only when a crossing occurs Substantial reduction of the message updates frequency Signal Quantization

n Crossings of an equal spaced set of boundaries: quantum n Quantizer: checks for boundary crossings. n The sender computes a value, and generates outputs. n The number of messages involved is reduced. n The quantizer consumes CPU time. n The receiver will have some error, depending on q. DEVS Quantized models

0 1 Quantum size, D #messages(D) = #messages(1)/D Error = c D D tol = tolerance / c Tolerance to error Theoretical results on quantization

Q-DEVS with hysteresis n strong stability, convergence and error bound properties. n If signal changes direction: use n*Q size (proof: n=2 provides best results) n If signal keeps current direction: use Q size

QDEVS based models Uniform quantizer with hysteresis Hysteresis assures legitimate DEVS models’ simulation  Avoids infinite iterations on finite time interval

Multiple Model Controller

Adaptive Control results q=0.02q=0.2

Higher-order Approximations

Complete model n Multiple model controller allowed to operate as designed, and switch among plant identifying models n Controller was able to find it and use its parameters n Error existed only at the period coinciding w/each jump in plant parameters n Only at time 355 did a false model switch occur (due to two models having almost zero error )

Bond Graphs Suitable for multiple domains: electrical, mechanical, hydraulic, etc. Physical processes: vertices in a directed graph. Edges: represent ideal exchange of energy between components. Interactions: 0-junction (connectors), 1-junction (interactions between serial components). Causality: given a pair of elements connected through a bond, causality determine which component causes flow, which effort. SFR

Bond Graphs Formalism n Exchange of energy and information between elements of a system can be represented in a graphical form n Energy is the fundamental feature that is exchanged between elements of a system during interaction n Constrained interactions in Bond Graphs are represented by junctions –constraint equalizes the flow in the elements 1- junction –constraint equalizes the effort in the elements 0- junction

A library for Bond Graph development on DEVS Model library: modular approach to build systems; code reuse Bond Graph library built to model and simulate continuous systems on different domains Library designed using GDEVS formalism concepts  BG components developed as atomic GDEVS models of degree one  Multicomponent systems can be built as coupled DEVS components  Models implemented using the CD++ tool

 Equations: Flow arrives at component:  ext. - Calculates effort: integrate input flow data (generate Capacitor’s load). - Value computed according to the elapsed time since last transition. - Output function transmits the previously computed value yout. - Internal transition: computes next state using a polynomial approximation. GDEVS Capacitor model External transition... // time since last transition elapsedTime=msg.time().asMsecs()- time; // calculates load value c = c+a1/2*pow(elapsedTime,2)+a0*elapsedTime;... yout->updElementAtPos(1, c); yout->updElementAtPos(2, a1/2*dt + a0); holdIn( active, Time::Zero ); Internal transition // approximates load using order 1 polynomial. if ( a1 != 0 ) { // next state calculated using coefficients c = c + a1/2 * pow(dt,2) + a0*dt; a0 = a1*dt + a0; // coefficient values to send when dt elapsed yout->updElementAtPos(1,c); yout->updElementAtPos(2,a1/2*dt+a0); holdIn(active, Time(dt)); } else {passivate(); // slope is null }

BG library class hierarchy

Model execution examples Electrical Circuit Simulation Bond Graph model construction of the electrical circuit Electrical circuit Bond Graph representation

GDEVS Bond Graph model representation Electrical circuit simulation

Bond-Graph model simulation in CD++ Resistance (R 1 )=1 Inductors: L 1 = 48; L 2 = 48. Capacitance: C = 65. Conductance: R 2 = EffortSource: emits pulses; period = 2500 ms; duration = 2 ms. Pulse amplitude= 220 V Circuit current

Model execution – Comparing Quantizers Uniform quantizer vs. HQ (Quantizer with hysteresis) Test cases - Evaluation functions

Modelica n object-oriented language for modeling physical systems n designed to support library development and model exchange n Modelica supports different formalisms such as: –ODEs –finite state automata –Petri nets –discrete events –bond graphs

Creating Models in Modelica/CD++ Model circuit Modelica.Electrical.Analog.Sources.SineVoltage V(V=15,freqHz=60); Modelica.Electrical.Analog.Basic.Resistor R1(R=10); Modelica.Electrical.Analog.Basic.Ground Gnd; equation connect(V.p, R1.p); connect(R1.n, V.n); connect(R1.n, Gnd.p); end circuit1;

M/CD++ Execution Example: Modelica model model circuit Modelica.Electrical.Analog.Sources. PulseVoltage V(V=10,width=50, period=2.5); Modelica.Electrical.Analog.Basic.Resistor R1(R=0.001); Modelica.Electrical.Analog.Basic.Inductor I1(L=500); Modelica.Electrical.Analog.Basic.Inductor I2(L=2000); Modelica.Electrical.Analog.Basic.Capacitor C(C=10); Modelica.Electrical.Analog.Basic.Resistor R2(R=1000); Modelica.Electrical.Analog.Basic.Ground Gnd; equation connect(V.p, R1.p); connect(R1.n, I1.p); connect(R1.n, I2.p); connect(I2.n, C.p); connect(I2.n, R2.p); connect(C.n, I1.n); connect(R2.n, C.n); connect(I1.n, V.n); connect(V.n, Gnd.p); end circuit;

M/CD++ Execution Example: The results

Modelica/DEVSLib Model  Transmitter model  The received electrical current (continuous) is translated into optical impulses (discrete).  The driver model can include any modulation and polarization circuit. No actions performed in this case, to simplify the model.  The laser translates the electrical signal into events using the crossUP model included in DEVSLib.

Modelica/DEVSLib Model Detail of the crossUP model when (u > Value-Threshold) and x > 0 and time > 0 then e.Type := EType; e.Value := u; e.Port := 1; sendEvent(outport.queue, e); outport.event := pre(outport.event) + 1; end when;

Cell-DEVS quantization

Every cell includes a quantizer. The value produced by the local computing function is quantized. The quantized value is compared with the quantum threshold. If the threshold bound was reached, an output is provided. The output is delayed using transport or inertial delays. If the threshold was not reached, the change is not sent to other models. Quantized Cell-DEVS

(a) Heat diffusion: two-dimensional model (10x10 cells). One "hot" cell. (b) Heat model with 87% of active cells. (c) Three-dimensional extension of the previous model. (d) Three-dimensional modification of the Life game (e) Four dimensional extension of the previous model. (f) Dynamic heat seeker: a three dimensional model consisting of two adjacent planes. Experimental results

Number of messages involved

Execution times

Error behavior n e(C c, i): accumulated error up to the i-th simulation step in cell C c; n N c are the inputs of the cell c;  cj is the execution result of j-th step of the local computing function of cell c; n [ ] q represents the quantized value of the last change. n Erro’s behavior: f(x) = ax b

Error behavior

Cell-DEVS w/Dynamic Quantization n Reduce error (improving precision) in each cell. n Rationale: active cell can appear as quiescent (Q size covering activity area). Q dynamically adjusted -> smaller error. n Dynamic increase Q in cells with steep update functions: execution improved at a low cost. n Strategy 1: reduce Q if cell's update does not cross threshold (increase precision). n Strategy 2: reduce Q if threshold is crossed (2 nd chance in case of oscillations; higher precision).

Test cases: a heart tissue model n Heart muscle excitable; responds to external stimuli by contracting muscular cells. n Equations defined by Hodgkin and Huxley

A Watershed model

Flow Injection Analysis Model

Approximating the Corsica fire model