Professional Documents
Culture Documents
Applications
Department of Mech.Engg.
National Institute of Technology
Warangal – 506 004
Outline of the presentation
Motivation example
Modelling and control of continuous engineering
systems
Petri nets (PN)
PN modelling of manufacturing systems
Performance analysis using PN
Scheduling using PN and AI search
Summary
Motivation example
Problem Solving = Representation + Reasoning
We can represent numerals in many
different ways, 2 5
e.g. Arabic, Roman, English, Chinese,
etc. ×3 5
Which one shall we use? It depends on
the tasks.
1 2 5
For numerical analysis, we prefer the +7 5
Arabic representation. E.g. carry out a
simple multiplication 8 7 5
(twenty five times thirty five =?)
To write a check, what will we use?
Differential Equations
A powerful representation tool of continuous engineering systems
(1) Mechanical system: Mass-spring-
k y(t)
damper, m: mass, k: spring constant, b:
m u(t) friction constant, u(t): external force, y(t):
b displacement.
my ( t ) + by ( t ) + ky ( t ) = u( t )
R L
y (t ) + a1 y (t ) + a0 y (t ) = b0u (t )
x = f ( x, u )
y = g ( x) General form (State space representation)
Interesting Issues of Engineering Systems
Stability
Controllability
Observability Stable Neutral or Unstable
Optimality Marginally stable
Adaptation disturbance
Robustness
u plant x
yd + e + y
y
K1 = ff (( x
xx = x,, uu )) y=
y = gg (x
(x ))
-
-
K2
Control Methods
Adaptive control
Adaptive Control of Robot Manipulators Using a Popov
Hyperstability Approach, Journal of Systems and Control
Engineering, 1995.
Simple adaptive control
Simple adaptive control of processes with uncertain time-delay
and Affine linear structured uncertainty, Journal of Control Theory
and Application, 2001.
Robust control
Exponentially Stable Robust Control Law For Robot Manipulators,
Journal of Control Theory and Applications, 1994.
Combined adaptive and robust control
Robust Combined Adaptive and Variable Structure Adaptive
Control of Robot Manipulators, Journal of Robotica, 1998.
Iterative learning control
Model Reference Parametric Adaptive Iterative Learning Control,
15th IFAC World Congress on Automatic Control, 2002.
Representation of discrete event
systems
Man-made systems
Computer networks
Communication networks
Transportation networks
Power networks
Water networks
Manufacturing systems
Supply chains
Common features: discrete event systems
Representation approaches: various, but not unique
Finite state automata
MAXPLUS algebra
Petri nets
No standard representation (model) like differential equations for
continuous dynamic systems
PETRI NETS
A PN is a mathematical formalism and a Graph tool to model and analyze
discrete event dynamic systems. It is directed graphs with two types of nodes:
places and transitions. Places represent conditions which may be ‘held’ and
transitions represent events that may ‘occur’
place: transition:
Enabling rule:
A transition t is enabled if and only if all
the input places of the transition t t
have a token.
Initial state
Firing rule:
An enabled transition t may fire at
marking Mc. Firing a transition t will Final state
remove a token from each of its
input places and will add a token to
each of its output places. t
Graphical representation of a Petri net
P2
T2 an arc
a token 4
P1
T1 P4 P5
a place
P3
T3
2
T4
• They show:
– Communications patterns
– Control patterns
– Information flows
• There are many variants of the “basic” Petri Nets; some are
extensions, some are abbreviations
BACKGROUND
t1 or M0(p) = [1, 1, 0]
p3
p2
Petri nets: Mathematics Model
A Petri net is 5-tuple, PN=(P,T,I,O,M) where
P={p1,p2, ···, pmp} is a finite set of system states;
T={t1,t2,···, tnp} is a finite set of transitions;
I: the input (pre incidence) function;
O: output (post incidence) function;
M: the m-component marking vector whose ith component,
M(pi) is the number of tokens in the ith place. M0 is an initial
marking.
A Petri net from stage k to stage k+1 can be expressed
by the following state equation
Mk+1 = Mk + CTuk (1)
where Mk is the current marking state vector, uk is the control
vector and C=O-I is the incident matrix.
t1 p1 t2 p3 t3
Example
P={p1, p2, p3}; T={t1, t2, t3}; I(t1)={}, I(t2)={p1, p2},
I(t3)={p3}; O(t1)={p1}, O(t2)={p3}, O(t3)={p2} p2
Initial marking: M0=[1, 1, 0].
p1 p2 p3 p1 p2 p3 p1 p2 p3
t1 0 0 0 t1 1 0 0 t1 1 0 0
I = t 2 1 1 0 O = t 2 0 0 1 C = O − I = t 2 − 1 -1 1
t 3 0 0 1 t 3 0 1 0 t 3 0 1 - 1
h time
Stopping te
EXAMPLE 1
• Two billiard balls move on the same line, parallel to the long
side of the billiard table.
A B
EXAMPLE 1-a
This is a Petri Net model representing the dynamics of
the two billiard balls.
OBSERVATIONS
• This is an autonomous Petri Net:
no external synchronization; no time
– The Petri Net has four states: M0, M1, M2, and M3
M(p1) + M(p3) = 1
Ball A can be in one of two states and it is always in one of the two
states: going right or going left; the collisions are events and are
instantaneous
M(p2) + M(p4) = 1
Same for B; the number of tokens in the subnet is constant
The Petri Net is conservative: the total number of tokens in the net is
constant; this invariant contains all places
OBSERVATIONS
• From M0, the firing sequence [T1, T2, T3] causes a return to the
initial state - a loop in the reachability tree. The firing sequence
[T1, T3, T2] is also repetitive. The two sequences are different but they
contain the same transitions and the same number of firings of each.
– The state space is a discrete set: The system has a finite set of states: M0,
M1, M2, M3
– The state transition mechanism is event driven: The set of events consists
of three events
• Collision of the balls with each other - T1
• Collision of A with the table band - T2
• Collision of B with the table band - T3
(P,T,I,O)
– The Post set of T, denoted by T•, is the set of places that are output
places of T
• Given a place P
– The Post set of P, denoted by P•, is the set of transitions that are
output transitions of P
A sequence of events/actions:
e1 e2 e3
Concurrent executions:
e2 e3
e1
e4 e5
Net Structures
e3 e4
Net Structures
Synchronization
e1
Net Structures
e1
Example
• A producer-consumer system, consist of one
producer, two consumers and one storage
buffer with the following conditions:
• The storage buffer may contain at most 5 items;
• The producer sends 3 items in each production;
• At most one consumer is able to access the
storage buffer at one time;
• Each consumer removes two items when
accessing the storage buffer
A Producer-Consumer System
k=1 k=2
ready accepted
p1 p4
Storage p3
produce accept
t2 3 2 t3 t4 consume
t1
send
k=5
p2 p5
idle ready
k=1 k=2
Producer Consumers
A Producer-Consumer Example
• Reachability
• “Can we reach one particular state from
another?”
• Boundedness
• “Will a storage place overflow?”
• Liveness
• “Will the system die in a particular state?”
Example: Vending Machine
Deposit 5c
t5
Deposit 5c
s i
e po
0 cent D
De
po
sit
10
c
Deposit 10c 20 cents
10 cents
Deposit Deposit
0c 5c Deposit 5c
5c
Deposit 10c
10c 20c
Deposit 10c
Take 20c bar
Example: Vending Machine (3 Scenarios)
Scenario 1:
Deposit 5c, deposit 5c, deposit 5c, deposit 5c,
take 20c snack bar.
Scenario 2:
Deposit 10c, deposit 5c, take 15c snack bar.
Scenario 3:
Deposit5c, deposit 10c, deposit 5c, take 20c
snack bar.
Example: Vending Machine (Token Games)
Deposit Deposit
0c 5c Deposit 5c
5c
Deposit 10c
10c 20c
Deposit 10c
Take 20c bar
Recalling the Vending Machine (Token Game)
Deposit Deposit
0c 5c Deposit 5c
5c
Deposit 10c
10c 20c
Deposit 10c
Take 20c bar
A marking is a state ...
t8 p4 M0 = (1,0,0,0,0)
t4
p2 M1 = (0,1,0,0,0)
t1 M2 = (0,0,1,0,0)
M3 = (0,0,0,1,0)
p1 M4 = (0,0,0,0,1)
t3 t7
t5
Initial marking:M0
t6 p5
t2
p3
t9
Reachability
t8 p4
t4
M0 = (1,0,0,0,0)
p2
t1 M1 = (0,1,0,0,0)
M2 = (0,0,1,0,0)
p1 M3 = (0,0,0,1,0)
t3 t7
t5 M4 = (0,0,0,0,1)
p3
t6 p5 Initial marking:M0
t2
t9
t1 t3 t5 t8 t2 t6
M0 M1 M2 M3 M0 M2 M4
Reachability
A firing or occurrence sequence:
t1 t3 t5 t8 t2 t6
M0 M1 M2 M3 M0 M2 M4
p1 p2 t3 t4
p4
t2
M0 = (1,0,0,1)
M1 = (0,1,0,1)
M2 = (0,0,1,0)
M3 = (0,0,0,1)
A bounded but non-live Petri net
Another Example
p1 M0 = (1, 0, 0, 0, 0)
M1 = (0, 1, 1, 0, 0)
t1 M2 = (0, 0, 0, 1, 1)
M3 = (1, 1, 0, 0, 0)
p2 p3 M4 = (0, 2, 1, 0, 0)
t2 t3
p4 p5
t4
An unbounded but live Petri net
Analysis Methods
• Reachability Analysis:
• Reachability or coverability tree.
• State explosion problem.
• Incidence Matrix and State Equations.
• Structural Analysis
• Based on net structures.
Robot
Example
Parts Final Products
...
t5
t1 t2 t3 t4 t6 t7
M1 M2
B
Batch Plant Flowchart with 1 Reactor and 1 Blender
Synthesising and Analysis of a Batch Processing System Using Petri Nets, 1997.
Reactor.
P6
Modelling of Reactor and Blender
t6
Illustration of places and transitions
p7: Charging solvents
P7
p8: Reaction in progress to the reactor
t7
p9: Discharging reactor & charging blender
R P8 p10: Blending&testing&discharging
t8
R: Reactor available
B: Blender available
P9
t6: Start charging solvents
t7: Stop charging solvents & start reaction
t9 B
t8 : Stop reaction&start charging blender
t9: Stop charging&discharging & start blending
P10
t10: Stop discharging blender
t10
Modelling of Quality Test
Illustration of places and transitions
p12: Ready for blending
P12
p13: Logical place for rejected material
t12 p14: Blending
P13 logical place p15: Testing
p16: Testing fail & require reblending
t13
p17: Testing success & discharging blender
P14 S5
S5: Blending resource available
t14 O1: Operator available for testing
P15 O2: Operator available for discharging
O1 t16 t12: Pumping to blender finish
t15
testing P16 t13: Start blending
the final P17
product O2 t14 : Stop blending & start testing
t17 t18 emptiying the
t15: testing finish (fail)
blender
P19
t16: testing finish (success)
& start discharging blender
t17: Start reblending
t16: Discharging finish
00000001111
Reachability Graph
t'
P12
10000001110
t12
t12
P13
logical place
01000001110
t13
P14 S5 t13
t' 00100000110
t14
p" t17
P15 t14 t"
t"
O1 t16 00010001010
t15
testing P16
P17 t15 t16
the final
product O2
t17 00001001110 00000101100
emptiying the
t18 blender t18
P19
00000011110
Final Petri net model for the batch plant
P1
t6
t1
P7
P2
S1
t2 t7
R P8 P1
P3 S2
t8 t12
t3
P1 logical place
P9
S3 P4
t9 B t13
t4
P1 S5
P1
P5 S4
t14
t10
t5
P1
P6 O1 t16
t15
testing
the final P1 P1 O2
product emptiying the
t17 t18 blender
P1
Example: In a Restaurant (A Petri Net)
Waiter
Customer 1 free Customer 2
Take Take
order order
eating eating
Tell
kitchen Serve food
Serve food
Example: In a Restaurant (Two Scenarios)
Scenario 1:
Waiter takes order from customer 1; serves
customer 1; takes order from customer 2;
serves customer 2.
Scenario 2:
Waiter takes order from customer 1; takes
order from customer 2; serves customer 2;
serves customer 1.
Example: In a Restaurant (Scenario 1)
Waiter
Customer 1 free Customer 2
Take Take
order order
eating eating
Tell
kitchen Serve food
Serve food
Example: In a Restaurant (Scenario 2)
Waiter
Customer 1 free Customer 2
Take Take
order order
eating eating
Tell
kitchen Serve food
Serve food
Performance Analysis Using Timed Petri Nets
Performance evaluation of a production system provides the
ability to perceive clearly the production plan of the system. It is
used to identify the bottleneck in the production unit, estimate
the raw material required for production and decide operating
policies.
Time to charge each solvent is about 30 min.
The total time for charging four solvents into the reactor is about 120
min and this can be reflected as a delay time in place p7.
The time for reaction is 1080 min which represents the delay time in
p8.
The time for discharging the reactor/charging the blender is 60 min
which represents the delay time in p9.
The time for blending is 360 min. The time for testing and
discharging is about 180 min. The delay time in p10 represents the
sum of the blending time and the time for testing and discharging.
Performance Analysis
When the times are deterministic, we can compute the cycle time
of each circuit g:
Cg = m(g)/M(g) for g = { 1....q }
where q is the number of circuits in the model, m(g) is the sum of place
delays in the circuit g, M(g) is the sum of tokens in the circuit g
For a marked graph, the minimum cycle time, Cm is
Cm = Max { m(g)/M(g) }
To compute the result, it is important to list all the circuits
produced by this model and show the minimum cycle time of
each circuit. There are two elementary circuits in our model.
Circuit 1 C1 = 120 + 1080 + 60 =1240 min
Circuit 2 C2 = 60 + (360 + 180)=600 min
Therefore the minimum cycle time is 1240 minutes. The bottle
neck machine is in element circuit 1, i.e., the reactor.
Scheduling Approaches
• The mixed integer linear programming approach: It is similar to the
linear programming approach with linear objective function and
constraints but some of its variables are integer and others binary.
❑ The critical path scheduling approach (CPA) and the program
evaluation and review technique (PERT): Both are network based
methods.
❑ The artificial intelligence (AI) based approaches: These include
depth-first and breadth-first search approaches, Branch and Bound
search approach, best-first search approach, climb hill search
approach, beam search approach, A* (heuristic) search approach,
etc. These are called the systematic approaches.
❑ The non-systematic approaches: genetic algorithm based approach,
simulation annealing approach, etc.
❑ Rule based approaches: Copying the expertise of human
schedulers and adopting the tactics that they use.
❑ The simulation based approaches: discrete-event simulation.
Petri Net + AI Based Scheduling Methods
Scheduling:
Based on reachability tree analysis (for simple Petri nets)
Uses reduced reachability space for more complex Petri nets
Example: A 2 product & 2 processor system is used to
illustrate the method. Activities J1 J2
Problem statement: 1 S1 (3) S1 (1)
2 S2 (2) S2 (8)
t4 t8 t7 t7 t3
6 M 7 5 M 7 9 M 20
p5 p10 t8 t8 t4
M M8 M 8
8
c=13 c=11
c=14
Gantt Chart
Firing sequence: t1t2t3t4t5t6t7t8 leads to c=14 min
S1 J1 J2
S2 J1 J1
Time
3 5 6 14
S1 J2 J1
S2 J2 J1
9 11 Time
1 5
⇐
Other Types of Petri Nets
Storage accept
produce send
consume
ready
Producer
Consumer
data: ITEM
data: ITEM
ITEM produce( )
ITEM accept( )
void send(ITEM)
void consume(ITEM)
On Reachability in
Autonomous
Continuous Petri Net
Systems
Contd.....
Agenda
1.- Continuous Petri Net Systems
• Motivation
• Definition and firing rule
95
Motivation
Large discrete systems:
• manufacturing number of states
• logistic
• communication
• traffic
• State explosion
96
Fluidification
Fluidification = Drop integrality constraint in the firing.
97
Continuous Petri Nets. Firing rule
m[ p]
Enabling degree : enab(t , m) = min
p∈•t Pr e[ p,t ]
p1 p2 p1 p2
4 3 2.5 1.5
enab = 3
t let’s take α = 1.5 t
1.5 • t
p3
1 p3 2.5
m0=(4 3 1) m=(2.5 1.5 2.5)
98
Reachability
Definition : A marking m is reachable iff it can be
reached from m0 with a finite firing sequence
p1 p1
1
t1 p3 1 • t1 t1 p3
1 1
2 2
p2 t2 t3 p2 t2 t3
1
m0 p4 m1 p4
p1 0.5 • t2
m2 is a reachable marking t1 p3
2
p2 t2 t3
RS = {m| m is reachable} 1
m2 p4 0.5
99
Reachability........?
What will happen if t2 and t3 are fired
p1 further?
1 p1
t1 p3 t1 p3
1 .25
1
.5
2 2
p2 t2 t3 p2 1 t2 t3
m0 p4 m654321 p4 .25
.5
.125
In the limit m = (0 1 0 0) is
This has happened: reached
• A marking not in RS has been reached
reachability with infinite sequences reachability with finite sequences
• A trap has been emptied !!
100
Lim-reachability
Definition : A marking m is lim-reachable iff it can be
reached from m0 with a finite or infinite firing
sequence
p1 1 p1
t1 p3 t1t2t3t2t3 ....∞ t1 p3
1
2 2
p2 t2 t3 p2 1 t2 t3
m0 p4 p4
(0 1 0 0) is a lim-reachable marking
101
Reachability and Lim-
reachability
RS ⊆ lim-RS
102
δ-reachability
p1 1 p1 1-ε
t1 p3 t1 p3
1
t3 t3
p2 t2 p2 ε t2
p4 p4 1
(1 0 0 1) is ‘almost’ reachable
Computation
Idea : fire sequentially the sets of enabled transitions
FS
p1 p2 1 p3 2 Initially:
t1 t2 t3 {t2}, {t3}, {t2 , t3}
2
Firing t3:
p4 p5 p6
{t3 , t6}, {t2 , t3 , t6}
t4 t5 Firing also t2:
t6
{t2 ,t3 , t5}, {t2 , t3 , t5 , t6}
106
Sets of Fireable Transitions
p1 p2 p3 2
1 FS = {{t2}, {t3}, {t2 , t3}, {t3 , t6}, {t2 , t3 , t6},
t1 t2 t3 {t2 ,t3 , t5}, {t2 , t3 , t5 , t6}}
2
p4 p5 p6 σ
m0 m
t4 The ||σ || of every reachable marking is in FS
t5 t6
p2 1 p3 2
p5 p6
Remove them! t5 t6
Equivalent system
107
Conditions for reachability
Does m belong to RS?
• Characterization of RS
• m ∈ RS is a decidable problem
108
Reachability
Example:
Conditions
m=(0 0 0 0 1) ∈ RS? There exists σ ≥ 0 such that
1.- m = m0+Cσ ≥0
2.- ||σ|| ∈ FS
3.- There is no empty trap at m in Nσ
Two ways
• Characterization of lim-RS
• m∈ lim-RS is a decidable
problem
110
Lim-reachability
Example: Does m=(0 0 0 0 1) belong to lim-RS?
Conditions
There exists σ ≥ 0 such that
1.- m = m0+Cσ ≥0
2.- ||σ|| ∈ FS
Two ways
m = m0 + Cσ 1 m = m0 + Cσ 2
||σ 1|| ∈ FS ||σ 2|| ∈ FS
OK OK
111
Conditions for δ-reachability
p1 1
m = (1 0 0 1) is δ-reachable
t1 p3 1
σ=< t2 >
t3 m0 m
p2 t2
||σ|| is not in FS !
p4
• Characterization of δ-RS
• δ-RS = LRS No spurious solutions!
• m ∈ δ -RS is a decidable problem
112
Relationships
There exists σ ≥ 0 such that
0.5 0.5
m(p2) m(p2)
1 1
m(p3) 1 m(p3) 1
m0 m0
lim-RS δ-RS
114
Liveness and Reversibility
Def: <N, m0> is lim-(δ-)live iff for every m ∈ lim-(δ-)RS(N, m0) and
for every transition t there exists m’∈ RS (N, m) such that enab(t,m’) > 0
In continuous systems:
reversibility liveness & consistency
lim-reversibility lim-liveness & consistency
δ-reversibility δ-liveness & consistency
116
Summing up
Topic: Reachability in continuous Petri nets
Results:
Emptying sequence :
σ1 = <t1, 2/3 t2, 1/3 t5, 1/3 t6}
σ1
m0 2/3m0
σ2=2/3σ1
σ3=2/3σ2
118
Petri Nets Applications
Modelling & Performance analysis of continuous
and discrete systems
Optimisation, scheduling, planning
Simulation
PERT/CPM Studies
Transportation Engineering
Control Engineering ( Design & synthesis )
Formal verification and validation
….Many More
SUMMARY
• An introduction to Petri Nets has been presented: