You are on page 1of 122

- Introduction &

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.
my ( t ) + by ( t ) + ky ( t ) = u( t )
R L

(2) Electrical system: RLC circuit


y(t)
u(t)
C
LCy ( t ) + RCy ( t ) + y( t ) = u( t )

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

an arc’s weight a transition


PETRI NETS
• Petri Nets give a graph-theoretic representation of the
structure and the dynamics of a discrete event system.

• They show:
– Communications patterns
– Control patterns
– Information flows

• They provide a mathematical framework for:


– Analysis
– Validation
– Performance evaluation

• They focus on issues of


– Concurrency
– Asynchronous operations
CHARACTERISTICS

• Petri Nets are executable

• The graphical nature of the Petri Nets allows the


visualization of the complexity of the system

• Petri Nets capture the precedence relations and structural


interactions of concurrent and asynchronous events

• Petri Nets subsume many other discrete event dynamical


system models

• There are many variants of the “basic” Petri Nets; some are
extensions, some are abbreviations
BACKGROUND

• Carl Adam Petri’s PhD dissertation “Kommunikation mit


Automaten, University of Darmstadt, Germany, 1962

• Major extensions at MIT in the early 70’s - Project MAC at


the Laboratory for Computer Science

• From 1980 on, the annual European Workshop on


Applications and Theory of Petri Nets has been the forum
for the presentation of many results. Selected papers were
published in the Springer Verlag series Lecture Notes in
Computer Science.

• In the 90s, Petri Nets started having wide adoption, first by


the Flexible Manufacturing Systems community and now in
a wide variety of applications.
PETRI NETS

• Petri Nets are bipartite directed multi graphs

– Bipartite: two types of nodes

» Circle node or place


» Bar node or transition

– Directed: the arcs that join two nodes are directed.

» Arcs can connect places to transitions and


transitions to places only
t1
p1 p2
TRANSITIONS AND PLACES
• A transition stands for: • Input places stand for:
– Processor – Buffers
– Event – Pre-conditions
– Computation step or algorithm – Input data
– Task or job – Resources needed
– Clause in logic – Conditions
– Signal processor – Input signals

• Output places stand for:


– Buffers
– Post-conditions
– Output data
– Resources freed
– Conclusions
– Output signals
ARCS

• An arc from a place to a transition means that

– The process needs the resource in the buffer


– The event has this precondition in order to occur
– The algorithm requires the input data
– The task needs this resource
– This is a condition for the logic clause

• An arc from a transition to a place means that

– The process generates a resource in the output buffer


– The event generates this condition when it occurs
– The algorithm generates the output data
– The task produces this resource
– This is a conclusion of the logic clause
MARKINGS

A marked PN contains tokens

• Tokens are depicted graphically by dots ( • )


and reside in places

• A marking of a PN is a mapping that assigns a non negative


integer ( the number of tokens ) to each place of the net

• The marking characterizes the state of the Petri Net


MARKINGS
• Tokens are indistinguishable

• The existence of one or more tokens represents the availability


of the resource or the fulfillment of the condition, while the
absence of of tokens indicates that the condition is not
satisfied or the resource is unavailable.

• The places and the marking capture the distributed nature of


the system.

• The marking can be represented by a token.

p1 p3 M(p1) = 1 M(p2) = 1 M(p3) = 0

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 

Using the firing rule , we have


M1=M0+etC=[1, 1, 0]+[0, 1, 0]C=[0, 0, 1]
where et is the characteristic vector of t: et(x):=1 if x=t, else =0.
Petri Nets: Time Information
 The concept of time is not explicitly given in the original definition
of PNs. For performance analysis and scheduling problems, it is
necessary and useful to introduce time delays associated with
transitions or places in their PN models.

A timed Petri net TPN=(PN,h):
 PN is a normal Petri net defined as the before;
 h: the time delay associated with the relevant state.
machine product in
available position
machine product in Pm Pr
available position
Pm Pr
Starting tb
Timed
Timed place
Processing in Po(h)
transition Processing in t(h)
h time

h time
Stopping te
EXAMPLE 1

• Two billiard balls move on the same line, parallel to the long
side of the billiard table.

• Initially, they move against each other at the same speed.

• A collision is an event; the collision is perfectly elastic.

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 set of reachable markings from M0 is


– M0 = [1, 1, 0, 0]
– M1 = [0, 0, 1, 1]
– M2 = [1, 0, 0, 1]
– M3 = [0, 1, 1, 0]

– The Petri Net has four states: M0, M1, M2, and M3

