Download presentation
Presentation is loading. Please wait.
Published byJerome Riley Modified over 9 years ago
2
Review
3
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) Digital system Differential equation Continuous system Difference equation Discrete Time System(sampled-data circuit) DiscreteDiscrete ContinuousContinuous ContinuousDiscrete S T System dynamics paradigms
4
Simulator: Event Processor DEVS: discrete event System DEVS model time to next event, state at next event... DTSS: difference equation Simulator: Recursive Algorithm System DTSS model: q(t+1) = a*q(t)+ b*x(t) DESS: differential equation System Specification: System Simulator: Numerical Integrator DESS model: dq/dt = a*q +bx Dynamic Systems representations
5
Systems theoretical modelling n Behavioral models: ‘Black boxes’. Define input/output behavior. Representation of observable and non-observable variables. n Structural models: ‘White boxes’. Represent system structure. Decomposition and coupling. Refers to elements in a model as opposed to the behavior it generates. n Different formalisms derived from these ideas.
6
Component: viewed as a model with inputs and outputs. It has internal structure which dictates how inputs/states are transformed to outputs. states functions INTERNAL STRUCTURE inputsoutputs Components are coupled together to create models which themselves can be components in larger models Component definition
7
n To capture system’s dynamics, we need to represent states and how they change over time, autonomously and in response to external events: Inputs States Outputs Time it takes for an activity to be completed Internal Dynamics Component system dynamics
8
FSM = X : input set Y : output set S : state set , : functions with the following constrains –X, Y, S : finite sets – : X * S S – : S Y : Moore machine : X * S Y : Mealy machine S x y * Untimed discrete event system Finite State Machines
9
n Banking-system (Queue+Server) Queue in Server out (1) Conceptual Model components descriptive variables - c.f) state variables dependency: interaction between components (i) Descriptive variable - Queue length: [0... N] ‘queue.length = n’ n customers in the waiting line - Tellers’s status: [Busy, Free] (ii) Interaction with outside world When a customer arrives: System puts it in the queue Serve customer (in some specified time) Send customer out Example : FSM modeling
10
(2) Formal model specification: M = From informal description, the following should be specified (i) Identify X, Y, S (ii) State transition (iii) Output function (3) Case I : state : Queue length M = X = {in} Y = {out} S = {queue.length in [0, N]} : X * S S (in, n) = n+1 for all n<N (Notice there is no out in transition function!) : S Y (n 0) = out Problem : Queue.length never decreases solution : introduce a feedback to notify that a customer is leaving 012n in out FSM formal definition
11
M = X = {in, done} Y = {out} done = out S = {queue.length in [0,N]} : X * S S (in, n) = n+1 for all 0 n <N (done, n) = n-1 for all 0 < n N : S Y (n 0) = out Queuein out * Feedback * 012N in out done ‘done’ is introduced by feedback Modified formal definition: queue done
12
Case II : state : Server state M = X = {in, done} Y = {out} done= out S = server.status in [B,F] : X * S S (in, B) = B (in, F) = B (done, B) = B if queue.length > 1 F if queue.length <= 1 (done, F) = N/A : S Y (S=B) = out B F in done (|q| 1) in done (|q|>1) Formal definition: server out Queue in Server out * Feedback * done in done out
13
: X * S S S = {(queue.length, Server.status) | queue.length is in [0.. N] and Server.status {B, F}} in done Server.status B F queue.length1230NN-1N-2N-3 out : undefined state CFSM. State set: server + queue
14
player_A = player_B = n X A = {Ball_B} n Y A = {Ball_A} n S A = {A_A, A_D} A, A : exercise n X B = {Ball_A} n Y B = {Ball_B} n S B = {B_A, B_D} B, B : exercise A_DA_A Ball_BBall_A Ball_B player_A B_DB_A Ball_A Ball_B Ball_A player_B Ex. Synchronous Machine of ping-pong players
15
A_DA_A Ball_A Ball_B player_A B_DB_A Ball_B Ball_A player_B Ball_A Ball_B A_A, B_DA_D, B_A Ball_A Ball_B CFSM Player_A : X S S X A = {Ball_A} { } : internal event A_AA_D /Ball_A A_AA_D Ball_A feedback CFMS for the ping-pong example A_AA_D Ball_B Ball_A Ball_B
16
Introduction to Petri Nets Bipartite graph: Two types of nodes: Places and Transitions. Links connecting nodes. Two basic concepts in PN modeling –Events (Transitions) – actions to be taken place by states of a system each event associated with pre-/post-condition –Conditions (Places) – predicates or logical expression of states of a system pre- and post-condition
17
Petri Nets (cont.) n Places: model system states. n Transitions: model events n Legal/illegal connections in the graph Legal connectionIllegal connection
18
Formal specification of PN PN = P ; a finite set of places T ; a finite set of transitions I : T P ; input function (ex: I(t i ) = {p 1, p 1, p 2 } ) O : T P ; output function (ex: O(t j ) = {p 2, p 3 } ) n Input / Output places p i I(t j )=>p i is an input place of t j p l O(t m )=>p l is an output place of t m
19
Example –PN = P = {p 1, p 2, p 3 } T = {t 1, t 2 } I(t 1 ) = {p 1, p 2, p 3 ) O(t 1 ) = {p 2, p 3, p 3 } I(t 2 ) = {p 3 } O(t 2 ) = {p 1, p 1 } p1p1 p2p2 p3p3 t2t2 t1t1
20
Petri nets execution n Dynamic properties analysis n New entity: token n Marked Petri net n Transition firing: enabled transition (instantaneous) n Simultaneously activated transitions: non-deterministic firing
21
–[ Notation ] # of inputs from P i to t j : #(P i, I(t j )) # of outputs from t j to P i : #(P i, O(t j )) Ex)#(P 5, I(t 2 )) = 1 #(P 2, O(t 2 )) = 0 #(P 2, I(t 2 )) = 2 n State representation : Marked PN –Formalism MPN = : marking function : P N (Positive Integer) or defined as a vector ( 1, 2,..., |P| ) Ex) Marking = (P 1 ) = (P 4 ) = 0 (P 2 ) = (P 3 ) = 1 (P 5 ) = 3 t1t1 t2t2 t3t3 t4t4 Petri nets execution P1 P2 P3 P4 P5
22
Fire t j tjtj tjtj EnableNot Enable = (2, 1, 3, 0) = (2, 0, 1, 2) (p) ’(p)= (p) (p) ’(p)= (p) (p) ’(p)= (p)+1 (p) ’(p)= (p)-1 (p) ’(p)= (p)-2 (p) ’(p)= (p)+1 Petri Net Dynamics (Example)
23
Modeling Example: A Simple Computer System p1p1 t1t1 p2p2 p4p4 t2t2 t3t3 p3p3 t4t4 [1,0,0,0] [1,1,0,0] [1,2,0,0][0,0,1,0] t1t1 t1t1 t2t2 [0,1,1,0][1,0,0,1] t1t1 t3t3 … …… (user req.) (CPU start) (CPU end) (CPU ans.)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.