5
Hybrid Petri Nets Based Approach for Analyzing Complex Dynamic Systems Rafika Hakiki Computer Science Department Senia University Oran, Algeria [email protected] Larbi Sekhri Computer Science Department Senia University Oran, Algeria Larbi.Sekhri@univ -oran.dz Abstract—this paper presents a mapping algorithm to deal with a new class of hybrid Petri net (HPN) called Discrete Continue elementary HPN. The method enables us to analyze some system’s properties using the linear hybrid automaton generated by the mapping process. The method is applied to a three tanks water system and analyzed by a PHAVer software tool. Its effectiveness is illustrated by numerical simulation results. Keywords-Hybrid system; Hybrid Petri nets; Evolution graph; Linear hybrid automaton; I. INTRODUCTION Hybrid dynamic systems (HDS) are a class of reactive systems. Modeling and verifying the behavior of HDS represent a current study field which concerns researchers of both the automatic control community and the computer science community. HDS are of a great interest for the industry, as they can be found in every domain (automated production systems, food industry, energy, transport, telecommunications, etc.). Driven by rapid advances in distributed and communicating control technology, by new specification languages, tools and models, HDS are objects of numerous research works to increase quality and safety. The method presented in this paper extends Sava’s work [12]. Sava proposed an approach to build the timed automaton (TA) which models the exact behavior of a discrete event system (DES) modeled by a time Petri net (TPN). The forbidden states of the DES are modeled by forbidden timed automaton locations. This paper has two aims: first, to present formally a new class of HPN called Discrete Elementary HPN (DC elementary HPN) and, second, to propose a systematic method based on mapping algorithm to build a linear hybrid automaton (LHA) from an evolution graph of a DC-elementary HPN. Properties analysis of LHA is treated by PHAVer software tool [5]. The paper is structured as follows: section 2 presents some works on HDS models. Section 3 introduces formal definition of a DC-elementary HPN. In section 4, a formal definition of LHA and a mapping algorithm are introduced. Section 5 deals with a case study (three water tanks system) where our mapping algorithm is applied. In section 6, we summarize our results and sketch directions of future research. II. MODELING HYBRID DYNAMIC SYSTEMS Research works on HDS deal with proposal mathematical models and approaches for establishing concepts as stability, controllability and diagnosability. The need to develop formal methods for HDS validation is a necessity. We require methods that combine theoretical studies of HDS with computer methods to validate formally some properties [8], [10], [13] and [14]. A lot of models can be found in the literature, the majority extend existing ones. Hybrid bond graph model extends bond graph model by including specific elements [6] and [11]. Extension of discrete models like continuous Petri nets considers marking as real number and the transition firing as a continuous process [1]. Hybrid Petri nets are composed by a discrete part and a continuous part [4]. Other models called mixed models contain two sub parts. A sub part based on finite state automaton or on Petri net to describe a discrete state of the system and the second sub part is based on equations to describe continuous part [15]. Timed automaton has been proposed by Alur and Dill [2] in order to achieve verification. Time is seen as continuous entity and its evolution interacts with discrete transitions. Automaton includes clocks whose values belong to the set of real numbers and increasing continuously. III. HYBRID PETRI NETS A. Introduction Hybrid Petri nets (HPN) are developed from continuous Petri nets [3]. HPN are characterized by the interaction of two major components: Discrete Part and Continuous Part. Discrete part models logical functionalities while continuous part models continuous phenomenon. HPN presented in literature are formed by two kinds of Petri nets: Discrete timed Petri nets and continuous Petri nets functioning with maximal speed [4]. Elementary HPN are a class of HPN where no transformation of marking exists between discrete and continuous parts. Elementary HPN combining time Petri net and continuous Petri net with constant speed are called D-elementary HPN. In this model only the discrete part can influence the continuous part 180 978-1-4244-8611-3/10/$26.00 ©2010 IEEE

[IEEE 2010 International Conference on Machine and Web Intelligence (ICMWI) - Algiers, Algeria (2010.10.3-2010.10.5)] 2010 International Conference on Machine and Web Intelligence

  • Upload
    larbi

  • View
    215

  • Download
    2

Embed Size (px)

Citation preview

