Upload
phungphuc
View
228
Download
1
Embed Size (px)
Citation preview
' $
UNIVERSITY OF MICHIGANDEPARTMENT OF ELECTRICAL ENGINEERING AND
COMPUTER SCIENCELECTURE NOTES FOR EECS 661
CHAPTER 1: INTRODUCTION TO DISCRETE EVENTSYSTEMS
Stephane Lafortune
August 2006
& %
' $EECS 661 - Chapter 1
References for Chapter 1: Textbook, Chapter 1: Section 1.3
Discrete Event Systems
A Multidisciplinary Area:
Systems & Control
DES
OperationsResearch
ComputerScience
What:
• Discrete State Space (logical, symbolic variables)
• Event-driven Dynamics
Why:
• Technological Systems, Computer Control
−→ Large, Complex Systems: they need to be analyzed, diagnosed, controlled, and optimized
S. Lafortune - Last revision: August 2006 1& %
' $EECS 661 - Chapter 1
Where:
• Inherently Discrete Systems:
computer systems, communication networks, automated manufacturing systems (cell and
factory levels), software systems.
• Systems with Continuous and Discrete Variables (hybrid systems), modeled as DES at a
certain level of abstraction, e.g., for the higher level control logic:
automated manufacturing systems (machine and cell levels), process control,
transportation systems.
• Embedded systems ; networked systems.
How:
• Mathematical Modeling, Analysis, Verification, Diagnosis, Controller Design,
Optimization, Simulation
S. Lafortune - Last revision: August 2006 2& %
' $EECS 661 - Chapter 1
Conceptual Control
System Architecture:
COORDINATION
REAL-TIME
CONTROLDIAGNOSTICS
FAILURERECOVERY
SUPERVISORY CONTROLLER
INTERFACE
EQUIPMENT
CONTROLLERSCONTROLLER
SYSTEM
Commands Observable events
S. Lafortune - Last revision: August 2006 3& %
' $EECS 661 - Chapter 1
Some Examples
The Heating System of a Heating, Ventilation, and Air Conditioning (HVAC)
Unit
FAN HTG. COIL
PUMP
BOILERCONTROLLER
VALVE
• The operation of the unit is monitored by a set of sensors.
• The issue of interest: Fault Diagnosis.
• Specifically: diagnose occurrence of “sharp” faults during the on-line operation of the unit.
• Examples of faults: stuck failures of valves, on-off failures of pumps, controllers, sensors,
etc.
• Implementation: diagnostics module in the control logic.
S. Lafortune - Last revision: August 2006 4& %
' $EECS 661 - Chapter 1
Models
of the Components of
the HVAC System:
L1
BOFF
B2
BON
FON S P I OV PON BON
BOFF POFF
S P D
CV
S P IS P D
FOFF
C1 C2 C3 C4 C5 C6
C7C8C9C10
CONTROLLER
FOFF
F1 F2
FON
PON
POFF SO1
CV, OV
OV
SC1 SC2
SO2
CV
L2
S P I
PUMP VALVE
FAN BOILER
LOAD
P1 P2POFF PONV3
V1 V2
V4
CV, OV
CV OVL0
FOFF FON
B1
BOFF BON
S P I
FOFF FOFF
S P D
S P D
C21
CFOFF
FONSPD
FOFF
FOFF
SPISPI SPDC22
C23
C24
SPIOV PON BON
OV PON BONSPD
SPISPD
CFON
C16
FONC13
C12C11
C20 C19 C17
C15
C18
C14
S. Lafortune - Last revision: August 2006 5& %
' $EECS 661 - Chapter 1
Part of the Diagnoser
for the Heating System
(HVAC Unit)
F 1: SO
F 2: SC
F 3: CFON
F 4: CFOFF
7 N 8 F1 9 F237 F3 38 F1 F3 39 F2 F3
85 F4 86 F1 F4 87 F2 F4
10 N 11 F1 12 F2 40 F3 41 F1 F3 42 F2 F3
13 N 14 F1 43 F3 44 F1 F3
16 N 17 F1 46 F3 47 F1 F3
19 N 20 F1 58 F3 59 F1 F3
22 N
25 N 27 F2
28 N 29 F1 30 F2
1 N 2 F1 3 F2 7 N 8 F1 9 F2
10 N 11 F1 12 F2
13 N 14 F1
16 N 17 F1
19 N 20 F1
55 F3 56 F1 F3
67 F3 68 F1 F3
70 F3 71 F1 F3
73 F3 74 F1 F3
76 F3 77 F1 F3
46 F3 47 F1 F3
64 F3 65 F1 F3
61 F3 62 F1 F3
58 F3 59 F1 F3
4 N 5 F1 6 F234 F3 35 F1 F3 36 F2 F3
82 F4 83 F1 F4 84 F2 F4
28 N 29 F1 30 F249 F3 50 F1 F3 51 F2 F3
88 F4 89 F1 F4 90 F2 F4
52 F3 53 F1 F3 54 F2 F3
1 N
1 N 2 F1 3 F2
79 F4 80 F1 F4 81 F2 F4
57 F2 F3
< FON, NF >
< SPI, NF >
< SPD, NF >< OV, NF >
< PON, F >
< BON, F >
< POFF, NF >
< CV, N F >
< SPD, F >
< BOFF, NF >
< FOFF, NF >< SPI, NF >
< OV, NF >
< PON, F >
< BON, F >
< SPD, F >
< CV, N F >
< OV, NF >
< PON, F >
< BON, F >
< PON, F >
< BON, F >
< SPD, F >
< OV, F >
< PON, F >
< BON, F >
< BON, NF >
< SPI, NF >
< OV, NF >
< PON, NF >
< BON, NF >
< SPD, NF >
< OV, NF >
< PON, NF >
< BON, NF >
< FON, NF >
< FOFF, NF >
< FON, NF >
< SPI, F >
< OV, F >
< PON, NF >
69 F2 F3
72 F2 F3
48 F2 F3
75 F2 F3
78 F2 F3
66 F2 F3
63 F2 F3
60 F2 F3
A
B
C
D
E
S. Lafortune - Last revision: August 2006 6& %
' $EECS 661 - Chapter 1
A “Small” Telephone System
1 2
0
1 2
0
• The network has screening, forwarding, and multi-way calling capabilities.
• The issue of interest: Feature Interactions.
• Specifically: detection and resolution of logical conflicts (interactions) between options
(features).
• Implementation: correct design of the (modular) software programs that run at the
switches.
S. Lafortune - Last revision: August 2006 7& %
' $EECS 661 - Chapter 1
Model of User 0 in a Telephone System:
req01
offh0onh0
fh0
req02
nocon02con02
nocon01con01
req00
nocon00
fwd012
req01req00 req02
fwd010
fwd001
REQ_0 REQ_1 REQ_2
FWD_TO_2FWD_TO_1FWD_TO_0
CON
INIT
fwd002 fwd020 fwd021
dfh0
nocon0
nocon0 nocon0
Model of User 1 at Switch 0 in Telephone
System:
INIT
NOT_REQ
REQ
fh1
req10
con10
nocon10
fwd101
fwd102
onh1 offh1
dfh1
S. Lafortune - Last revision: August 2006 8& %
' $EECS 661 - Chapter 1
A Control Architecture for
Approaching this
Problem:
G0C 0
.
.
.
TCSS
OCSS
SPOTS-4
.
.
.
.
.
.
...
G
S. Lafortune - Last revision: August 2006 9& %
' $EECS 661 - Chapter 1
Other examples:
Railway Connections and Time Tables1
• The network of railway connections is closed and each line has a fixed number of trains.
The inter-station travel times are known and deterministic.
• The objective is to design “satisfactory” time tables for the trains.
• Specifications include: certain trains have to wait for one another to allow change overs.
• Constraints: want system to operate fast, but also want perturbations to completely
disappear in finite time.
• Issues of interest: how do perturbations to the time table propagate, what limits the
minimum operation time, where would it be helpful to add trains, etc.
• Approach: write equations for the departure times of the trains, using “maximum” and
“addition.”
1Example due to G. J. Olsder
S. Lafortune - Last revision: August 2006 10& %
' $EECS 661 - Chapter 1
Dispatching Control in an Elevator System2
• Events: hall call, car call, car arrives at floor i, etc.
• States: position of car k, number of passengers waiting at floor i, etc. (very large state
space!)
• Control problem: which car to send where so as to achieve “satisfactory”
performance?
• Performance measures: average waiting time (until car comes), average service time (until
car delivers to desired floor), fraction of passengers waiting more (on average) than one
minute, etc.
• Probabilistic formulation: passenger arrival rates at floors, probability distribution for
destination floors, load times and travel times, etc.
• Common solution: threshold-based control, i.e., hold a car until a threshold is reached.
→ The issue is then to determine this threshold and “automatically” adjust it in
real-time, based on observed passenger arrival rates.
2Example due to C. Cassandras
S. Lafortune - Last revision: August 2006 11& %
' $EECS 661 - Chapter 1
The Three Levels of Abstraction in Modeling DES
Sample Paths of Discrete Event Systems
x(t)
t
e
t t t t t t t
e e e e e e e
x
x
x
x
x
x
7654321
7654321
1
2
3
4
5
6
Describe this sample path by the timed sequence of events that it contains:
ste = (e1, t1)(e2, t2)(e3, t3)(e4, t4)(e5, t5)(e6, t6)(e7, t7)
S. Lafortune - Last revision: August 2006 14& %
' $EECS 661 - Chapter 1
The behavior of a given DES is described as follows:
• Timed Language: set of all timed sequences of events that the DES can
generate/execute
• Stochastic Timed Language: a timed language with a probability distribution
function defined over it
• Language: a timed language where the timing information has been deleted, i.e., it is a
set of sequences, or traces, of events.
se = e1e2e3e4e5e6e7
Formal language theory:
– Finite set of events E : {e1, e2, . . . , en}
– Set of all finite strings of event in E: E∗ - Kleene-closure
– A language L is a subset of E∗: L ⊆ E∗
S. Lafortune - Last revision: August 2006 15& %
' $EECS 661 - Chapter 1
This leads to the three complemetary levels of abstraction at which DES are studied.
• Logical level: the language model is used to study properties that concern event
ordering only; e.g., consider the telephone system example, as well as the HVAC unit
example (diagnosis).
Priorities, mutual exclusion, deadlock, livelock, occurrence of unobservable events, etc.
• Temporal level: the timed language model is used to study properties that concern the
timing of the events; e.g., consider the railway network example.
Deadlines, cycle times, effect of perturbations, etc.
• Stochastic level: the stochastic timed language model is used to study properties that
concern the expected behavior of the system under the given statistical information; e.g.,
consider the elevator example.
Average delay, throughput, and other relevant performance measures.
N.B.: Discrete Event Simulation usually refers to the stochastic level.
Question: How to represent [(stochastic) timed] languages?
S. Lafortune - Last revision: August 2006 16& %
' $EECS 661 - Chapter 1
Discrete Event Modeling Formalisms
• Formal classes of models that represent [(stochastic) timed] languages
• “State-based” formalisms: define a state space and specify the state transition structure
(i.e., (out state, event, in state) triples) that represents the language.
Automata (or State Machines) and Petri Nets are widely used.
• “Trace-based” formalisms: use (recursive) algebraic equations on the events to represent
the traces in the language (i.e., no explicit “state”). Often referred to as Process Algebras.
Communicating Sequential Processes (CSP) is a well-know formalism in this category.
• We will study:
– (untimed and timed) automata [modeling, analysis, diagnosis, supervisory control]
– (untimed and timed) Petri nets [modeling, analysis, some control]
– timed event graphs, a special case of timed Petri nets [analysis using max-plus
algebra]
→ We illustrate the above modeling formalisms for the (familiar) example of the dining
philosophers.
S. Lafortune - Last revision: August 2006 17& %
' $EECS 661 - Chapter 1
Automata models of two philosophers (P 1, P 2) and two forks (F 1, F 2)
P1 P2
F1 F2
1E
1f2
1f2 1f1
1f
2I12f1 2f2
2f2 2f1
1f1,2f1
1f,2f
1f2,2f2
1f,2f
1f1
1I2
1I1
1U 2U
2I2
2E2f
1A
1T 2T
2A
S. Lafortune - Last revision: August 2006 18& %
' $EECS 661 - Chapter 1
Composition of the four automata: P 1||P 2||F 1||F 2
2f22f
1f
1f2
1f1
1f2
1f2
2f2
1f1
2f1
1f1
(1I2,2I1,1U,2U)
(1I1,2I2,1U,2U)
(1T,2E,1U,2U)
2f1
2f2
2f1(1E,2T,1U,2U)
(1T,2T,1A,2A)
S. Lafortune - Last revision: August 2006 19& %
' $EECS 661 - Chapter 1
Petri net model of one philosopher and two forks
holding fork 1
fork 2 available
fork 1 available
eating
if1 if2
if
if2 if1
holding fork 2
thinking
S. Lafortune - Last revision: August 2006 20& %
' $EECS 661 - Chapter 1
Petri net model of two philosophers and two forks
fork 1 availablephilosopher 1 philosopher 2
1f1 1f2
1f
1f2 1f1
2f12f2
2f
2f22f1
fork 2 available
S. Lafortune - Last revision: August 2006 21& %
' $EECS 661 - Chapter 1
Recursive equation model of two philosophers and two forks
P 1 = (1f1 → 1f2 → E1 | 1f2 → 1f1 → E1)
E1 = (1f → P 1)
P 2 = (2f1 → 2f2 → E2 | 2f2 → 2f1 → E2)
E2 = (2f → P 2)
F 1 = (1f1 → 1f → F 1 | 2f1 → 2f → F 1)
F 2 = (1f2 → 1f → F 2 | 2f2 → 2f → F 2)
SY STEM = P 1||P 2||F 1||F 2
In general, we get a set of equations of the form:
X = f(X)
Y = g(X)
where X is a vector of processes and f must contain →.
S. Lafortune - Last revision: August 2006 22& %
' $EECS 661 - Chapter 1
How to Compare Modeling Formalisms?
Descriptive Power: Language complexity or class of languages that a (finite) model can
represent.
• Finite-state automata: Regular Languages R
• Labeled Petri Nets: PNL ⊃ R.
Algebraic Structure: Formal operations that permit to build complex systems by
interconnecting simple systems and that allow to “manipulate” a model for analysis and
synthesis purposes.
• R has nice properties: closed under union, concatenation, intersection, parallel
composition, complementation w.r.t. E∗.
These operations can be “implemented” using finite-state automata.
• PNL does not enjoy such nice properties.
However, Petri nets have intrinsically modular structure: e.g., system decomposition
by means of place-bordered Petri nets.
S. Lafortune - Last revision: August 2006 23& %