Modelling of Continuous-discrete Systems with Hybrid Petri Nets∗

2 downloads 0 Views 106KB Size Report
ABSTRACT. In this article a new way of description is formed for continuous-discrete systems, resulting from a combination of discrete Petri Nets and differential ...
Modelling of Continuous-discrete Systems with Hybrid Petri Nets∗ Mourad Chouikha, Eckehard Schnieder Institute of Control and Automation Engineering Technical University of Braunschweig Langer Kamp 8 D-38106 Braunschweig Tel.: +49-0531-391-76 67 Fax: +49-0531-391-51 97 E-Mail: {chouikha, schnieder}@ifra.ing.tu-bs.de

ABSTRACT In this article a new way of description is formed for continuous-discrete systems, resulting from a combination of discrete Petri Nets and differential equations. Additionally, for the newly developed means of description a mathematical description will be evolved, which can serve as a basis for a formal analysis of the models constructed. After that, a modular, object oriented modelling methodology for hybrid systems will be elucidated using a concrete example from control engineering. Keywords: hybrid systems, means of description, Petri Nets, differential equations, modelling 1. INTRODUCTION

tion, respectively, meet the most crucial requirements or even complement one another, so that an integration of both forms of descriptions into a new means of description is an obvious solution.

The subject of continuous-discrete systems, which are subsequently referred to as hybrid systems, has become more and more important in recent years. This trend is due to the increased complexity and volume of modern automation systems in the various technical branches and particularly due to their mixed continuous and discrete characteristics. Hitherto, such systems were developed in modules and following capacious and possibly iterative tests, which despite the high use of capacity did not at all guarantee a faultless functioning in every operational situation. Furthermore, an optimisation of the whole system is still out of question. Therefore the problems of hybrid systems need intensive research works with respect to the integrated design of hybrid system components.

In this paper a new approach will be introduced for the hybrid description, which expresses the integration of Petri Nets and differential equations. Following this approach there is a relation from net structure and behaviour to a system matrix, which represents a differential equation system whose solution is given by a Wronski matrix. In this way it is possible to formulate a basic equation for the description of the continuous net behaviour on the basis of the start marking and the Wronski matrix. The basic equation provides a formal basis of this new description, which is among other things necessary for the formal proof of the correctness and completeness of a system to be designed. For the formal description of the mixed discretecontinuous behaviour there is still a search for mathematical approaches, where the combination of the continuous and the discrete basic equation seems to suggest itself.

In the context of the system development as an interdisciplinary task an emphasis has to be put on three essential aspects that are closely related, namely the means of description, method and tool [8]. Yet in the framework of this paper only the means of description will be dealt with, as those are the most important prerequisite for a systems design. [3] gives an explication of the requirements for a means of description for hybrid systems. There it has been shown that the formal description of the system’s axioms according to [13] is indispensable for the description of hybrid systems. Following a classification and assessment of existing means of description for discrete and continuous systems with respect to various criteria, it is possible to formulate a statement concerning their suitability for the hybrid description. A notable upshot herein is that Petri Nets and differential equations, which have proved worthwhile in the discrete or the continuous systems descrip-

2. BASIC IDEA In the papers of [4] first concepts of the continuous and hybrid Petri Nets have already been presented. As opposed to discrete Petri Nets [1] the marks were treated as a real quantity by subdividing whole marks in infinitesimally small parts of the marks, the so-called tokens. Thus over the transition there is no more a flow of whole marks but of tokens, hence allowing the labels of the locations to take on real quantities. The switching behaviour of the net is determined by the so-called firing speeds of the transitions, which are either constant or depend on the

∗ This work is sponsored by the German Research Council (Deutsche Forschungsgemeinschaft DFG) within the program KONDISK

1

t −  m1   m1,0   − 1  +   ⋅ m1,0 ⋅ (1 − e T )   =  m2   m2 ,0   1 

Marking of the Pre Places of a transition. In this context two models were introduced, namely nets with constant and nets with variable firing speeds. The firing speeds of both versions do not depend on the time.

The known linear increase of an integrator as shown in fig. 2 is not observable. This is because the Marking of the Place p1 does not maintain the value of 1 but shows a negative exponential course, so that the firing speed has to adjust itself to the transition of the Marking m1 in order to generate the integral behaviour. This is the reason for Marking of Places not being able to be compared with signals in the sense of control engineering. There can rather be deduced an analogy to energies.

The starting point of the new approach are C/E nets to whose transitions a time dependent firing function V(t) (firing speed) is attributed. These firing functions depend on the desired dynamic switching behaviour of the transitions and must be previously determined for various dynamic behaviours. This shall be illustrated with the following example of the integrator. Let a discrete net be given by the following: p1, m1

t, V

p2, m2

m1,0 = 1

(7)

m1

m2

1

1

m2,0 = 0