Page 1: [IEEE 2010 International Conference on Machine and Web Intelligence (ICMWI) - Algiers, Algeria (2010.10.3-2010.10.5)] 2010 International Conference on Machine and Web Intelligence

Hybrid Petri Nets Based Approach for Analyzing

Complex Dynamic Systems

Rafika Hakiki Computer Science Department

Senia University Oran, Algeria

[email protected]

Larbi Sekhri Computer Science Department

Senia University Oran, Algeria

[email protected]

Abstract—this paper presents a mapping algorithm to deal with a new class of hybrid Petri net (HPN) called Discrete Continue elementary HPN. The method enables us to analyze some system’s properties using the linear hybrid automaton generated by the mapping process. The method is applied to a three tanks water system and analyzed by a PHAVer software tool. Its effectiveness is illustrated by numerical simulation results.

Keywords-Hybrid system; Hybrid Petri nets; Evolution graph; Linear hybrid automaton;

I. INTRODUCTION Hybrid dynamic systems (HDS) are a class of reactive

systems. Modeling and verifying the behavior of HDS represent a current study field which concerns researchers of both the automatic control community and the computer science community. HDS are of a great interest for the industry, as they can be found in every domain (automated production systems, food industry, energy, transport, telecommunications, etc.). Driven by rapid advances in distributed and communicating control technology, by new specification languages, tools and models, HDS are objects of numerous research works to increase quality and safety.

The method presented in this paper extends Sava’s work [12]. Sava proposed an approach to build the timed automaton (TA) which models the exact behavior of a discrete event system (DES) modeled by a time Petri net (TPN). The forbidden states of the DES are modeled by forbidden timed automaton locations. This paper has two aims: first, to present formally a new class of HPN called Discrete Elementary HPN (DC elementary HPN) and, second, to propose a systematic method based on mapping algorithm to build a linear hybrid automaton (LHA) from an evolution graph of a DC-elementary HPN. Properties analysis of LHA is treated by PHAVer software tool [5].

The paper is structured as follows: section 2 presents some works on HDS models. Section 3 introduces formal definition of a DC-elementary HPN. In section 4, a formal definition of LHA and a mapping algorithm are introduced. Section 5 deals with a case study (three water tanks system) where our

mapping algorithm is applied. In section 6, we summarize our results and sketch directions of future research.

II. MODELING HYBRID DYNAMIC SYSTEMS Research works on HDS deal with proposal mathematical

models and approaches for establishing concepts as stability, controllability and diagnosability. The need to develop formal methods for HDS validation is a necessity. We require methods that combine theoretical studies of HDS with computer methods to validate formally some properties [8], [10], [13] and [14]. A lot of models can be found in the literature, the majority extend existing ones. Hybrid bond graph model extends bond graph model by including specific elements [6] and [11]. Extension of discrete models like continuous Petri nets considers marking as real number and the transition firing as a continuous process [1]. Hybrid Petri nets are composed by a discrete part and a continuous part [4]. Other models called mixed models contain two sub parts. A sub part based on finite state automaton or on Petri net to describe a discrete state of the system and the second sub part is based on equations to describe continuous part [15]. Timed automaton has been proposed by Alur and Dill [2] in order to achieve verification. Time is seen as continuous entity and its evolution interacts with discrete transitions. Automaton includes clocks whose values belong to the set of real numbers and increasing continuously.

III. HYBRID PETRI NETS

A. Introduction Hybrid Petri nets (HPN) are developed from continuous

Petri nets [3]. HPN are characterized by the interaction of two major components: Discrete Part and Continuous Part. Discrete part models logical functionalities while continuous part models continuous phenomenon. HPN presented in literature are formed by two kinds of Petri nets: Discrete timed Petri nets and continuous Petri nets functioning with maximal speed [4]. Elementary HPN are a class of HPN where no transformation of marking exists between discrete and continuous parts. Elementary HPN combining time Petri net and continuous Petri net with constant speed are called D-elementary HPN. In this model only the discrete part can influence the continuous part

180978-1-4244-8611-3/10/$26.00 ©2010 IEEE

Page 2: [IEEE 2010 International Conference on Machine and Web Intelligence (ICMWI) - Algiers, Algeria (2010.10.3-2010.10.5)] 2010 International Conference on Machine and Web Intelligence

