petri nets for simulation/control of discrete event ... · arri formally a petri net can be defined...
TRANSCRIPT
UTA
ARRI
Petri Nets for simulation/control of Discrete Event Systems:
introduction & matrix representation.
By
Jose Mireles Jr.
ARRI
Discrete Event SystemsUTA
-The behavior is characterized by a sequence of finite or infinite states delimited by asynchronous events.
states
time
-Almost all are man made:- computer systems (operating, communication, data processing systems)- discrete production systems (manufacturing systems)
-Some continuous systems can dealt as DES if it is considered as events
- thresholds of continuous variables- the beginning and ending of the subsystem operation
Examples of Industrial Use of CP-nets http://www.daimi.au.dk/CPnets/intro/example_indu.htmlThe following projects document large-scale practical use of CP-nets and their tools. Many of the projects have been carried out in an industrial environment. For all projects one or more papers are available.
Protocols and Networks Intelligent Networks at Deutsche TelekomIEEE 802.6 Configuration Control at Telstra Research Laboratories Allocation Policies in the Fieldbus Protocol in Japan ISDN Services at Telstra Research Laboratories Protocol for an Audio/Video System at Bang & Olufsen A/S TCP Protocols at Hewlett-Packard Local Area Network at University of Las Palmas UPC Algorithms in ATM Networks at University of AarhusBRI Protocol in ISDN Networks Modelling and Analysis of Wireless Application Protocol (WAP) Internet Multimedia Communication Standards Internet Open Trading Protocol Distributed Dynamic Channel Allocation Algorithm for Mobile Computing
Software Execution Architecture of Mobile Phone Software at Nokia Feature Interaction in Mobile Phones at Nokia Bank Transactions and Interconnect Fabric at Hewlett-Packard Mutual Exclusion Algorithm at University of AarhusInternet Object Cache at the Hungarian Academy of Science Electronic Funds Transfer in the US Document Storage System at Bull AG ADA Program at Draper Laboratories
Hardware Superscalar Processor Architectures at University of Newcastle VLSI Chip in the US Arbiter Cascade at Meta Software Corp.
Control of Systems Security and Access Control Systems at Dalcotech A/S Mechatronic Systems in Cars at Peugeot-Citroën in France European Train Control System in Germany Flowmeter System at DanfossTraffic Signals in Brazil Chemical Production in Germany Model Train System at University of Kiel Educational Project with Control System for Model Railway
Military Systems Military Communications Gateway in Australia Influence Nets for the US Air Force Missile Simulator in Australia Naval Command and Control System in Canada
Other Systems Bank Courier Network at Shawmut National Coop. Nuclear Waste Management Programme in the US Actor-based Systems at University of CalabriaComputer Simulation of Biochemical Processes
ARRI
Basic concepts of PN
UTA
Token evolution A two part transition rule
- Enabled transition. The input places have at least as many tokens as the weight of the input arcs.
- Transition firing. a) Remove tokens of the input places (indicated by the
weight of the input arcs)b) Add tokens to the output places (indicated by the
weight of the output arcs)
Example:
2 2
ARRI
Formally a Petri net can be defined as follows:
UTA
PN = (P,T,I,O,Mo); where
1. P = { p1, p2,…, pm} is a finite set of places2. T = { t1, t2,…, tn} is a finite set of transitions3. I : ( P x T ) N is an input function that defines
directed arcs from places to transitions, where Nis a set of non-negative integers.
4. O : ( P x T ) N is an output function that defines directed arcs from transitions to places.
5. Mo : P N is the initial marking
For simplicity, let us work with functions Pre, a previous incidence function (explained later)Post, a posterior incidence function (explained later)
Marking vector M = [m1, m2, m3, m4,… mm]T
where mi is the number of tokens in pi.
Usually, Mo denotes the initial marking.
ARRI
UTA
∆, The transition rule:
- Enabling condition: a transition tj ∈ T is enabled iff∀pi ∈ P, M(pi) ≥ Pre(pi, tj)(current marking ≥ Pre function vector of tj).
-Firing of tj:
M(pi)k+1 = M(pi)k – Pre(pi,tj) + Post (pi,tj) ∀pi ∈ P
this expression may be rewritten as:
Mk = Mk+1 + Cvk ( PN state equation )
Where C is the incidence matrix:C = [cij] cij = Post (pi,tj) - Pre (pi,tj)vk is the firing transition vector at instant tk.
Example:
Example, for the following figure, the marking vector is M = [ 1 1 0 1 0 1 ]T
p1
p2
p3
p4
p5
p6
ARRI
UTA
p1 p2 p3t2 t3
p5 p6t4 t5
t1
p4
Marking Mo = [ 2 0 0 1 0 0]T
Pre(t1) = [ 1 0 0 1 0 0]T (only relates precedent places)
Post(t1) = [ 0 1 0 0 1 0]T (only relates posterior places)
Pre = 1 0 0 0 00 1 0 0 00 0 1 0 01 0 0 0 00 0 0 1 00 0 0 0 1
0 0 1 0 01 0 0 0 00 1 0 0 00 0 0 0 11 0 0 0 00 0 0 1 0
Post =
t1 t2 t3 t4 t5 t1 t2 t3 t4 t5
ARRI
UTA
t1 is enabled, since
200100
Mo
100100
Pre(t1)
≥
Firing sequence of t1
110010
M1
200100
Mo
= - +
100100
Pre(t1)
010010
Post(t1)
p1 p2 p3t2 t3
p5 p6t4 t5
t1
p4
Notation: M0 M1
t1
1
ARRI
Introductory examples
Two synchronized processes:
UTA
Sequence:-The wagons start moving (authorized by switch M) simultaneously to the right.-When end position is reached the wagons inverse motion.-When the initial position is detected, every wagon stops.-A new cycle starts when both wagon are stopped.
a b
L1 R1
2d
L2 R2
c
M
abcdM
L1R1
L2R2
p1 p2 p3t2 t3
p5 p6t4 t5
t1
p4
M
d
b
c
aR1
R2
L1
L2
1
ARRI
Synchronization of three processes:
UTA
Sequence:- Wagons move at different speed.- All wagons start moving at same time.- Wagons 1 and 2: The first one arriving to the right position waits for the other one to start return together.- Wagon 3: independent return.
a b
L1 R1
2d
L2 R2
c
M
L2
L1
dM
3f
L3 R3
e
D2
L3D3
D1
f
b
d
f
b
ARRI
Matrix Formulation of Discrete Event Systems.Basic concepts:
UTA
Job
Trans Fv Relates v j
xiRelates xi
Trans.Fr
Resource rj
Relates x j vi
Transition
Jobs Sv Relates
ri
xj
Transition
Releaseresource Sr
)(][)()()1( txFStmxMtmtm TT −+=+=+PN marking transition equation:
m(t) = [ ]TTc
TTT tutrtvtu )(,)(,)(,)(
],,,[ ucT
ucrT
rvT
vuT
uT FSFSFSFSFSM −−−−=−=
mFx ⊗=
)(][][)()( turvuFFFFtmFtx cucrvu ⊕=⊕=
Firing transition equation:
Next examples !!!
UTA
ARRI
pinA p1t1 t2
p3t4 t5
p2 t3
p4 t6pinB
poutA
poutB
r1
r3
r2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100001000000001000010000
vF
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
000010000100000000100001
TvS
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
000010000001
uF
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
000010100000010001
rF
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
010100000010001000
TrS
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100000010000
TyS
p1 p2 p3 p4 r1 r2 r3
p1 p2 p3 p4 r1 r2 r3
pinA pinB
poutA poutB
UTA
ARRI
pinA p1t1 t2
p3t4 t5
p2 t3
p4 t6pinB
poutA
poutB
r1
r3
r2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100001000000001000010000
x
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010000001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010100000010001
Fv
Locating firing transitions from current marking:
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
1110
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
001
⎥⎦
⎤⎢⎣
⎡00
Fr Fu
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
110100
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000000
= , x =
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
110101
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
001010
v r u
UTA
ARRI
pinA p1t1 t2
p3t4 t5
p2 t3
p4 t6pinB
poutA
poutB
r1
r3
r2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100001000000001000010000
x
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010000001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010100000010001
Fv
Conflict resolution:
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
1010
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
101
⎥⎦
⎤⎢⎣
⎡00
Fr Fu
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
100100
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
001001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000000
= , x =
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
101101
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
010010
v r u
Which one?
UTA
ARRI
pinA p1t1 t2
p3t4 t5
p2 t3
p4 t6pinB
poutA
poutB
r1
r3
r2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100001000000001000010000
x
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010000001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010100000010001
Fv
Conflict resolution, add extra matrix Fuc:
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
1010
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
101
⎥⎦
⎤⎢⎣
⎡00
Fr Fu
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
100100
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
001001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000000
= , x =
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
101101
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
010010
v r u
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
001000000100
Fuc r2
⎥⎦
⎤⎢⎣
⎡00
markingnegative!
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000000
UTA
ARRI
pinA p1t1 t2
p3t4 t5
p2 t3
p4 t6pinB
poutA
poutB
r1
r3
r2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
=
100001000000001000010000
x
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010000001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010100000010001
Fv
Conflict resolution, add extra matrix Fuc:
⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢
⎣
⎡
1010
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡
101
⎥⎦
⎤⎢⎣
⎡00
Fr Fu
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
100100
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
001001
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000000
= , x =
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
111101
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
000010
v r u
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
001000000100
Fuc r2
⎥⎦
⎤⎢⎣
⎡10
Preferenceon t2
⎥⎥⎥⎥⎥⎥⎥⎥
⎦
⎤
⎢⎢⎢⎢⎢⎢⎢⎢
⎣
⎡
010000
Preventive / Corrective Maintenance
Deadlock Problem