fig. 1: Elementary Petri Net

t

The discrete behaviour of the net depicted in fig. 1 can be described by the basic equation M ’= M 0 + C ⋅ V

fig. 2: Marking course of m1 and m2 In order to be able to represent singals as used in control engineering Test arcs are used instead of Arcs. Test Arcs have the special feature of not taking away any Markings from the Pre Places, thus keeping the number of Pre Place Markings constant and creating the linear increase of an integrator, for instance. fig. 3 depicts the Marking courses of the Places p1 and p2.

(1)

with

M´ : following marking M0 : initial marking C : incidence matrix V : firing vector

m1,. m2 1

V as a function of time V(t) is now to be adjusted in a way that results in an integrating marking behaviour between p1 and p2 with the integrational time constant T. That means:

m1 m2



T ⋅ m2 = m1

t

(2)

For determining V(t) the following approach is formulated p1, m1

dm = v ⋅ dt

m1,0 = 1

fig. 3: Marking course in case of test arcs

=

m1

= − v ⋅ dt = v ⋅ dt

V (t ) = m1,0 ⋅ (1 − e

The firing functions V(t)1 can be determined for other dynamic behaviours as well, for example first order time delay behaviour, differentiator, etc. That makes possible the modelling of continuous systems, analogously to block circuit diagrams, by plugging in, combining and parametrising predefined transitions as transposition links. However, against the expectations this is not feasible, because although the firing functions of the transitions are time dependent they have a fixed course during time (cf. Equation (5)). As a consequence, a continuous change of the Marking of the Place p2 within the net in fig. 4 during the switching process has no influence on the Marking flow between p2 and p3, for example.

(4)



t T

(5)

)

This leads to =

m1,0 = 0

.

Taking the starting conditions m1,0 = 1 and m2,0 = 0 into consideration, V is obtained as

 m1  m  2

t

p2, m2

(3)

where v is any time function which is to be determined. If m1, or m2, respectively, is plugged in into equation (3) the following differential equation system is obtained

 . T m 2  dm1  dm  2

t, V

m1,0 ⋅ e



t T

= m1,0 ⋅ (1 − e



(6) t T

)

Hence, the basic equation of the continuous Petri Net for an integrating transition can be written like this

1 With the integrator, V(t) has the same course as m (t). 2

2

p1

t1

p2

Integrator T1

t2

p3

solution a descriptional form similar to the basic equation is developed afterwards. This procedure is now going to be illustrated with the example depicted in fig. 6, two integrators connected in series.

Integrator T2

p1

fig. 4: Series connection of integrators An explanation for this fact is that the firing speeds only depend on the start markings and not on the current markings. For this reason the formal description has to be extended in such a way that the current markings are always taken into account during an integration. This can be achieved, for example, by including into the calculation of the marking course of p the Marking changes of all Pre Places of the transitions which belong to the pre set of a particular Place p.

t1

 .  m.2   T1 ⋅ m2 ,in .  T2 ⋅ m2 ,out

p2

t2

.

=

.

m2 ,in − m2 ,out

=

m1

(9)

.

= T2 ⋅ m3,in = m2

where the inflow and outflow of Place p2 are represented by .

.

m2 ,in and m2 ,out , respectively. The formulation of similar

equations for p2 and p3 results in a differential equation system with nine unknowns. However, this equation system can only be reduced by eliminating m1,in, m1,out, m2,in, m2,out, m3,in and m3,out. Further reshaping results in the following equation system:

(8)

 1  − 0 0  .   T   m1  1  m. 1  1     m2  =  1 − 0 ⋅  m2   .   T1 T 2   m3   m3   1    0  123 0 123   M T2 .   M 144 42444 3

p1 t1

Integrator T2

To set up a differential equation system which describes the net behaviour the flow balance of every Place is formulated. Due to the symmetry of the net the balance of Place p2 is determined here. The result can then be transferred to the Places p1 and p3. The following goes for p2:

= m2

p3

p3

3.1. Elaboration of a differential equation system

In this case Place p3 fulfils the function of an summation place for the Marking flows of the transition t1 and t2. p1

t2

fig. 6: Series connection of integrators

In order to maintain all degrees of freedom when designing with Petri Nets there must be an agreement on determining the firing behaviour in certain net structures. In fig. 5a, for example, t1 and t2 represent two integrators with different time constants. If an integration between m1 and m3 and between m2 and m3 was requested, this would mean than m3 had to be the integral of two different functions at the same time. Therefore it is presupposed that the dynamic behaviour applies between the input place and the output of the transition. That means: = m1

p2

Integrator T1

3. GENERAL APPROACH

.   T1 ⋅ mt1 ,out  . T2 ⋅ mt 2 ,out

t1

p3

p2

(10)

A

a

b

