modelling hybrid systems

Download Modelling Hybrid systems

Post on 24-Jan-2016

33 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

Modelling Hybrid systems. Hybrid Systems. 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 - PowerPoint PPT Presentation

TRANSCRIPT

  • Modelling Hybrid systems

  • Hybrid (combined) Modeling FrameworkUse more than one formalismDifferent formalisms to specify different levels of abstractionTop-down designstep-wise refinementEx: FSM + Difference equation Design and Implement the following waveform generatorObservation Periodic, say-tooth waveform Tc : Charging time Td : Discharging timeTop-Level Spec in FSM M= S = { Ch, Dis} X = { charge, discharge} Y= { 0_to_V, V_to_0}TcTdVHybrid Systems

  • Ex. Hierarchical controlOperatorPlanning/schedulingDiscrete EventControllerPID controlleranalog/digitalPlantCommandDiscrete stateactuationSensor Event-based controlTime-based controlSupervisory controlExample: hierarchical control

  • MotivationOpto-electrical interfaces: transmitter and receiver Conversion of electrical current into optical impulses, and viceversa.

  • MotivationContinuous systems analysis:Different mathematical formalismsSimulation: solutions to particular problems under certain experimental conditions of interest

    Classical methods for continuous systems simulationBased on numerical approximationRequire time discretization => of timeInefficient in terms of execution timesComplex composition; difficulties in integration, multiresolution models

    Benefits of DEVS for continuous system M&SDiscrete event models specification: continuous time baseExecution time reductionComplex system definition using hierarchical modular modelsEasier integration with discrete-event models

  • GDEVSGeneralization of DEVS formalism Polynomial of any degree to represent piecewise input-output trajectoriesIntroduction of a new event concept: coefficient-events

    Advantages of GDEVSGreater accuracy for continuous systems modelingUnified approach to model hybrid systems

    Piecewise linear trajectory specificationw A a trajectory on a continuous time base finite set of instants t0, t1,,tn associated with constant pairs (ai; bi) such that t , w(t) = ai t + bi, and w = w*w**w

  • Discontinuitiestt+ht-ht-2hf1(x,u)f2(x,u)t+dEvent at t+d

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

  • Quantized DEVSContinuous 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 frequencySignal Quantization

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

    DEVS Quantized models

  • Theoretical results on quantization

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

  • QDEVS based modelsUniform quantizerUniform quantizer with hysteresis Hysteresis assures legitimate DEVS models simulationAvoids infinite iterations on finite time interval

  • Multiple Model Controller

  • Adaptive Control resultsq=0.02q=0.2

  • Higher-order Approximations

  • Complete modelMultiple model controller allowed to operate as designed, and switch among plant identifying models

    Controller was able to find it and use its parameters

    Error existed only at the period coinciding w/each jump in plant parameters

    Only at time 355 did a false model switch occur (due to two models having almost zero error )

  • Bond GraphsSuitable 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.

  • Bond Graphs FormalismExchange of energy and information between elements of a system can be represented in a graphical form

    Energy is the fundamental feature that is exchanged between elements of a system during interaction

    Constrained interactions in Bond Graphs are represented by junctionsconstraint equalizes the flow in the elements 1-junctionconstraint equalizes the effort in the elements 0-junction

  • A library for Bond Graph development on DEVSModel 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 conceptsBG components developed as atomic GDEVS models of degree oneMulticomponent systems can be built as coupled DEVS componentsModels implemented using the CD++ tool

  • Equations:

    Flow arrives at component: dext. - Calculates effort: integrate input flow data (generate Capacitors 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 modelExternal transition . . .// time since last transitionelapsedTime=msg.time().asMsecs()- time; // calculates load valuec = 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 examplesElectrical 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 (R1)=1Inductors: L1 = 48; L2 = 48.Capacitance: C = 65.Conductance: R2 = 0.001EffortSource: emits pulses; period = 2500 ms; duration = 2 ms. Pulse amplitude= 220 V Circuit current

    Grfico1

    0

    0.0005641

    0.00066635

    0.00076859

    0.00087083

    0.00097308

    0.00107532

    0.00117756

    0.00127981

    0.00138205

    0.00224583

    0.00230929

    0.00237276

    0.00243622

    0.00249968

    0.00256314

    0.0026266

    0.00269006

    0.00275353

    0.00238199

    0.00236352

    0.00234506

    0.00232659

    0.00230812

    0.00228966

    0.00227119

    0.00225272

    0.00223426

    0.00177608

    0.00173293

    0.00168979

    0.00164665

    0.0016035

    0.00156036

    0.00151722

    0.00147407

    0.00143093

    0.00110316

    0.00108928

    0.0010754

    0.00106152

    0.00104764

    0.00103376

    0.00101988

    0.00100599

    0.00099211

    0.00107651

    0.00109523

    0.00111395

    0.00113267

    0.00115139

    0.00117011

    0.00118883

    0.00120754

    0.00122626

    0.00144341

    0.00145744

    0.00147148

    0.00148551

    0.00149955

    0.00151358

    0.00152762

    0.00154166

    0.00155569

    0.00154942

    0.00153671

    0.001524

    0.0015113

    0.00149859

    0.00148589

    0.00147318

    0.00146047

    0.00144777

    0.00118398

    0.00115288

    0.00112178

    0.00109067

    0.00105957

    0.00102847

    0.00099737

    0.00096626

    0.00093516

    0.00061594

    0.00058679

    0.00055764

    0.00052849

    0.00049934

    0.0004702

    0.00044105

    0.0004119

    0.00038275

    0.00017286

    0.00015512

    0.00013737

    0.00011963

    0.00010188

    0.00008413

    0.00006639

    0.00004864

    0.0000309

    -0.00007747

    -0.00008948

    -0.0001015

    -0.00011352

    -0.00012554

    -0.00013756

    -0.00014958

    -0.0001616

    -0.00017361

    -0.00028319

    -0.00029859

    -0.00031399

    -0.0003294

    -0.0003448

    -0.0003602

    -0.0003756

    -0.00039101

    -0.00040641

    -0.00057611

    -0.00059684

    -0.00061758

    -0.00063831

    -0.00065904

    -0.00067977

    -0.0007005

    -0.00072123

    -0.00074196

    -0.00094126

    -0.00096225

    -0.00098324

    -0.00100423

    -0.00102522

    -0.00104621

    -0.0010672

    -0.00108819

    -0.00110917

    -0.0012746

    -0.00129057

    -0.00130653

    -0.00132249

    -0.00133845

    -0.00135442

    -0.00137038

    -0.00138634

    -0.0014023

    -0.00150484

    -0.00151483

    -0.00152481

    -0.0015348

    -0.00154479

    -0.00155477

    -0.00156476

    -0.00157475

    -0.00158473

    -0.00164036

    -0.0016466

    -0.00165284

    -0.00165908

    -0.00166532

    -