ece 449/549 class notes #1 introduction to system modeling concepts and devs sept. 2008

40
ECE 449/549 Class Notes #1 Introduction to System Modeling Concepts and DEVS Sept. 2008

Upload: alban-sullivan

Post on 04-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

  • ECE 449/549 Class Notes #1

    Introduction to System Modeling Concepts and DEVS

    Sept. 2008

  • Systems Specification FormalismsSystem theory distinguishes between system structure (the inner constitution of a system) and behavior (its outer manifestation).

    Fig. 1 Basic System Concepts

  • Hierarchical System Decomposition Decomposition, composition, hierarchical construction, Closure under composition Modular systems have recognized input and output ports through which all interaction with the environment occurs. They can be coupled together by coupling output ports to input ports and can have hierarchical structure in which component systems are coupled together to form larger ones.

  • Relation to Object OrientationBoth objects and system models share a concept of internal state. However, mathematical systems are formal structures that operate on a time base while programming objects typically do not have an associated temporal semantics. While coupling establishes output-to-input pathways, the systems modeler is completely free to specify how data flows along such channels. Although systems models have formal temporal and coupling features not shared by conventional objects, object-orientation does provide a supporting computational mechanism for system modeling.

  • Evolution of Systems FormalismsBasic Systems Specification Formalisms

  • System Specification Formalism:

  • Introducing the DEV&DESS Formalism

  • Combining Continuous And Discrete Formalisms Introducing Quantized System

  • Extensions of DEVS

  • DEVS as a Computational Basis for Simulation, Design and Control

  • Levels of System Knowledge George Klirs [Klir 1985] systems framework.

  • Hierarchy of Systems Specifications

  • Input / output system

  • The Specification Levels Informally Presented 1. Observation Frame (Level 0)A forest specified as a system in the Observation Frame (Level 0)

  • I/O Behavior and I/O Function Some Input-Output Pairs for the Forest System Frame (Level 1 & 2)

  • State Transition System Specification(Level 3)

  • Coupled Component System Specification Component Structure System Specification for the Forrest System (Level 4)

  • System Specification Morphisms: Basic Concepts Morphism Concepts for System Specification Hierarchy A morphism is a relation that places elements of system descriptions into correspondence.

    morphic, if we can place their defining elements - inputs, outputs, and time bases into correspondence

  • Morphism relations between systems in System Specification Hierarchy and Klirs levels.

  • Homomorphism Concept. This figure illustrates the preservation of state transitions that a homomorphism requires.

    Homomorphism: a mapping preserving step-by-step state transition and output

    Homomorphism

  • Source SystemSimulatorModelExperimental FrameSimulationRelationModelingRelationbehavior databaseBasic Entities and Relations in Modeling and Simulation

  • DEVS FormalismDEVS = Discrete Event Systems Specification

    Atomic ModelsCoupled ModelsHierarchical Models

  • XSYy0et0t1t2Discrete Event Time Segments

  • DEVS Atomic Modelinput eventsoutput eventsstate variables state transition functionsoutput functiontime advance functionElements of an atomic model:

  • Atomic Model OperationPorts are represented explicitly there can be any number of input and output ports on which values can be received and sent

    The time advance function determines the maximum lifetime in a state

    A bag can contain many elements with possibly multiple occurrences of its elements.

    Atomic DEVS models can handle bags of inputs and outputs.

    The external transition function handles inputs of bags by causing an immediate state change, which also may modify the time advance.

    The output function can generate a bag of outputs when the time advance has expired.

    The internal transition function is activated immediately after the output function causing an immediate state change, which also may modify the time advance.

    The confluent transition function decides the next state in cases of collision between external and internal events.

  • DEVS = X : a set of input events.Y : a set of output events. S : a set of states ta : S -> R+0,inf time advance function dint :S -> S internal transition function. d ext :Q x Xb -> S external transition function, d con :Q x Xb -> S confluent transition function, where Xb is a set of bags over elements in X. Q= {(s,e)|se S, 0
  • DEVS Atomic Model Implements Basic DEVSStateoutputexternal internaltime advanceMake a transition(external)

    Make a transition(internal)

    Handle inputSend an outputHold for some timeinputoutput

  • Internal Transition /Output Generation using theinternaltransitionfunction

    using theoutputfunction

  • Time advanceResponse to External Input elapsedtime using theexternaltransitionfunction

  • Time advanceResponse to Simultaneous External Input and Internal Eventelapsedtime using theconfluenttransitionfunction

  • Atomic Model ExamplesInput Firing delay >0Output Fire-once Neuron

    PulseGenerator

    pulsetimestartinterPulseTime >0Output Pulse Generatorexternal eventInternal eventoutput eventta = ta = ta =

  • Basic DEVS: Example Scuba Model=dint (five) for phase != five ,surface1, surface2dint (five,s ) otherwise //except when already on five

  • DEVS Hierarchical Modular CompositionAtomic: lowest level model, contains structural dynamics -- model level modularity+ coupling Coupled: composed of one or more atomic and/or coupled modelshierarchical construction

  • DEVSENTITYCONTAINERATOMICCOUPLEDdevsentityObject Oriented DEVS CLASSESMESSAGEcontentport, value -> ENTITY

  • void proc::deltext(timetype e,message * x) { Continue(); if (phase_is("passive")) for (int i=0; i< x->get_length();i++) if (message_on_port(x,"in",i)) { job = x->get_val_on_port("in",i); hold_in("busy",processing_time); }}

    message * proc::out( ){ if (phase_is("busy")) message * m = new message(); entity *val = job; m->add(make_content("out",val);); return m;}

    void proc::deltint( ){ passivate();}external transition functioninternal transition functionoutput functionsjobphasexysinoutATOMIC

  • DN = < X ,Y,D,{Mi },{Ii },{Zi,j }>

    X : a set of input events.Y : a set of output events.D : an index set for the components of the coupled model.For each i e D , Mi is a component DEVS model.For each i e D u self , Ii is the set of influencees of i . For each j e D u self , Zi,j is output translation mapping

    Coupled model specification:

  • DIGRAPH

  • Every Devs Coupled model has a Devs Basic equivalentClosure Under Coupling

  • Hierarchical Construction

  • EFAEFA-DECGENRCOORDEFEFA-DECTRANSDARCHARCH-SPECMULTMULT-DECPROCSYSTEM ENTITY STRUCTURE

  • Simulation Cycle for DEVS Parallel /ConfluentCompute the global next event time, tN: use reduce to get minimum of component times to next event (tN)Tell all components the global tN and if component is imminent (tN == global tN ), then generate output message(using l) Sort and distribute (using coupling) output messages. Tell all components if component is imminent (tN == global tN ) or has incoming mail (external events) or both then execute transition function (wrap_deltfunc).

  • Simulation Cycle Step 1Compute the next event time (tN) : uses reduction to get minimum of the component times to next event.compute tNreturn MIN tNCollection of Minimum tN ValuesLow NodeHigh Nodei+ 8ii+ 11

  • Simulation Cycle Step 2compute_IOLow NodeHigh Nodei+ 8+ 2i+ 3i+ 4i+ 5i+ 6ii+ 9ii+ 11+ 10iTell all components global tN: if component is imminent generate and sort output messages

  • Mail Exchange in Step3

    tell all imminents,sort, and distribute output messages (mail) using coupling

  • Simulation Cycle Step 4wrap_deltfuncLow NodeHigh Nodei+ 8+ 2i+ 3i+ 4i+ 5i+ 6ii+ 9ii+ 11+ 10iTell all components with to execute their transition functions.