• The Petri Net is bounded; the number of possible tokens in


every place is bounded.

• The Petri Net is safe, i.e., the marking of each place is


Boolean: 0 or 1
OBSERVATIONS
• The Petri Net is live:

No transition will become unfirable on a permanent basis; this can be


seen by the reachability tree (or occurrence graph) on the right
OBSERVATIONS
• The Petri Net has place or s-invariants:

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

• By adding these two minimal s-invariants, a new one is obtained:

M(p1) + M(p3)+ M(p2) + M(p4) = 2

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.

Then the set of transitions


{T1, T2, T3} is a T-invariant: if every transition is the set is
fired once from a marking M, the state of the net will return to M.

• The state or marking M1 = [0, 0, 1, 1] illustrates concurrency. Both


transitions T2 and T3 are enabled and can fire independently - in any
order

• Transition T1 illustrates synchronization: When A is moving


right and B left, they cannot change state independently of each other -
the collision requires both.
OBSERVATIONS
• This is a discrete event dynamical system:

– 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

• Furthermore, it is autonomous and if the output is the state it can be a


stochastic Petri Net if the initial position of the balls is a random variable.
Then whether state M2 or M3 will occur is a random variable.
FORMAL DEFINITION OF PN

• A Petri Net can be described uniquely by a 4-tuple

• Petri Net structure:

(P,T,I,O)

P = finite set of places T = finite set of transitions

I = set of arcs from Places to transitions (Input arcs)

O = set of arcs from transitions to Places (Output arcs)

• Formally, I is an input function (I: P -> T) and


O an output function (O: T -> P)
PRESETS AND POSTSETS
• Given a transition T

– The Preset of T, denoted by •T , is the set of places that


are input places to T

– The Post set of T, denoted by T•, is the set of places that are output
places of T

• Given a place P

– The Preset of P, denoted by •P , is the set of transitions that are input


transitions to P

– The Post set of P, denoted by P•, is the set of transitions that are
output transitions of P

• These definitions lead to an alternative definition of a Petri Net


Net Structures

 A sequence of events/actions:

e1 e2 e3

 Concurrent executions:
e2 e3

e1

e4 e5
Net Structures

 Non-deterministic events - conflict, choice or


decision: A choice of either e1, e2 … or e3, e4
...
e1 e2

e3 e4
Net Structures

 Synchronization

e1
Net Structures

 Synchronization and Concurrency

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

• In this Petri net, every place has a


capacity and every arc has a weight.
• This allows multiple tokens to reside in a
place to model more complex behaviour.
Behavioural Properties

• 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

 The machine dispenses two kinds of


snack bars – 20c and 15c.
 Only two types of coins can be used
– 10c coins and 5c coins.
 The machine does not return any change.
Example: Vending Machine (STD of an FSM)
Take 15c snack bar

Deposit 10c 15 cents


c 5 cents
t 5
si
po
D e
c

Deposit 5c
t5
Deposit 5c
s i
e po
0 cent D
De
po
sit
10
c
Deposit 10c 20 cents
10 cents

Take 20c snack bar


Example: Vending Machine (A Petri net)

Take 15c bar


Deposit 10c
15c
5c
Deposit 5c

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)

Take 15c bar


Deposit 10c
15c
5c
Deposit 5c

Deposit Deposit
0c 5c Deposit 5c
5c

Deposit 10c
10c 20c
Deposit 10c
Take 20c bar
Recalling the Vending Machine (Token Game)

Take 15c bar


Deposit 10c
15c
5c
Deposit 5c

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

• “M2 is reachable from M1 and M4 is


reachable from M0.”
• In fact, in the vending machine example,
all markings are reachable from every
marking.
Boundedness

• A Petri net is said to be k-bounded or


simply bounded if the number of tokens in
each place does not exceed a finite
number k for any marking reachable from
M0.
• The Petri net for vending machine is 1-
bounded.
• A 1-bounded Petri net is also safe.
Liveness

• A Petri net with initial marking M0 is live if,


no matter what marking has been reached
from M0, it is possible to ultimately fire any
transition by progressing through some
further firing sequence.
• A live Petri net guarantees deadlock-free
operation, no matter what firing sequence
is chosen.
Liveness

• The vending machine is live and the


producer-consumer system is also live.
• A transition is dead if it can never be fired
in any firing sequence.
An Example
t1
p3

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

...

Machine 1 Buffer Machine 2

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.

Solvent 1. Solvent 2. Solvent 3. Solvent 4.

Reactor.

 The Petri net model of the batch plant