It is often impossible to eliminate the auxiliary variables with other dynamic transmission behaviours. If, for instance, t1 and t2 were first order time delays, m2,in and m3,in could not be eliminated, because in the individual differential equations derivatives of different orders appear mixed. With second order time delays even the second derivatives of the Markings in the differential equation system have to be considered.

fig. 5: Special net structures In fig. 5b the transition t1 cannot integrate the markings m1 and m2 at the same time, because its output has to provide an unambiguously defined result. Therefore the integration should .

follow a specific Place (crossed arc). That is, e. g. mt1 ,out = m1 .

The examination of complex net structures led to a formalism by which the system matrix A can be derived systematically. With integrators, the Marking change of a Place ensues from the sum of the Markings of the Pre Places, multiplied by the inverses of the time constants of the input transitions. From this sum the Markings of the output places, multiplied by the inverses of the time constants of the output transitions, are subtracted. In fig. 5a, for example, the Marking change of p3 is

The time changes of m2 then have to be equal to the changes of .

.

m1 ( m 2 = m1 ). This will be illustrated with the application example in chapter 4. While the first approach, introduced in chapter 2, builds upon predefined firing functions, the general approach now assumes the dynamic behaviour of a transition and its parameters to be known. From the dynamic behaviours of all transitions in a net a differential equation system is set up that with a formalism can be directly inferred from the net structure. The solution of a differential equation system which describes the Marking behaviour of all Places with respect to time can be directly obtained by means of mathematical methods. From the attained

.

m3 =

1 1 ⋅ m1 + ⋅ m2 − 0{ T1 T2 123 123

Input from m1

3

Input from m2

Output

(11)

 0  0     λ1 = 0 ⇒ u 1 =  0 , λ2,3 = −1 ⇒ u 2 =  1  und      1  − 1

Through this formalism it is much easier to set up the differential equation system, because it is deducible directly from the net structure. However, the inversion, i. e. attaining the net structure from the equation system, is not unambiguous and hence not applicable.

 1   u3 =  0   − 1  

For other dynamic transposition behaviours it is also possible to define formalisms, which allow the deduction of the differential equation system from the net structure, like with the integrator. 3.2. Solution of the differential equation system

The column vectors xi of the fundamental matrix can be calculated after equations (14) and (15), respectively:

The differential equation system (10) was intentionally put in .

the form M = A ⋅ M

 0   x 1 =  0 , x = e − t  1 2  

because this is a linear differential

equation system with constant coefficients, whose solution results from the Eigenvalues and the Eigenvectors [10]. The solution of such a differential equation system is: M =W⋅K with:

0 0  W =  0 e−t  1 − e −t 

The fundamental matrix is a quadratic matrix, whose dimension n corresponds to the number of unknowns. The column vectors xi come in the form of finite sums:

 mt (t ) = e −t  t ⋅ e −t m2 (t ) = m (t ) = 1 − (1 + t ) ⋅ e − t  3

1. For every Eigenvector v of order l to the Eigenvalue µ of the matrix A

(14)

From the start marking the constants vector K results in: (15)

Here the existence of the inverse to the matrix W is guaranteed n for any time t, because W constitutes a basis for the space R . Supposed, e. g., that T1 = T2 = 1s, then the matrix A for the example in fig. 6 is concretely:  − 1 0 0   A =  1 − 1 0  0 1 0 

(20)

The marking courses of p1, p2 and p3 are depicted graphically in fig. 7. It can be clearly seen that the sum of the markings are equal to unity at any time t, which upholds the conservativity of markings within that net. Here an analogy between marking and energy can be found, too. On the other hand, m1 has qualitatively the same course during time as the Marking of Place p1 from the elementary example (cf. equation (7) and fig. 2). This is because in both nets the Marking of Place p1 is influenced by the integrating transition t1 only.

t2 ⋅(A − 2!

K = W −1 ( t = 0) ⋅ M 0

(19)

T

(13)

t l −1 ⋅ ( A − µ ⋅ E ) l −1 ⋅ v ] (l − 1)!

   − (1 + t ) ⋅ e − t  e −t t ⋅ e−t

If now the start marking M0 = (1 0 0) is inserted into the T equation (16), the constants vector is K = (1 0 1) The solution of the differential equation system is then:

1. For every Eigenvector u to the Eigenvalue λ of the matrix A

µ ⋅ E)2 ⋅ v + ⋅ ⋅ ⋅ +

(18)

and hence:

M: Marking W: fundamental matrix (Wronski matrix) K: constant vector