[7]. In this paper we define an extension of D-elementary HPN called DC-elementary HPN where the continuous part can influence the discrete part.

B. Formal Definition Formally, an DC-elementary HPN is defined as 9-tuple < P;

T; h ; Pr; Post; I ; SIM ; V ; M0> where:

� P= {P1, P2, …, Pn} a non empty finite set of places,

� T= {T1, T2, …, Tn} a non empty finite set of transitions,

� P�T=�

� h: P �T�{D, C}:Hybrid function indicating discrete nodes (PD, TD) and continuous nodes (PC, TC)

� Pre: P�T�Q+ (if Pi � PC) or N (if Pi � PD) is forward incidence application

� Post: P�T�Q+ (if Pi � PC) or N (if Pi � PD) is backward incidence application

� Pre and Post satisfy the following condition:

� (Pi, Tj) � (PD�TC) � (PC�TD) then Pre (Pi, Tj) = Post (Pi, Tj)

� I: (Pi, Tj) �R: Inhibition application,

� SIM: TD �Q+ � (Q+��) application associating to each discrete transition Tj their firing static interval [�j, j].

� V: TC�R+: application associating to each continuous transition Tj their maximal firing speed V

� M0: P�R+ (if Pi � PC) or N (if Pi � PD) is the initial marking.

IV. FROM EVOLUTION GRAPH TO LINEAR HYBRID AUTOMATON

A. Definition A linear hybrid automaton (LHA) is defined by A= (X, S,

L, Inv, dyn, T, a, guard, aff) where:

� X Rn is a finite set of variables.

� S is a finite set of summits.

� L is a finite set of synchronization labels

� Inv is a function associating for every s �S an invariant Inv (s).

� dyn: S�X�Q is a function describing the evolution of variables in each summit.

� T is a finite set of transitions, each transition e=(s, s’), T identifies a starting summit s �S and an arrival summit s’ � S.

� a �L is a synchronization label associated to transition e=(s, s’).

� guard is a function that associates to each transition e=(s, s’) a predicate Ce called guard. If Ce is verified then the transition e=(s, s’) is executed.

� aff is a function that associates to each transition e=(s, s’) a relation aff.

The state of a LHA is given by couple E=(s, v) where s is a summit and v is a valuation giving the values of the variable x at t moment. This state can change by discrete transition firing or by time passing in the same summit. Contrarily to HPN, hybrid automata (HA) are difficult to model systems. HPN have the advantage to models clearly and easily systems without presenting an exhaustive enumeration of the space state. This situation makes difficult the analysis step. It is very hard to translate an HPN into an HA due to the strong interaction existing between the discrete dynamic and the continuous dynamic. Many algorithms exists in literature translating different classes of HPN into hybrid automaton [7], [12] and [15]. Sava’s algorithm translates a time Petri net into timed automaton by determining for each reachable summit L, reachable space, enabled discrete transitions and clocks. In [7], an algorithm translating a Discrete-elementary HPN into hybrid automaton is presented. Properties analysis of hybrid automaton is expressed as reachability problem that is not decidable. In order to reduce this complexity strong restrictions are added to obtain specific classes of hybrid automaton for which exist tools [9].

B. Mapping algorithm In this section, we propose a translation algorithm for DC-

elementary HPN. In entry, this algorithm accepts an evolution graph of a DC-elementary HPN and gives a linear hybrid automaton (LHA). The LHA is more compacted than an evolution graph enabling the analysis activities [7]. We have developed a software tool using the C++ Builder programming language to implement our algorithm. In the rest of this paper, the notation given below is adopted:

T: transitions set {TD: temporal and TC: dynamic}, Tdc: set of temporal transitions depending on marking of continuous places of HPN, M = {Mc, Md}: set of markings, D: set of dynamic continuous places of HPN. What follows summarizes the steps of this algorithm:

For each enabled transition in Ln-1 Create a summit Ln,

Define Dn (dynamics of continuous places in Ln),

Define active clocks in Ln and Compute invariant Id (Ln) for each enabled Tj � Td

Define a dynamic transition TjC and Compute invariant