Blender.

 Batch plant = charging + reaction +


blending + testing & discharging
Filling Tank.
PN Modelling of Solvent Charging
P1
Illustration of places and transitions.
t1
p1: Reactor available
p2: Charging Solvent 1 to the reactor
S1
P2 p3. Charging Solvent 2 to the reactor
t2
p4: Charging Solvent 3 to the reactor
P3 S2 p5: Charging Solvent 4 to the reactor
t3
p6: Reaction in progress to the reactor
S1: Solvent 1
S3 P4 S2: Solvent 2
t4 S3: Solvent 3
S4: Solvent 4
P5 S4
t1: Start charging solvent 1
t5 t2: Stop charging solvent 1 & start charging solvent
P6 2
t3 : Stop charging solvent 2 & start charging solvent
3
t4: Stop charging solvent 3 & start charging solvent
PN Modelling of Solvent Charging
P1

 This is a marked graph


t1
since every place has
S1
P2 exactly one input and
t2
one output transition.
P3 S2 t'  The net is live and
t3 p'
reversible since every
circuit has at least one
S3 P4 t" token.
t4  It is a safe net since no
place has more than one
P5 S4
token.
t5

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

wait Order wait


taken

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

wait Order wait


taken

eating eating
Tell
kitchen Serve food
Serve food
Example: In a Restaurant (Scenario 2)
Waiter
Customer 1 free Customer 2

Take Take
order order

wait Order wait


taken

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)

 A complete description of the problem discussed is as follows:


 The objective function to be minimised is the time makespan required
to complete all the jobs.
 The given constraints are:
 precedence relationships among the jobs;

 fixed number of resources and prescribed job-resource


assignment.
 The goal is to find a sequential order of jobs that satisfies the
above conditions.
t1 M 0 t5
0 M 0 M 14
1
p1 p6
t2 t6
t5
3 1 M
t1 M 2
15
t3 t1 t7
p2 p11 p7
t5
3 M 3
3 M 11
1 M 16 1 M 22
t6 t4 t3 t2 t8
t2 t5 t6 t7 t1
5 M 4 3 M 3 M 9 4 M 4 M 1 M M M
9 12 12 17 17 23
p3 p8 t5 t4 t3 t2 1 9
t6 t7 t8
M t1
5 5 5 M 5 4 M 10 4 M 10 4 M 13 4 M 18
t3 t7
t6 t6 M M
t4 t8 21 21
9 9
p4 p12 p9
6 M 6 5 M 6
9 M 19

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

Firing sequence: t5t6t1t7t2t8t3t4 leads to c=11 min (optimum)

S1 J2 J1

S2 J2 J1

9 11 Time
1 5


Other Types of Petri Nets

• High-level Petri nets


• Tokens have “colours”, holding complex
information.
• Timed Petri nets
• Time delays associated with transitions and/or
places.
• Fixed delays or interval delays.
• Stochastic Petri nets: exponentially distributed
random variables as delays.
Other Types of Petri Nets

• Object-Oriented Petri nets


• Tokens are instances of classes, moving from
one place to another, calling methods and
changing attributes.
• Net structure models the inner behaviour of
objects.
• The purpose is to use object-oriented
constructs to structure and build the system.
An O-O Petri Net
Producer Consumer
ready accepted

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

2.- Reachability concepts


• Reachability
m
• Lim-reachability m0
• δ -reachability

3.- Characterization of the reachability sets

4.- Liveness and Reversibility


m
• Definition and relationship m0
5.- Conclusions

95
Motivation
Large discrete systems:
• manufacturing number of states
• logistic
• communication
• traffic

Some verification techniques


require:
• state space exploration
• integer programming

size of the system


Problem:

• State explosion
96
Fluidification
Fluidification = Drop integrality constraint in the firing.

• Marking becomes continuous

• Linear programming techniques


polynomial complexity

• Some properties may change

97
Continuous Petri Nets. Firing rule
 m[ p] 
Enabling degree : enab(t , m) = min  
p∈•t Pr e[ p,t ] 

A transition t can be fired in any amount α, 0 < α ≤ enab(t,m)

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

lim-RS = {m| m is lim-reachable}

101
Reachability and Lim-
reachability
RS ⊆ lim-RS

Both RS and lim-RS are not always closed sets


m(p4)
p1 1
1
1
t1 p3 1
t3
p2 t2
0 m(p2)
p4 m0 1

(1-α, α, 0, 1) is reachable for every α >0 RS and 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

Def: m is δ-reachable iff the system can get as closed as desired to m


