You are on page 1of 19

Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

Modeling and performances


evaluation of Industrial Systems

Petri Nets

Lionel Amodeo
Professor
University of Technology of Troyes
lionel.amodeo@utt.fr

DOS 1 / Modelling and Performance Evaluation

References
n Yalaoui A., Chehade H., Yalaoui F., Amodeo L., Optimization of Logistics,
WILEY, ISBN: 9781848214248, 2012

n M. Ajmone Marsan, G. Balbo, G. Conte, S. Donatelli, G. Franceschinis,


Modelling with Generalized Stochastic Petri Net, John Wiley, Sons, 1995.
n R. David and H. Alla, Petri Nets & Grafcet: Tools for Modeling Discrete Event
Systems, New York: Prentice-Hall, 1992.
n R. David et H. Alla, Discrete, Continuous and Hybrid Petri Nets, Springer, 2004.

n Lindemann, C., Performance Modeling with Deterministic and Stochastic Petri


Nets, John Wiley and Sons, 1998.

n T. Murata, « Petri Nets: Properties, Analysis and Applications », Proceedings of


the IEEE, vol. 77, no. 4, 1982.
n Web site : http://www.informatik.uni- hamburg.de/TGI/PetriNets/

Petri Nets – Lionel Amodeo 2

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


1
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

Outline
n I. Introduction

n II. Definitions

n III. Properties and analytical methods

n IV. Some Models of Petri Nets

n V. Modelling of manufacturing system

n VI. Application to Supply chain

Petri Nets – Lionel Amodeo 3

Main study process


Application

Comparison and validation

!" !$
Performance
Modelization Evaluation Optimization
!#
(cost, service)
!%

Real case
Or project
Linear programming Direct Exact Methods
State model Or indirecte Approach Methods
Markov Process Discrete (Heuristics -
Queuing files Event Metaheuristics)
Petri Nets Simulation

Petri Nets – Lionel Amodeo 4

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


2
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

I. Introduction
n Graphical and Mathematical tool, applied to several areas
(automatic, computer science and manufacturing systems)
n First, introduced by Carl Adam Petri in 1962, at the University
of Darmstadt. And developed after by the MIT in 1968.
n It can be used as modeling, performance analysis and simulation
of discrete event systems
n Several simulation software have been developed for many
applications (manufacturing systems, computer sciences). Refer
to the Petri net Web Site (http://www.informatik.uni-
hamburg.de/TGI/PetriNets/)

Petri Nets – Lionel Amodeo 5

II.1. Definitions
n A Petri Net is a directed bipartite graph with 2 types of nodes:
places and transitions
PN = (P, T, Pre, Post)
§ P : finite set of places, P = (P1,P2,...,Pn),
§ T : finite set of transitions, T = (T1,T2,...,Tm),
§ Pre : (PxT) ® IN : input function that defines directed
arcs from places to transitions
§ Post : (PxT) ® IN : output function that defines directed
arcs form transitions to places

n Notations :
• Pre(Pi,Tj) is the weight of the arc between Pi and Tj.

• Post (Pi,Tj) is the weight of the arc between Tj à Pi

• The incidence matrix is defined by: W = Post – Pré


Petri Nets – Lionel Amodeo 6

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


3
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

II.1. Definitions
n Example Oriented arc
n P = {P1, P2}
n T = {T1, T2} P1 T1 P2 T2
2
T1 T2
é1 0ù P1
pre = ê ú
ë0 2û P2 Place (circle) Transition (bar) Weight of the arc

é0 1 ù é- 1 1 ù
post = ê ú W = post - pre = ê ú
ë1 0û ë 1 - 2û

Petri Nets – Lionel Amodeo 7

II.1. Definitions
n Notations
n
°T preset of transition Tj , set of its input places
j
n T°j postset of transition Tj , set of its output places
n °Pi postset of place Pi, set of its input transitions
n P°i postset of place Pi, set of its output transitions
n Example

P1 T1 P2 T2 P°1 = {T1}
2
°T2 = {P2}

Petri Nets – Lionel Amodeo 8

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


4
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

II.1. Definitions
n Dynamic behavior of a Petri Net, introduction of tokens in
the net.
n A marked Petri Net is a 4-tuple:
PN = (P,T, Pre, Post)
n M : P ® IN is the marking function.
n M0 is the initial marking of the PN.
P1 T1 P2 T2
M0 = (2, 0)
2

Token or mark

Petri Nets – Lionel Amodeo 9