Ic(Ln) from firing interval of TjC for each enabled Tj � Tdc and

Associate a null clock to Tj in Ln,

Define a dynamic transition Tci (pic) and Compute Ici (Ln)

For each pic with Dn(pi

c) <0

Create a transition, Tn-1,n=(Ln-1, gn-1,n, An-1, n, Ln-1, n) and Save in P the visit of (Ln, Tn-1, n)

The algorithm ends up, when there is no summit left to visit.

181

Page 3: [IEEE 2010 International Conference on Machine and Web Intelligence (ICMWI) - Algiers, Algeria (2010.10.3-2010.10.5)] 2010 International Conference on Machine and Web Intelligence

V. ILLUSTRATIVE EXAMPLE

A. Case study: Three tanks water system The method explained in this paper will be illustrated

briefly on three water tanks system presented in figure 1. We assume the reader is broadly familiar with continuous Petri nets [1]. In Hybrid Petri nets, continuous places are modeled by double circles and continuous transitions by rectangles.

Let us consider the system of three tanks illustrated by the figure 1. To valve 1, valve 2, valve 3, valve 4 and valve 5 are associated the flow rates 2, 5, 3, 6 and 7litres/sec respectively. This system is modeled by a DC-elementary HPN illustrated by the figure 2.

Tanks are represented by continuous places P5, P6 and P7 while the maximal values of speed V5, V6, V7, V8 and V9 are associated to continuous transitions T5, T6, T7, T6 and T9 respectively.

m1, m2 and m3 represent the initial marking of places P5, P6 and P7 respectively, v5 (t), v6 (t), v7 (t), v8 (t) and v9 (t) represent the firing speed of transitions T5, T6, T7, T6 and T9 respectively.

Valve3 (Valve4) has two discrete working modes (stop, work) and is modeled by two discrete places P1and P2 (P3 and P4). The passing from the open state to the closed state of Valve3 (Valve4) takes 3t.u to 5t.u, therefore the time interval [3, 5] is associated with discrete transitions T2 and T3. This transition is constrained by the water level in tank1 (tank2) modeled by the valuation in the arrow P5�T2 (P6�T3). On the other hand, the passage from the closed state to the open state of Valve3 (Valve4) takes place after 10 t. u. from the last opening action, therefore the time interval [10, 10] is associated with discrete transition T1 and T4. P2�T6, P4�T8 (P5�T2, P6 �T3) represent the influence of discrete (continuous) part on continuous (discrete).

Assume m1(0) = 26litres, m2(0) = 10litres and m3(0)=12 litres:

The markings m1, m2 and m3 are positive thus the continuous transitions T5, T6 and T7 are strongly validated. P4 is not marked and T8 is not enabled any more, and v8 (t) = 0. Markings m1, m2 and m3 evolve according to curves of figure 3. The dynamics of markings m1, m2 and m3 is equal to:

V1=�� 1=V5-V6=-1litres /sec (1)

V2=�� 2=V7=5litres /sec (2)

V3=�� 3=V6-V9=-4litres /sec (3)

At t = [3, 3]: m3 = 0 then its dynamic is null V3= �� 3=V6-V9=0litres/sec. After t= [1, 3]: 20 � m1 � 22 thus T2 is enabled.

After t = [3, 5], T2 is fireable, m1=17 and its dynamic V1=�� 1=V5=2litres/sec. (P2 being not marked thus T6 is not enabled any more). The evolution dynamics of continues places evolves according to curves illustrated by figure 4.

Figure 1. Three water tanks system

Figure 2. DC-elementary HPN

Behavior of continuous Petri nets can be defined by the marking and his instantaneous firing speeds vector. For HPN, an IB-state (Invariant Behavior-state) concept is introduced [7]. An IB-state represents stages where HPN evolutions of marking stay constant and continue. Formally an IB-state is a time interval where:

1. Marking MD of D-places is constant,

2. Validation vector eD of discrete transitions is constant,

3. Instantaneous speeds vector of continuous transitions is constant,

4. Markings vector for discrete and continuous places is constant.

5. When an IB-state is reached, the marking of continuous places MC is constant.