m(p4)
δ-RS = {m| m is δ-reachable} 1

Property: δ-RS is a closed set


m(p2)
m0 1
103
Reachability concepts
Reachability finite sequence

Lim-reachability infinite sequence

δ-reachability arbitrarily near

linear-reachability state equation


LRS={m | m=m0+Cσ≥0, σ≥0
}
104
Questions
1.- What’s the relationship among the reachability sets?

2.- Is it decidable whether m belongs to a given reachability


set?
Given m: m ∈ RS ?
m ∈ lim-RS ?
m ∈ δ-RS ?
m ∈ LRS ?
105
Sets of Fireable Transitions
FS = { θ | there exists a fireable sequence σ such that ||σ|| = θ }

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

t1 and t4 can never be fired t3


t2
2

p5 p6

Remove them! t5 t6

Equivalent system
107
Conditions for reachability
Does m belong to RS?

There exists σ ≥ 0 such that


1.- m = m0+Cσ ≥0
m ∈ RS 2.- ||σ|| ∈ FS
3.- There is no empty trap at m in Nσ
( Nσ : remove transitions not in ||σ||)

• 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

σ 1 =< t1, t3, t4 > σ 2 =< t2, t5 >


m = m0 + Cσ 1 m = m0 + Cσ 2
||σ 1|| ∈ FS ||σ 2|| ∈ FS
Trap {p2,p3} has been
No trap has been
filled and emptied emptied
NOK OK
109
Conditions for lim-reachability
Recall: p1 1
Some traps can be emptied in the limit
t1 p3 1
2
p2 t2 t3
p3 and p4 can be p4
emptied
There exists σ ≥ 0 such that
1.- m = m0+Cσ ≥0
m ∈ lim-RS
2.- ||σ|| ∈ FS

• 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

σ 1 =< t1, t3, t4 > σ 2 =< t2, t5 >

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

There exists σ ≥ 0 such that


m ∈ δ-RS 1.- m = m0+Cσ ≥0

• Characterization of δ-RS
• δ-RS = LRS No spurious solutions!
• m ∈ δ -RS is a decidable problem
112
Relationships
There exists σ ≥ 0 such that

1.- m = m0+Cσ ≥0 1.- m = m0+Cσ ≥0 1.- m = m0+Cσ ≥


2.- ||σ|| ∈ FS 2.- ||σ|| ∈ FS 0
3.- There is no empty
trap at m in Nσ

RS ⊆ lim-RS ⊆ δ-RS = LRS

The differences are in the border points

]LRS[ ⊆ RS ⊆ lim-RS ⊆ δ-RS = LRS


113
Relationships
]LRS[ ⊆ RS ⊆ lim-RS ⊆ δ-RS = LRS
m(p4)
p1 1
0.5
t1 p3 1
2
p2 t2 t3 m(p2)
1
p4 m(p3) 1
m0
RS
m(p4) m(p4)

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

live, lim-live and δ-live system

Def: <N, m0> is lim-(δ-)reversible iff for every m ∈ lim-(δ-)RS (N,


m0), ∈
m0 lim-(δ-)RS (N, m) 115
Liveness and Reversibility
In discrete systems: reversibility liveness & consistency

The firing of t1 fills


the trap {p2, p3, p4}

In continuous systems:
reversibility liveness & consistency
lim-reversibility lim-liveness & consistency
δ-reversibility δ-liveness & consistency
116
Summing up
Topic: Reachability in continuous Petri nets

Concepts: Reachability finite sequence


Lim-reachability infinite sequence
δ-reachability arbitrarily near

Results:

• Characterization of the sets based on the state


equation
• Relationships among the sets:
]LRS[ ⊆RS ⊆lim-RS ⊆δ-RS = LRS

• Liveness and Reversibility connection


117
Emptying an ordinary trap

Trap : {p1, p2, p3, p5}

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:

– Bipartite directed multigraphs

– Markings and state

– Execution: enablement and firing

– Selected properties and special classes

Some of the PETRI NETS Applications have been discussed


Petri Net References

Murata, T. (1989, April). Petri nets: properties, analysis


and applications. Proceedings of the IEEE, 77(4), 541-
80.
Peterson, J.L. (1981). Petri Net Theory and the Modeling
of Systems. Prentice-Hall.
Reisig, W and G. Rozenberg (eds) (1998). Lectures on
Petri Nets 1: Basic Models. Springer-Verlag.
The World of Petri nets:
http://www.daimi.au.dk/PetriNets/

You might also like