LECTURE 2: DISCRETE EVENT SYSTEMS I

27
LECTURE 2: DISCRETE EVENT SYSTEMS I Modeling and Simulation 2 Daniel Georgiev Winter 2015

Transcript of LECTURE 2: DISCRETE EVENT SYSTEMS I

L E C T U R E 2 : D I S C R E T E E V E N T S Y S T E M S I

M o d e l i n g a n d S i m u l a t i o n 2 D a n i e l G e o r g i e v

W i n t e r 2 0 1 5

I N P U T- O U T P U T M O D E L S

INPUT OUTPUT

SYSTEM

MODELu(t) y = h(u)

S TAT I C V S D Y N A M I C M O D E L S

SYSTEMS

STATIC DYNAMIC

TIME-VARYING TIME-INVARIANT

LINEAR NONLINEAR

CONT. STATE DISCRETE STATE

TIME-DRIVEN EVENT-DRIVEN

DETERMINISTIC STOCHASTIC

DISCRETE TIME CONT. TIME

DISCRETE EVEN

T SYSTEMS

T I M E - VA R Y I N G V S T I M E -I N VA R I A N T M O D E L S

SYSTEMS

STATIC DYNAMIC

TIME-VARYING TIME-INVARIANT

LINEAR NONLINEAR

CONT. STATE DISCRETE STATE

TIME-DRIVEN EVENT-DRIVEN

DETERMINISTIC STOCHASTIC

DISCRETE TIME CONT. TIME

DISCRETE EVEN

T SYSTEMS

D I S C R E T E V S C O N T I N U O U S S TAT E M O D E L S

SYSTEMS

STATIC DYNAMIC

TIME-VARYING TIME-INVARIANT

LINEAR NONLINEAR

CONT. STATE DISCRETE STATE

TIME-DRIVEN EVENT-DRIVEN

DETERMINISTIC STOCHASTIC

DISCRETE TIME CONT. TIME

DISCRETE EVEN

T SYSTEMS

C O N C E P T O F A S TAT E

Definition: The state of a system at time t0 is the information required at t0 such that the output y(t), for all t≥t0, is uniquely determined from this information and from u(t), t≥t0.

C O N C E P T O F A S TAT E

Definition: The state of a system at time t0 is the information required at t0 such that the output y(t), for all t≥t0, is uniquely determined from this information and from u(t), t≥t0.

In other words … If God yesterday assembled yesterday’s state of the state of the world … we would not know the difference.

T I M E - D R I V E N V S E V E N T-D R I V E N M O D E L S

SYSTEMS

STATIC DYNAMIC

TIME-VARYING TIME-INVARIANT

LINEAR NONLINEAR

CONT. STATE DISCRETE STATE

TIME-DRIVEN EVENT-DRIVEN

DETERMINISTIC STOCHASTIC

DISCRETE TIME CONT. TIME

DISCRETE EVEN

T SYSTEMS

D E T E R M I N I S T I C V S S T O C H A S T I C M O D E L S

SYSTEMS

STATIC DYNAMIC

TIME-VARYING TIME-INVARIANT

LINEAR NONLINEAR

CONT. STATE DISCRETE STATE

TIME-DRIVEN EVENT-DRIVEN

DETERMINISTIC STOCHASTIC

DISCRETE TIME CONT. TIME

DISCRETE EVEN

T SYSTEMS

D I S C R E T E E V E N T S Y S T E M S

D I S C R E T E E V E N T S Y S T E M S

D I S C R E T E E V E N T S Y S T E M S

T H R E E L AY E R S O F A B S T R A C T I O N

SYSTEMS

STATIC DYNAMIC

TIME-VARYING TIME-INVARIANT

LINEAR NONLINEAR

CONT. STATE DISCRETE STATE

TIME-DRIVEN EVENT-DRIVEN

DETERMINISTIC STOCHASTIC

DISCRETE TIME CONT. TIME

DISCRETE EVEN

T SYSTEMS

A set of events E = {e1,e2,e3,…},

LANGUAGE: e1e2e3…

TIMED LANGUAGE: (e1,t1)(e2,t2)(e3,t3)…

STOCHASTIC TIMED LANGUAGE: P(s1):(e1,t1)(e2,t2)(e3,t3)…

W H AT I S A L A N G U A G E I N D E S T H E O R Y ?

Definition: A string is a sequence of events.

Definition: A language over an event set E = {e1,e2,e3,…} is a set of finite-length strings formed from events in E.

Language operations: concatenation, prefix closure, Kleene closure, complement

R E P R E S E N T I N G L A N G U A G E S U S I N G A U T O M ATA

Example: (server repair), E = {s,c,b,r}. In a queuing system, a server may start an operation ’s’, complete an operation ‘c’, break down ‘b’, and be repaired ‘r’.

Corresponding language: The language that describes this simple process L = {(s(cs)nbr)m,n≥0,m≥0}. This language is infinite.

Corresponding automaton: Such a language has a well defined finte description.

F O R M A L D E F I N I T I O N

Definition: (Deterministic automaton) A deterministic automaton, denoted by G, is a six-tuple

Definition: (Languages generated and marked) The language generated by G is

The language marked by G is

L (A) := {s 2 E⇤ : f(q0, s) is defined}

Lm (A) := {s 2 E⇤ : f(q0, s) 2 Qm}

A = (Q,E, g, q0,�, Qm)

D E A D L O C K A N D L I V E L O C K

Definition: (Blocking) Automaton A is said to be blocking if

Example:

Lm (A) ⇢ L (A)

0

1

3

42

5

a

g

a

b

gb

g,b

a

deadlock

livelock

O P E R AT I O N S O N S I N G L E A U T O M ATA

Definition: (Accessible Part) A state is called accessible if it can be reached from the initial state.

Definition: (Coaccessible Part) A state q is called coaccessible if there is a string that goes through q before it goes through a state in Qm.

Computation of accessible and coaccessible parts is an important model checking tool.

Definition: (Complement) The complement automaton generates and marks the complement languages.

Exercise: Perform all these operations on the automaton in the previous slide.

N O N D E T E R M I N I S T I C A U T O M AT O N

Definition: (Nondeterministic automaton) A nondeterministic automaton is a sixtuple

Example:

Theorem: Any language generated by a nondeterministic automaton can be generated by a deterministic automaton.

And = (Q,E, gnd, q0,�, Qm)

1 5a

a

b

F I N I T E S TAT E A U T O M AT O N

Example: (Non-regular language) The following language cannot be generated by a finite state automaton.

Definition: (Regular language) A language is said to be regular if it can be marked by a finite-state automaton.

Theorem: The following are language operations that preserve regularity: prefix closure, Kleene closure, complement, union, concatenation, intersection.

L = {✏, ab, aabb, aaabbb, ...} = {anbn : n � 0}

R E G U L A R L A N G U A G E S

Theorem: (Regular language construction) For an event set E = {e1,e2,…en}, consider the basic languages: {},1, {ei}. Then any regular language can be constructed by repeated application of concatenation, union, and Kleene closure.

I N P U T / O U T P U T / C O N T R O L

Definition: (Controllable and Observable events) The event set can be generally divided into controllable and observable sets.

E = Ec [ Euc

E = Eo

[ Euo

SYSTEM

CONTROLLER

EoEc

C A S E S T U D Y

V O LTA G E S E N S O R ( S Y S T E M )

TA P C H A N G E R ( S Y S T E M )

G E N E R A L P L C S C H E M A

P L C A U T O M ATA M O D E L