Consequently, a DC-elementary HPN evolution graph is a succession of IB-state modeled by nodes. The evolution between nodes is guided by occurrence of events like C1-event (continuous place marking becomes null), D1-event (firing of discrete-transition) and D2-event (change validation degree of discrete transition by a marking of a continuous place). The figure 5 illustrates the evolution graph of the DC-elementary HPN of figure 2.

182

Page 4: [IEEE 2010 International Conference on Machine and Web Intelligence (ICMWI) - Algiers, Algeria (2010.10.3-2010.10.5)] 2010 International Conference on Machine and Web Intelligence

Figure 3. Evolution marking of continues places

Figure 4. Evolution dynamics of continues places.

Figure 5. Evolution graph of the DC-elementary HPN

B. Construction of LHA Let us illustrate this algorithm from the example of

figure 1. We consider the initial marking of the DC-elementary HPN of figure 2 is M0= [Md = {0, 1, 1, 0}, Mc = {26, 10, 12}]. The proposed algorithm generates the summits without taking into account reachabilty of summits that is non decidable problem for LHA. Nevertheless, the existence of software tools like Hytech [5] and PHAVer (Polyhedral Hybrid Automaton Verifier) [5] allows computing the reachable space. The mapping algorithm applied upon our illustrative example gives the LHA A illustrated by the figure 6.

Figure 6. LHA A obtained by the mapping algorithm

C. Analysis of two water tanks system The set of generated summits keeps the syntax and the