II.2. Principles
Firing rules (2 steps)
n 1) A transition Tj is enabled (to firing) for a
marking M if and only if :
M(Pi) ³ Pre(Pi,Tj), " Pi Î °Tj.
n 2) Firing of a transition Tj
n Remove (consume) (Pre(Pi,Tj) tokens from each input
place of transition Tj tokens
n Add (produce) Post(Pi,Tj) tokens from each output
place of transition Tj

Petri Nets – Lionel Amodeo 10

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


5
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

II.2. Principes
n Firing example
n Phase 1: Is T enabled?
n 2 conditions must be checked: M(P1) ≥ Pre(P1,T) et M(P2) ≥
Pre(P2,T) ?
n Phase 2: Firing of T
P3
3 T
P1
2
M0 = (3,1,0,0,0) P4 M1 = (0,0,1,2,2)
2
P2 P5

Remark : there is not necessarily conservation of the number of tokens

Petri Nets – Lionel Amodeo 11

II.3. Particular cases


P1 T1
n Conflict
n Structural conflict
n One place with at least 2 output transitions
T2
n Effective conflict
n One place with at least 2 output transitions
n The output transitions are enabled T1

P1

2
T2
n Conflict Free Petri Net
n Every place has at most one output transition

Petri Nets – Lionel Amodeo 12

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


6
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

II.3. Particular cases


Marked graph (event graph or transition graph):
every place has exactly one incoming arc, and one
outgoing arc. This means, that there can not be
conflict, but there can be concurrency.
card(°Pi) = card (Pi°) = 1, " Pi Î P

Petri Nets – Lionel Amodeo 13

II.3. Particular cases


n State graph: every transition has exactly one
incoming arc, and one outgoing arc. This means,
that there can not be concurrency, but there can
be conflict
card(°Tj) = card (Tj°) = 1, " Tj Î T

Petri Nets – Lionel Amodeo 14

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


7
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

II.3. Particular cases


n PN with inhibitor arcs (inverse functioning)
n Very useful for inventory model
n Firing condition of T1
n M(P1) ≥ Pre(P1,T1) (normal condition)
n M(P3) < Pre(P3,T1) (inhibitor condition)

P1 P3 P1 P3

2 2
T1 T1
M0 = (2,0,1) M1 = (1,1,1)

P2 P2

Petri Nets – Lionel Amodeo 15

III. Analysis of PN
n Qualitative Analysis
n Properties of the Petri Net (structure of the net,
place, transition, markings)
n Quantitative Analysis
n Performance evaluation (introduction of time)
n Places (Average number of tokens)
n Transitions (Average number of firings)

Petri Nets – Lionel Amodeo 16

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


8
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

III. Analysis of PN
The main analysis methods can be classified in 3 groups:

n The methods based on the enumeration of all reachable


markings: reachability graph (graph of markings)

n The methods based on linear algebra (fundamental


equation, conservative components, marking invariants)

n The reduction methods (used to reduce the number


of places or transitions)

Petri Nets – Lionel Amodeo 17

III.1. Reachability tree and graph

n Reachability tree: Tree that regroups all


marking reached from the initial marking M0:
n Nodes are reached markings,

n Each arc represents the firing of a transition,

n The root of the tree is the initial marking M0.

n Reachability graph: obtained by merging


identical nodes (marking of the reachability tree)

Petri Nets – Lionel Amodeo 18

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


9
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

III.1. Reachability tree and graph

n Example : Reachability tree and graph

P1 T1 P2 T2

M0=(2,0) already reached


Tree T2
T1
M0=(2,0) M1=(1,1)
T1 T2
M2=(0,2) M1=(1,1) already reached
Graph
T2 T2
M0=(2,0) M1=(1,1) M2=(0,2)
T1 T1

Petri Nets – Lionel Amodeo 19

III.2. Coverability root tree

n Coverability root tree : used to limit the size of


the reachability tree when the number of markings
are infinite (the PN is not bounded). A new symbol
w is used in the marking.
n Example: a counter

P1 T1 P2 T2

P3

Petri Nets – Lionel Amodeo 20

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


10
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

III.3. Fundamental equation


n The fundamental equation is defined by the
relation:
M’ = M + W.s.
• M is the initial marking.
• s is the characteristic vector of the firing sequence of
transitions S.
• The component j of s corresponds to the number of
firing of the transition Tj in sequence S.
• M’ is the new marking obtained from the initial marking
by firing the sequence S.

Petri Nets – Lionel Amodeo 21

III.3. Fundamental equation


n Example
n Determine the new marking M by firing the sequence S
= T1T2T1T2T1
P1 T1 P2 T2

P3
n 2 ways
n To use the reachability graph
n To use the mathematical equation
n Remark
n The fundamental equation does not guarantee if the
sequence S is feasible.
Petri Nets – Lionel Amodeo 22

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


11
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

III.4. Properties
Two types of qualitative properties exist:

n The comportemental properties: depend on the


structure and the marking of the PN.
n Reachability (used for markings)

n Boundedness (used for places)

n Liveness, deadlock (used for transitions)

n Reversibility (used for markings)

n The structural properties: depend only of the PN


structure.
Petri Nets – Lionel Amodeo 23

III.4.1 Reachability
n Definition
n The problem of reachability of a marking M’
from a marking M is to check whether there is a
sequence of transitions s such that:
S
M® M’

Petri Nets – Lionel Amodeo 24

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


12
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

III.4.2 Boundedness
n Definitions
n A place Pi is said bounded for an initial marking
M0 if there is a natural integer k such that, for
all marking reachable from M0, we have:
M(Pi) £ k
n A PN is bounded for an initial marking M0 if all
the places are bounded for M0.
n The boundedness property depends on the
initial marking
n Particular case : Safe PN : M(Pi) £ 1
Petri Nets – Lionel Amodeo 25

III.4.3 Liveness
n Definitions
n A transition Tj is life for an initial marking M0, if
for every reachable marking Mi, a firing
sequence S from Mi exists, which contains
transition Tj.
n A PN is live for an initial marking M0, if all
transitions are live for M0.
n The liveness excludes any deadlock (sink state)
– No transition can be fired.

Petri Nets – Lionel Amodeo 26

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


13
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

III.4.4. Deadlock
n Example
n After 2 firing of T1 : deadlock

P1

T1
P2

M0(2,2) M1(2,1) M2(2,0) Deadlock

Petri Nets – Lionel Amodeo 27

III.5.5. Reversibility
n Definition
n A Petri net (PN, M0) is reversible if, for all
marking M reached from the initial marking M0,
M0 is reached from M.

n In other words, there is a firing sequence S


that allows to return to the initial marking M0
starting from M.

Petri Nets – Lionel Amodeo 28

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


14
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

Example
n With the following PN, find:
n The incidence matrix W
n The initial marquing
n The reachability graph
n The properties

Petri Nets – Lionel Amodeo 29

IV. Several PN models


Non autonomous Petri Nets
n The dynamic evolution of the PN depends not only of the
state of the PN. It may depend on the time, data, …
n External event or set of events
n Synchronous PN

n Introduction of time
n Timed PN, Temporal PN, Stochastic PN, continuous PN
n Structuration of complex data (used generally in computer
sciences)
n High level PN (Coloured, Object PN, …).

Petri Nets – Lionel Amodeo 30

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


15
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

IV.1. Timed Petri Nets


n Definition
n A Time-PN is a doublet (PN, Temp) with
n PN a marked Petri Net (P, T, Pre, Post, M0)

n Temp : application from T to rational numbers (zero

or positive)
Temp(Ti) = di = temporization (timing) associated to
Ti
n Functioning
n The token has two states:
n Reserved: when the firing of the transition is decided.
n Non-reserved
n The enabling of a transition does not involve the
immediate reservation of the token.
Petri Nets – Lionel Amodeo 31

IV.1. Timed Petri Nets


n Functioning
n At t = 0, M = (0, 0)
n At t = t0, M = (1, 0) : A token arrived in the place P1
n At t = t1, M = (1, 0) : Firing reservation for the token
n At t = t1+d1, M = (0, 1) : firing of T1

M(P1)
P1 1

T1 d1

P2 0
t0 t1 t1+d1

Remark : For performance evaluation, it mainly concerned with


functioning at maximal speed: t1-t0 = 0 (not elapse time).
Petri Nets – Lionel Amodeo 32

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


16
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

IV.1. Timed Petri Nets


n Performance analysis
n Average number of tokens in the place : Mi*
n Average number of firing of transitions per unit of time (average
frequency): Fj*
n Average sojourn time (waiting time) of a token in a place: Di*

n Application to manufacturing systems


n Average number of tasks before processing (work in process)
n Average number of tasks performed per unit of time (production
rate)
n Mean processing time

Petri Nets – Lionel Amodeo 33

Example: Timed Petri Net


n Machine with input stock
n Analysis of the pallet flow (closed loop of materials)
n M(0)=(10,0)
P1 T1 P2 T2

d1=0.5 d2=1
Stock Machine
n The transitions reserve only one token per firing
n Properties: The PN is bounded, life and
reversible.

Petri Nets – Lionel Amodeo 34

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


17
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

Example: Timed Petri Net


n Performance evaluation
n To use simulator
n To use a table

Time Marking Marking Enabling Enabling Event


P1 P2 T1 T2
0 10 0 0.5 - -
0.5 9 1 1 1.5 Firing T1
1 8 2 1.5 1.5 Firing T1
1.5 8 2 2 2.5 Firing T1/T2
2 7 3 2.5 2.5 Firing T1
2.5 7 3 3 3.5 Firing T1/T2

n And draw the evolution of the marking

Petri Nets – Lionel Amodeo 35

Example: Timed Petri Net


n Performance analysis – Steady state
M(P1) M(P2)

n Average marking Courbe de Marquage


10

n M*=(0.5, 9.5) 9
8

n f*=(1, 1) 7
6
Marquage

5
4
3
2
1
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Temps

Petri Nets – Lionel Amodeo 36

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


18
Prof Lionel Amodeo – Modeling and Performance Evaluation with Petri Nets

Exercise 1: Timed Petri Nets


n Open loop
n d1 = 2, d2 = 1, d3 = 1
n Give the initial marking
n Give the marking evolution (P1 and P2)
n Give the average number of token and the
average firing rates
Stock Machine
T1 P1 T2 P2 T3

d1=2 d2=1 d3=1

Petri Nets – Lionel Amodeo 37

Exercise 2: Timed Petri Nets


n Assembling
n d1 = 1, d2 = d3 = d4 = 1
n Give the initial marking
n Give the marking evolution (P1 and P2)
n Give the average number of token and the
average firing rates
T1 P1

T3 P3 T4

T2 P2

Petri Nets – Lionel Amodeo 38

Copyright L. Amodeo / Reproduction and Diffusion Prohibited


19

You might also like