xi (t ) = e µt ⋅ [v + t ⋅ ( A − µ ⋅ E ) ⋅ v +

 0   ⋅  1  und  − 1  

 1   0      x 3 = e − t ⋅  0  + t ⋅  1        − 1  − 1  

(12)

xi ( t ) = e λt ⋅ u

(17)

m 1 Sum m3 m2 m1

(16) t

The matrix A has got three Eigenvalues, namely λ1 = 0 and λ2,3 = –1. For these Eigenvalues there are the following Eigenvectors, respectively:

fig. 7: Marking course of p1, p2 and p3 3.3. Elaboration of a basic equation

In the differential equation system (10) the inflows and .

outflows

4

.

.

.

m1,out , m2 ,in , m2 ,out and m3,in

appeared

and

were

 m1   1  − 1 0  0         S (t1 )   m2  =  0 +  1 − 1 ⋅  ( 0 S t 2 )        1  m3   0  0

eliminated afterwards. Due to the conservativity of markings the following equations hold: . m1,out . m2 ,out

.

= V1

.

.

= V2

= m2 ,in

V ⋅ 1  V2

.

= m3,in

(21)

As these flows are specific to the transition, they are called firing speeds and are attached an index that corresponds to the index of the affiliated transition. The firing speed vector T V = (V1, V2) can be obtained as in chapter 3.2: (22)

Herein, WV is a partial matrix from W, which contains the fundamental solution of the inflows or outflows, respectively. Hence, the firing speeds are: V1 (t ) = 1 − e −t  −t V2 (t ) = 1 − (1 + t ) ⋅ e

(23)

Analogous to chapter 2 a basic equation for this continuous Petri Net can now be formulated, which describes both the structure (incidence matrix) and the dynamics (firing speed vector) of the net. This equation looks very much like equation (7):

 m1   1  −1 0         V1  m2  =  0 +  1 − 1 ⋅        V2  m3   0  0 1  {

  = 1 − (1 + t ) ⋅ e  =

1− e

step i+1 (discrete):

(24)

However, equation (24) assumes that all transitions are fireable at any time. But this is not the case if e. g. discrete parts of the net bias the continuous transitions as in fig. 8, where the Places p4 and p6 can influence the activity of the transitions t1 and t2. p5

t3

t5

t6

p4 p1

t1

Integrator T1

1. Setting up a differential equation system that describes the net behaviour and in which the firing speeds of the transitions are not eliminated. 2. Finding a fundamental solution.

p6 p2

t2

(27)

From the procedure described above a methodology can be derived that allows a formal description of hybrid systems. The method consists of two steps:

p7

t4

(26)

The problem of these two equations lies in the activity of the transitions, which do not depend only on the Marking of the preceding step but also on the current Marking. That means that a combination of real marking values according to a procedure to be defined should yield a BOOLEan functional value. The papers of [5] and [11] with the multilinear functions for discrete systems can serve as a starting point for developing such procedures.

M0

Discrete

M i +1 = M i ,end + C ⋅ V

step i+2 (continuous): −1 M i + 2 = M i +1 + C ⋅ S ⋅ W V ⋅ W V (t = 0) ⋅ V

−t

−t

 1 − e −t =  = 1 − (1 + t ) ⋅ e − t 

In hybrid systems continuous processes occur that are described by different differential equation systems and interrupted by discrete events. After the interruptions the continuous processes are continued with new starting conditions. Therefore, the behaviour of a hybrid system is to be regarded as an alternation between continuous processes and discrete events. The continuous processes are referred to as modes and the discrete events are called steps. In a hybid Petri Net the discrete events are expressed in accordance with equation (1), while the continuous processes are described through an equation like equation (25). Switching the continuous behaviour of a differential equation system to another is referred to as a mode change, in this context [14]. Hence we can formulate a recursive equation to describe the entire behaviour. Under the th assuption that the i step is continuous and that the end marking of this step is Mi,end, the following basic equations are obtained:

−1

V = W V ⋅ W (t = 0) ⋅ M 0

(25)

Inserting the starting conditions into the equations (26) and (27) makes it possible to express the courses of the Markings for each step in an explicit form. In this process the activity of the transition decides whether the firing speed is considered in the solution. The transitions with their firing speeds can be regarded as funcion blocks (similar to block circuit diagrams), which are activated or deactivated depending on the activity of the transition.

p3

Integrator T2

continuous

fig. 8: Hybrid Petri Net

3.4. Evolution graph

The activation of the transitions is taken into consideration by multiplying each component of the firing speed vector in equation (24) with a binary function S(ti) that corresponds to the activity of the affiliated transition ti. The multiplication component by component can by expressed by the multiplication of the firing speed vector and a diagonal matrix S:

Analogous to the papers of [4] a representation for hybrid Petri Nets can be developed according to the occurrence graph of discrete nets. Such a construction is referred to as evolution graph. The evolution graph, like the occurrence graph, consists of two elements, i. e. locations and arcs (fig. 9).

5

Workpiece

m1 = 0 m2 = 0

Drilling machine

Store

m3 = 0 t =0

-1

m1 = - 1 m1 T1 m2 = 1 m1 - 1 m2 T1 T2 m3 = 1 m2 T2 t

Suggest Documents