semantics of the evolution graph. The simulation which is based on software tool PHAVer (http://www.cs.ru.nl/~goranf/) for analyzing the LHA A, gives results summarized in table 1. Reachability space by forward analysis was obtained after 5 iterations and time duration of 0,094s

Let’s now interpret some results illustrated by the table 1. Results are represented as linear constraints, for example, the relation -6*x2 - 5*x4 - 5*p5 >= -160 (forward analysis column and L3 state line) gives an upper limit of reachability space and remarkable information: all trajectories in upper part of this limit lead to dangerous states. In this state (summit), minimum water level in tank 1 exceeds and alarms can be released.

From figure 7, we clearly see that the interval of the clock x4 is between 0 and 3 and the marking p7 is positive (forward analysis column and L1 state line).

To display in graphic form these results and to be able to interpret them, we took these results of PHAVer and generate with a script Matlab the following bi-dimensional graph.

Figure 7. Graph x4 versus p7

183

Page 5: [IEEE 2010 International Conference on Machine and Web Intelligence (ICMWI) - Algiers, Algeria (2010.10.3-2010.10.5)] 2010 International Conference on Machine and Web Intelligence

Figure 8. Graph x4 versus x1 for states {L1,…, L14}

TABLE I. REACHABLE SPACE OF LHA �

Forward analysis

L1 4*x4+p7==12 & 5*x4 - p6 == -10 & x4 + p5 == 26 & x2 == 0 & x4 >= 0 & -x4 >= -3,

L2 x2 == 0 & -x4 >= -10 & p5 >= 20,

L3 x2 >= 0 & -x4 >= -10 & -x2 - p5 >= -22 & -6*x2 - 5*x4 - 5*p5 >= -160 & p5 >= 17 & x2 + p5 >= 20 & -x2 >= -5

L4 p6 >= 12 & p5 >= 20,

L5 x4 == 0 & p7 >= 0 & -x2 >= -5, L6 x1 >= 0 & -x1 >= -10 & -x4 >= -10,

L7 p6 >= 12,

L8 p6 >= 12 & p5 >= 20 & -p6 >= -14,

L9 x4 == 0 & x1 == 0 & p7 >= 0,

L10 x3 == 0 & -x1 >= -10 & p6 >= 12 & -p6 >= -14,

L11 p6 >= 12 & -x1 >= -10

L12 x1 >= 0 & -x1 >= -10 & p7 >= 0 & p6 >= 12,

L13 -x3 >= -5 & -x3 - p6 >= -14 & x3 >= 0 & x3 + p6 >= 12 & -x2 >= -5,

L14 x1 >= 0 & -x1 >= -10

VI. CONCLUSION This paper extends our earlier works on discrete event

system modeled by a functional graph [13] and [14]. The main contribution of this work is in introducing a new class of HPN (DC-elementary HPN) and in proposing an algorithm that allows translating an evolution graph of hybrid dynamic system in a graph called linear hybrid automaton. This graph is analyzed by a PHAVer software tool in order to prove some system’s properties. Our prospects for future research are to explore the possibility to study the diagnosability property for hybrid systems by exploiting the linear hybrid automaton.

REFERENCES

[1] H. Alla and R. David, “A Modeling and Analysis Tool for Discrete Events Systems: Continuous Petri net,” Performances evaluation, 33 (3) 175–1998.

[2] R. Alur and D.L. Dill, “A Theory of Timed Automata,” Theoretical Computer Science, 126, 183-235. 1994.

[3] J. Le.Bail, “Sur les Réseaux de Petri Continus et Hybrides,’’ Thèse de Doctorat, Institut National Polytechnique de Grenoble (France), 1992.

[4] R. David and H. Alla, “Discrete, Continuous and Hybrid Petri Nets,” Springer, 2005.

[5] G. Frehse, “Phaver: Algorithmic Verification of Hybrid Systems Past Hytech,” In M. Morari and L. Thiele editors, Hybrid Systems: Computation and Control: 8th International Workshop, HSCC2005, Zurich, Switzerland, LNCS 3414, pages 258–273. Springer, March 2005.

[6] P. Gawthrop and B. Geraint, “Bond Graph Modeling,” IEEE Control Systems Magazine, Vol. 27, 2007

[7] L. Ghomri, “Modélisation structurelle utilisant les automates hybrides et les réseaux de Petri hybrides en vue de la synthèse de contrôleur des systèmes dynamiques hybrides,’’ Mémoire de Magister, Université Aboubekr Belkaïd, Tlemcen (Algérie). 2005

[8] H. Guéguen, M.A. Lefebvre, O. Nasri and J. Zaytoon, “Safety Verification and Reachability Analysis for Hybrid Systems,” Proceedings of the 17th World Congress, International Federation of Automatic Control Seoul, Korea, July 6-11, 2008.

[9] T. Henzinger, P. Peter, W. Kopke, A.Puri and P. Varaiya, “Whats decidable about hybrid automata? The algorithmic analysis of hybrid systems,” Proceedings of 27th annual ACM Symposium on theory of computing, pp: 373-382, 1995.

[10] Z. Juarez, B. Denis and J. J. Lesage, “Réseaux d’automates hybrides à synchronisations typées pour la modélisation des SDH,’’ Conférence Internationale d'Automatique Francophone, CIFA 2008, Bucarest : Roumanie 2008

[11] P.Y. Richard, M. Morarescu and J. Buisson, “Bond Graph Modelling of Hard Nonlinearities in Mechanics: A hybrid Approach,” Nonlinear Analysis of Hybrid systems. ISSN 1751-570X, vol. 2, no3, pp. 922-951, 2008.

[12] A.T. Sava and H. Alla, “A Control Synthesis Approach for Time Discrete Event Systems,” Mathematics and Computers in Simulation, Vol. 70, issues 5-6, 24, pp. 250-265, Elsevier, February 2006.

[13] L. Sekhri, A.K.A. Toguyeni and E. Craye, “Surveillabilité d’un Système Automatisé de Production Modélisé par un Graphe Fonctionnel,’’ Journal Européen des Systèmes Automatisés (JESA), Volume 38, N° 3-4, Pages 243-268, Octobre, ISSN 1269-6935. 2004

[14] A.K.A. Toguyéni, E. Craye and L. Sekhri, “Study of the Diagnosability of Automated Production Systems Based on Functional Graphs,” Mathematics and Computers in Simulation, Vol. 70, issues 5-6, 24, pp. 377-393, Elsevier, February 2006.

[15] Y. EL.Touati, M.Yeddes, N. Ben Hadj Alouane and H. Alla,“Du réseau de Petri temporel étendu vers les automates hybrides linéaires pour l’analyse des systèmes,’’ CIFA Bucarest (Romania). 2009

[16] J. Zaytoon and J. L. Ferrier, “Rappels sur les Systèmes à Evénements Discrets dans les Systèmes Dynamiques Hybrides,’’ Edition Hermès– France. 2001.

184