Pierre-Olivier Lamare
email: pierre-olivier.lamare@imag.fr

Antoine Girard
email: antoine.girard@imag.fr.

Christophe Prieur
email: christophe.prieur@gipsa-lab.fr

P.-O Lamare

Lyapunov techniques for stabilization of switched linear systems of conservation laws

In this paper, the exponential stability in L 2norm is investigated for a class of switched linear systems of conservation laws. The state equations and the boundary conditions are both subject to switching. We consider the problem of synthesizing stabilizing switching controllers. By means of Lyapunov techniques, three control strategies are developed based on steepest descent selection, possibly combined with a hysteresis and a low-pass filter. Some numerical examples are considered to illustrate our approach and to show the merits of the proposed strategies.

I. INTRODUCTION

Physical networks may be represented by hyperbolic partial differential equations in one space dimension, yielding systems of conservation laws or balance laws. Among the different networks, we have in mind the hydraulic networks (see [START_REF] Diagne | Lyapunov exponential stability of 1-d linear hyperbolic systems of balance laws[END_REF], [START_REF] Santos | Boundary control of open channels with numerical and experimental validations[END_REF]), road traffic networks (see [START_REF] Haut | A second order model of road junctions in fluid models of traffic networks[END_REF]), or gas pipeline networks (see [START_REF] Gugat | Gas flow in fan-shaped networks: Classical solutions and feedback stabilization[END_REF]). Due to the range of those applications in the engineering field, an important research on the theorical aspects in modelling and control of such systems is made. The present paper deals with switched linear systems of conservation laws, and their control.

In such systems, some parameters may evolve in time. For example, it can be the boundary conditions in an open channel controlled by mobile spillways, or the state equations of a road where the speed limitation changes during the time. Of course, the state equations and the boundary conditions can both be subject to abrupt changes. Therefore a switched system occurs: a system where there is both a continuous dynamic (given by the state equation) and a discrete dynamic (given by a switching signal).

Some results are available in literature for the stability and stabilizability of switched hyperbolic systems of balance laws or conservation laws. In [START_REF] Prieur | Lyapunov functions for switched linear hyperbolic systems[END_REF] some sufficient conditions for the asymptotic stability are stated, uniformly with respect to a class of switching signals. In [START_REF] Amin | Exponential stability of switched linear hyperbolic initial-boundary value problems[END_REF], a result of stability is given under an arbitrary switching signal using the propagation of the solution along the characteristics. For switched systems governed by semigroups of linear evolution operators and their stability under an arbitrary switching signal, see [START_REF] Hante | Converse Lyapunov theorems for switched systems in Banach and Hilbert spaces[END_REF]. In [START_REF] Gugat | Stars of vibrating strings: switching boundary feedback stabilization[END_REF] a star-shaped network with a central node, and the wave equation governing on each edge, is studied. It is shown that a switching feedback stabilization at the exterior end of the edge is effective under some sufficient conditions. Moreover it is proved that the problem has solutions under the proposed switching rule. The wellposedness issue and the dependence of the solutions on the initial data for a networked transport systems defined on directed graph is explored in [START_REF] Hante | Modeling and analysis of modal switching in networked transport systems[END_REF], while an analysis based on functions of bounded variation in an extended way is used in [START_REF] Hante | An augmented BV setting for feedback switching control[END_REF] to prove well-posedness for a quasilinear system of first-order hyperbolic PDEs. In this last two references the switching modeling is view as a tool for systems for which different time and spatial scales interact.

An approach commonly used to study the stability and to design the boundary control of system of conservation laws is the Lyapunov analysis [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF], [START_REF] Diagne | Lyapunov exponential stability of 1-d linear hyperbolic systems of balance laws[END_REF]. In this paper we use this approach (as in [START_REF] Prieur | Lyapunov functions for switched linear hyperbolic systems[END_REF]) to design three swiching rules for our switched hyperbolic system of conservation laws. We show that, under a sufficient condition, global exponential stability in L 2 -norm is obtained with these switching rules. The sufficient condition takes the form of a linear matrix inequality (LMI). Hence the verification of this condition is expressed as an optimization program, which can be solved numerically. Moreover an upper bound on the speed of convergence is given, and it is possible to numerically optimize it in the three cases proposed in this paper.

The paper is organized as follows. In Section II, we introduce the class of switched linear hyperbolic systems of conservation laws considered in this paper. In Section III, the common Lyapunov function used in our analysis is introduced, and some preliminary results are derived, then the three switching rules are proposed, with the corresponding results obtained with them. Finally in Section IV, an example is studied to illustrate our main results.

Due to space limitation, the proofs of all results are omitted.

Notation. The set R + is the set of nonnegative real numbers. The set of square real matrices of dimension n is denoted by R n×n . Given a matrix A, the transpose of the matrix A is denoted by A ⊤ . Given n real numbers a 1 , . . . , a n the matrix A ∈ R n×n with these numbers on the diagonal is denoted by diag(a 1 , . . . , a n ). The identity matrix of dimension n is denoted by I n , while the zero matrix of dimension n is denoted by 0 n . For a symmetric matrix A ∈ R n×n , A being positive definite is denoted A > 0, while A being positive semi-definite is denoted A ≥ 0. The usual Euclidian norm in R n is denoted by |.|. The set of functions y :

[0, 1] → R n such that |y| 2 L 2 ([0,1]) = 1 0 |y(x)| 2 dx < ∞, is denoted by L 2 ([0, 1]).

II. PROBLEM FORMULATION

We are concerned with n × n linear hyperbolic systems of conservation laws of the form:

         ∂ t y(t, x) + Λ σ(t) ∂ x y(t, x) = 0 , t ∈ R + , x ∈ (0, 1) , (1a)
y(t, 0) = G σ(t) y(t, 1) , t ∈ R + , (1b) y(0, x) = y 0 (x) x ∈ [0, 1] , (1c)
where y : [0, 1] × R + → R n , σ : R + → I where I = {1, . . . , N } is a finite set of indices. The function σ is called switching signal of the system. The times of discontinuities of σ, 0 < t 1 < t 2 < . . . are called switching times.

For all i ∈ I, G i belongs to R n×n , Λ i is a diagonal posi- tive definite matrix in R n×n i.e. Λ i = diag(λ i,1 , . . . , λ i,n ) for suitable positive values λ i,1 . . . λ i,n .
Now we explicit the type of function y that we consider for the solution of system (1).

Definition 2.1:

A piecewise continuous function y : [0, 1] → R n is a continuous function on [0, 1] except maybe on a finite number of points 0 = x 0 < x 1 < • • • < x p = 1
such that for all l ∈ {0, . . . , p -1} there exists y l continuous on [x l , x l+1 ] and y l = y |(x l ,x l+1 ) . The set of all piecewise continuous functions is denoted by C pw ([0, 1]).

Let

y = max max l∈{0,...,p} {|y(x l )|} , max l∈{0,...,p-1} y |(x l ,x l+1 ) L ∞ .
(2) One easily verifies that . is the classical norm L ∞ for the space C pw ([0, 1]). Now we assume that the initial data y 0 lies in 1) is linear and continuous. In this paper it is assume that the function y(t, •) lies in C pw ([0, 1]) for all t ≥ 0, so the number of discontinuities in the solution is supposed to grow but staying finite along the time. In other words, the results presented in this paper are valid as long as no Zeno behaviors occur (see [START_REF] Liberzon | Switching in systems and control[END_REF] for example for a definition of this phenomena).

C pw ([0, 1]). The trace of y ∈ C pw ([0, 1]) is well defined. Indeed the application T : (C pw ([0, 1]), . ) → (R n , |.|), T : y → y(
The aim of this work is to design an output controller. It will be a switching rule which depends only on the measurement at the boundary of the domain, in order to stabilize the system in the following sense: Definition 2.2: Given a switching signal, system ( 1) is said to be globally exponentially stable (in L 2 -norm), if there exist positive constants c and α such that the solution of (1) exists, is unique and satisfies the inequality

|y(t, •)| L 2 ([0,1]) ≤ ce -αt y 0 L 2 ([0,1]) , (3)
for all t ≥ 0.

Now, we will make clear the notion of switching signal dependent of the measurement at the boundary. In general, the state of a hyperbolic system of conservation laws is measured at the boundaries of the domain thanks to a set of sensors. In our case the system is only observed at the point x = 1 at any time because of the positive values of velocities λ i,1 . . . λ i,n . The sensor values are defined as

w(t) = y(t, 1) . ( 4
)
The output function is defined as soon as y(t, •) ∈ C pw ([0, 1]), since the trace of a function in C pw ([0, 1]) is well-defined (see above).

According to the sensor values, the system (1) will evolve in a particular mode. Thus the switching rule is denoted by

σ[w] : R + → I t → σ[w](t) . (5)
Moreover the switching rule is a causal decision: the switching rule does not depend on the future value of the system state but only on current and past values. Mathematically it can be written as follows:

w(t) = w ′ (t) , ∀t ∈ [0, τ ] ⇒ ∀t ∈ [0, τ ] , σ[w](t) = σ[w ′ ](t) .
To summarize, the process evolves in a mode, a sensor measures the state w(t) of the process at the boundary, then depending on this value, a switching rule imposes the mode in which the system must evolve afterwards.

In order to design this switching rule, we will perform an analysis based on Lyapunov techniques.

Let us conclude this section with two remarks. Remark 2.3: In system (1), the matrices Λ i are diagonal positive definite. This assumption is made only for the sake of simplicity in our analysis. Indeed we can consider more general diagonal matrices for Λ i . Suppose that there exists m > 0 such that for all i ∈ I, Λ i is a diagonal matrix satisfying Λ i = diag(λ i,1 , . . . , λ i,n ) with λ i,k > 0 for k ∈ {1, . . . , m} and λ i,k < 0 for k ∈ {m + 1, . . . , n}. The matrices Λ i are written as

Λ i = Λ + i 0n-m,m 0m,n-m Λ - i
, where

Λ + i = diag(λ i,1 , . . . , λ i,m ) and Λ - i = diag(λ i,m+1 , . . . , λ i,n
) are respectively diagonal positive definite matrices and diagonal negative definite matrices. We introduce the notations y + = (y 1 , . . . , y m ) ⊤ , y -= (y m+1 , . . . , y n ) ⊤ , such that y = (y + , y -) ⊤ . The system in its general form is

             ∂ t y(t, x) + Λ σ[w](t) ∂ x y(t, x) = 0 , t ∈ R + , x ∈ (0, 1) , (6a)
y + (t, 0) y -(t, 1) = G σ[w](t) y + (t, 1) y -(t, 0) , (6b)
y(0, x) = y 0 (x) , (6c)
where

G i = G ++ i G +- i G -+ i G -- i , such that G ++ i , G +- i , G -- i and G -+ i
are matrices respectively in R (n-m)×(n-m) , R (n-m)×m , R m×(n-m) and R m×m . By the change of variable z(t, x) = ( y + (t,x),y -(t,1-x) )

⊤ we obtain a new system in the same form as [START_REF] Amin | Exponential stability of switched linear hyperbolic initial-boundary value problems[END_REF].

As in [START_REF] Prieur | Lyapunov functions for switched linear hyperbolic systems[END_REF] only the case where the number of negative and positive eigenvalues of Λ i are the same, for all i ∈ I, is considered.

• Remark 2.4: An attractive result to analyze the stability of the systems without switching is given in [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF]. With the same notation of [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF], for all matrices M ∈ R n×n we denote

ρ 1 (M ) = inf ∆M ∆ -1 , ∆ ∈ D n,+ ,
where D n,+ denotes the set of diagonal positive definite matrices in R n×n . Thanks to Proposition 3.2 of [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF] one has that, for all matrices M ∈ R n×n ,

ρ 1 (M ) ≤ ρ(|M |) ,
where ρ(|M |) denotes the spectral radius of the matrix whose elements are the absolute values of the elements of M . Theorem 2.3 of [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF] gives the following result: if ρ 1 (G) < 1 then the system (1) without switching is stable, and a fortiori if ρ (|G|) < 1 the same result is obtained. We will use this result for the example of Section IV below.

•

III. STABILIZATION A. Lyapunov function

In this section, preliminary results on Lyapunov functions are derived. Following [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF], the candidate Lyapunov function that is considered in this paper is written as, for all y ∈ L 2 ([0, 1]),

V (y) = 1 0 y(x) ⊤ Qy(x)e -µx dx, µ > 0 , (7)
for a given diagonal positive definite matrix Q ∈ R n×n . For the system with any constant control input σ(t) = i, it is shown in [START_REF] Coron | Dissipative boundary conditions for one-dimensional nonlinear hyperbolic systems[END_REF] that ρ 1 (G i ) < 1 is a sufficient condition for the existence of a Lyapunov function of the form (7) that stabilizes system (1). Let y be a solution of system (1). We shall denote in the following

∀t ≥ 0, V = V (y(t, •)) and V = d dt V (y(t, •)) . (8)
In the sequel, we denote by λ the smallest eigenvalue of the matrices Λ i , for all i ∈ I,

λ = min i∈{1,...,N } min j∈{1,...,n} λ i,j . (9)
With these notations at hand we are able to state our first lemma, giving an inequality for the time derivative of V along the solutions of the switched system of conservation laws [START_REF] Amin | Exponential stability of switched linear hyperbolic initial-boundary value problems[END_REF]. This inequality will be useful to design the switching rules, and to give the proof of stability of the system (1) with them.

Lemma 3.1: The time derivative of the candidate Lyapunov function V along the solution of (1) satisfies V ≤ -2αV + q i (w(t)) , [START_REF] Hante | An augmented BV setting for feedback switching control[END_REF] where i ∈ I is the active mode at time t, q i (w(t)) = w(t) ⊤ G ⊤ i QΛ i G i -QΛ i e -µ w(t) and α = 1 2 µλ. Remark 3.2: Lemma 3.1 still holds when Q is a symmetric, positive definite matrix such that Q and Λ i commute for all i ∈ I.

•

B. Switching strategies 1) Argmin:

In this section, we consider the closed-loop dynamics of the switched system of conservation laws (1) when using output definition [START_REF] Evans | Partial Differential Equations[END_REF].

Following the idea developed in [START_REF] Geromel | Stability and stabilization of discrete time switched systems[END_REF] and recalling the notation q i in Lemma 3.1 we define the memoriless switching rule σ[w](t) = arg min i∈{1,...,N }

q i (w(t)) . ( 11
)
The idea of the argmin switching rule is to choose the mode which optimizes the decrease of the Lyapunov function at any time. So we need a condition which ensures that there always exists a mode for which the system is decreasing. To this end, let us define the simplex

Γ := γ ∈ R N N i=1 γ i = 1, γ i ≥ 0 . ( 12
)
To study the stability of the switched system of conservation laws (1) we need the following Assumption 3.3: There exist γ ∈ Γ, a diagonal definite positive matrix Q and a parameter µ > 0 such that

N i=1 γ i G ⊤ i QΛ i G i -e -µ QΛ i ≤ 0 . ( 13
)
Remark 3.4: An important issue is the numerical computation of γ ∈ Γ, µ > 0 and of a diagonal positive definite matrix Q such that (13) holds. In the case where N = 2 a solution consists in performing a line search over the parameters γ and µ and, for each pair (γ, µ), to solve a convex problem in the variables Q written in terms of the LMI [START_REF] Kvasnica | Multi-Parametric Toolbox[END_REF]. This can be done numerically in polynomial time. Otherwise the problem is bilinear and the numerical verification of Assumption 3.3 can be quite complex.

• Remark 3.5:

Denoting P i = Λ 1 2 i G i Λ -1 2
i , the condition ( 13) is rewritten as

N i=1 γ i P ⊤ i QP i -e -µ Q ≤ 0.
As noted in [START_REF] Geromel | Stability and stabilization of discrete time switched systems[END_REF] this last condition implies that the convex combination P γ = N i=1 γ i P i is asymptotically stable. Thus to check the existence of a matrix Q and a positive parameter µ such that Assumption 3.3 holds, it is useful to verify the existence of a stable convex combination of matrices P i . The converse does not hold in general: the existence of a stable P γ does not imply that Assumption 3.3 holds.

• Assumption 3.3 implies that there always exists a mode i ∈ I such that q i (w(t)) ≤ 0. Thus we can give our first result of exponential stability of the system (1) with the argmin switching rule.

Theorem 3.6: Under Assumption 3.3, system (1) with switching rule [START_REF] Hante | Converse Lyapunov theorems for switched systems in Banach and Hilbert spaces[END_REF] is globally exponentially stable. More precisely, letting V and α as in Lemma 3.1, (3) holds along the solutions of ( 1) with [START_REF] Hante | Converse Lyapunov theorems for switched systems in Banach and Hilbert spaces[END_REF].

2) Argmin with hysteresis: The first result shows that under Assumption 3.3, the switched system of conservation laws (1) with the argmin switching rule is globally exponentially stable. The limitation of this rule is a possible fast switching behavior (see Table I in Section IV for Inv: an example). Unfortunately, in many applications this is undesirable. So the goal is to use strategies to slow down the switching. The first one is the hysteresis strategy.

q σ[w](t -) (w(t)) < 0 q σ[w](t -) (w(t)) = 0; σ[w](t) := arg min i∈{1,...,N } q i (w(t))
For all t > 0 we denote by σ[w](t -) the limit from the left of t of the value of σ[w](t). Roughly speaking, it is the value of σ[w] "just before t".

The strategy is the following:

σ[w](t) = σ[w](t -) , if q σ[w](t -) (w(t)) < 0 , arg min i∈{1,...,N } q i (w(t)), if q σ[w](t -) (w(t)) = 0 . ( 14
)
This strategy is illustrated by an automaton in Figure 1. The automaton must be understood as follows: while the property q σ[w](t -) (w(t)) < 0 holds, the mode does not change, whereas if the equality q σ[w](t -) (w(t)) = 0 holds then there is a transition between the mode where the system was evolving and a new mode. This transition is represented by the arrow on the right of the automaton. To know the new mode where the system has to evolve there is a computation of σ[w](t) := arg min i∈{1,...,N } q i (w(t)).

With Assumption 3.3 at hand the global exponential stability of the argmin switching rule with hysteresis may be stated: Theorem 3.7: Under Assumption 3.3, system (1) with switching rule [START_REF] Liberzon | Switching in systems and control[END_REF] is globally exponentially stable. More precisely, letting V and α as in Lemma 3.1,[START_REF] Diagne | Lyapunov exponential stability of 1-d linear hyperbolic systems of balance laws[END_REF] holds along the solutions of ( 1) with [START_REF] Liberzon | Switching in systems and control[END_REF].

Remark 3.8: The parameter µ plays a special feature with this strategy. Indeed, the quadratic function q i , i = 1 . . . N , define conic regions

Ω i := {x ∈ R n | q i (x) ≤ 0 } . ( 15
)
These regions may overlap, and their union is R n by Assumption 3.3. The switching signal changes of mode when the system trajectory hits the boundary of a region, and the next switching happened only if the trajectory leaves an overlap region. For a geometrical illustration of the hysteresis behavior see Figure 2 in the case of two conic regions Ω 1 and Ω 2 . A question of interest with the hysteresis is the size of the overlap regions. Indeed, larger is the overlap regions larger is the minimum time between two switching times. In [START_REF] Kvasnica | Multi-Parametric Toolbox[END_REF] the parameter µ has a direct influence on the size of the overlap region: largest is µ smaller is the overlap region. Therefore a special care in the value of µ has to be taken.

•

Ω 1 Ω 2
Fig. 2. A possible trajectory for the system. The first conic region Ω 1 is in plain line, the second Ω 2 is in dashed line. The overlap regions are filled in gray.

ṁ(t) = -2αm(t) +q σ[w](t -) (w(t)) Inv: m(t) < 0 m(t) = 0; σ[w](t) := arg min i∈{1,...,N } q i (w(t))
Fig. 3. Argmin, hysteresis and filter automaton.

3) Argmin, hysteresis and filter: Thanks to Lemma 3.1 it holds

V ≤ -2αV + q σ[w](t) (w(t)) . (16)
Keeping in mind the objective of decreasing the number of switching times, a low-pass filter is added to the switching rule ( 14): instead of imposing that q σ[w](t) (w(t)) ≤ 0 at any time t ≥ 0, we just impose that a weighted averaged value of q σ[w](s) (w(s)) is negative or zero. Let us define:

m(t) = e -2αt t 0 e 2αs q σ[w](s) (w(s))ds , ∀t ≤ 0 , (17)
where α is the coefficient of decay of the system as in [START_REF] Prieur | Lyapunov functions for switched linear hyperbolic systems[END_REF]. The time derivative of m is given by

ṁ(t) = -2αm(t) + q σ[w](t) (w(t)) . (18)
The control consists in keeping m(t) negative or zero at any time (see automaton in Figure 3). The justification for the choice of the function m comes from Gronwall's inequality [see for example [5, pages 708-709]]. Roughly speaking, the rule consists in doing the average of q σ[w](s) (w(s))s with different weights given by e αs in the formula. The close past has as much weight in the average than the far past. An explicit description could stated as follow:

σ[w](t) = σ[w](t -) , if m(t) < 0 , arg min i∈{1,...,N } q i (w(t)) if m(t) = 0 . (19)
So we are able to give our last result of global exponential stability with the above strategy when Assumption 3.3 is satisfied: The first switching rule is based on an argmin computation. It allows to maximize the decay rate of the Lyapunov function at any time. In order to decrease the number of switches in a time interval, a hysteresis strategy to this rule was added. It means that the system stays in the current mode, if it makes the Lyapunov function decrease. In order to reduce again the number of switches a low-pass filter was added to the last rule.

A sufficient condition on the matrices G i and Λ i has been derived to get the exponential stability of the system with these three switching rules. Finally, an example was given to illustrate the results.

This work leaves many questions open. In particular, question of existence of solutions has to be investigated when closing the loop with a switching rule. In our analysis we have supposed that y lies in C pw ([0, 1]) but this assumption was not checked with the three rules (but observed only numerically). Furthermore the overshoot reduction, or time performance may be tackled in a future work.

Fig. 1 .

 1 Fig. 1. Argmin with hysteresis automaton.

Fig. 5 .

 5 Fig. 5. Time evolution of the first component y 1 (top) and of the second component y 2 (bottom) of the solution of (1) with the argmin rule for the example.

  Given a continuous function y on an open interval (x 1 , x 2 ) and taking value in R n , the infinity norm is denoted by |y| L ∞ = inf {C; |y| ≤ C a.e.}. The restriction of a function y : [0, 1] → R n on an open interval (x 1 , x 2 ) ⊂ [0, 1] is denoted by y |(x1,x2) .

TABLE I COMPARISON

 I OF THE DIFFERENT SWITCHING STRATEGIES FOR THE EXAMPLE WITH THREE INITIAL CONDITIONS IN L 2 ([0, 1]) BASIS.PERFORMED DURING 10 UNITS OF TIME.

		Argmin	Hysteresis	Low-pass filter
	Initial condition	Exponential	Exponential	Exponential
	y 0 k	Stability.	Stability.	Stability.
		Lyapunov	Lyapunov
		Function.	Function.
	Theoretical bound on the speed of convergence: 0.05
		(without optimization on µ)
		Number of switches by time unit.
	k = 1	4.2	2.8	0.2
	k = 2	21.2	13.7	0.1
	k = 3	18.5	17.1	0.1
		Speed of convergence
	k = 1	1.4278	1.3393	0.0960
	k = 2	1.6332	1.5466	0.1279
	k = 3	1.4989	1.4596	0.1209
	Theoretical bound on the speed of convergence: 0.2275
		(with optimization on µ)
		Number of switches by time unit.
	k = 1	4.2	4.2	0.4
	k = 2	21.2	21.3	0.3
	k = 3	18.5	18.4	0.3
		Speed of convergence
	k = 1	1.4455	1.4461	0.3851
	k = 2	1.6510	1.7648	0.3607
	k = 3	1.5166	1.5751	0.3508

This work has been partially supported by the LabEx PERSYVAL-Lab ANR-11-LABX-0025 and by PHC TOURNESOL FR 2013.

Theorem 3.9: Under Assumption 3. [START_REF] Diagne | Lyapunov exponential stability of 1-d linear hyperbolic systems of balance laws[END_REF], system [START_REF] Amin | Exponential stability of switched linear hyperbolic initial-boundary value problems[END_REF] with the switching rule ( 19) is globally exponentially stable. More precisely, letting V and α as in Lemma 3.1,[START_REF] Diagne | Lyapunov exponential stability of 1-d linear hyperbolic systems of balance laws[END_REF] holds along the solution of ( 1) with (19).

Remark 3.10: It must be stressed for this last case that the candidate Lyapunov function is not monotonically decreasing contrarily to the two precedent cases. Indeed the strict decrease of V is not obtained. Nonetheless the global exponential stability is proved thanks to the good property of the function V .

•

IV. SIMULATIONS

Let us illustrate our main results by means of numerical simulations. It will illustrate also the interest of the switching strategies when the system of conservation laws (1) is unstable for any constant switching signal σ(t) = i.

Consider the system (1) with two modes (I = {1, 2}). The initial conditions are selected as the first three elements of an orthonormal basis of L 2 ([0, 1]). More specifically the following three initial conditions It is a necessary condition but not a sufficient one. The instability of the system with the proposed matrices is checked numerically with a Weighted Essentially Non Oscillatory scheme (see [START_REF] Liu | Weighted essentially non-oscillatory schemes[END_REF]). Boundary matrices G 1 and G 2 are proposed as

The respective spectrum of |G 1 | and |G 2 | is {0.1; 1.1} and {0.0196; 1.0196}. See Figure 4 for the constant control input i = 1 and the initial condition y 0 2 (x) where the instability is observed. Firstly the parameter µ is fixed to the value 0.1. The Lyapunov matrix Q is set as identity matrix in R 2×2 . With γ 1 = 1 4 and γ 2 = 3 4 , it is obtained

The eigenvalues of the previous matrix are: -1.1809 and -0.0861. Therefore it is a symmetric negative definite matrix, and Assumption 3.3 holds. The three rules proposed in Theorems 3.6, 3.7 and 3.9 stabilize the switched system (1). The time evolution of the two components with the argmin switching rule [START_REF] Hante | Converse Lyapunov theorems for switched systems in Banach and Hilbert spaces[END_REF] is shown in Figure 5 with the initial condition y 0 2 (x). The results obtained with the three switching rules are reported in Table I. As it was expected the switching rule [START_REF] Hante | Converse Lyapunov theorems for switched systems in Banach and Hilbert spaces[END_REF] is the one which produces larger number of switches by time unit, then it is the switching rule [START_REF] Liberzon | Switching in systems and control[END_REF]

and finally (19).

Up to now the speed of exponential convergence has been fixed, no optimization of µ has been done. Now, as it was aforementionned in Remark 3.4, the speed can be optimized by two line searches over µ and γ 1 (γ 2 is related to γ 1 by the relation γ 2 = 1γ 1 ). Thus it gives successive LMIs solved, e.g. by the Multi-Parametric Toolbox [START_REF] Kvasnica | Multi-Parametric Toolbox[END_REF]. The algorithm ends at the value µ = 0.455. The Lyapunov matrix Q is equal to the identity and γ 1 is found to be equal to 0.45. One checks that the rule [START_REF] Liberzon | Switching in systems and control[END_REF] gives more switching times with the optimized µ = 0.455 than with µ = 0.1, see the third column of Table I. This difference is due to the fact that the intersection of Ω 1 and Ω 2 (defined by ( 15)) is tighter with the optimized µ = 0.455 than with µ = 0.1, in other words the grey domain of Figure 2 is smaller. Furthermore, with argmin switching rule [START_REF] Hante | Converse Lyapunov theorems for switched systems in Banach and Hilbert spaces[END_REF] the number of switches per time unit is similar between the two cases, see second column of Table I. Despite the optimization on µ, the speed of convergence computed numerically along the solution to (1) is not better with the two first rules ( 11) and ( 14). However the speed of convergence seems to be larger with the switching rule (19) with the optimized µ = 0.455 than with µ = 0.1.

V. CONCLUSION

In this paper, three switching rules to stabilize hyperbolic systems of conservation laws of the form (1) have been derived. These switching rules correspond to an output feedback law. The analysis of exponential stability is based on Lyapunov techniques. This method has been adapted to the design problem of a stabilizing switching rule. The three switched controllers gave different performances which have been discussed and compared by some numerical simulations.


Roger Flage1

Piero Baraldi

Enrico Zio

Terje Aven

Roger Flage
email: roger.flage@uis.no.

Probability and possibility based representations of uncertainty in fault tree analysis

Keywords: risk analysis, epistemic uncertainty, fault tree analysis, possibility-probability (probability-possibility) transformation

Expert knowledge is an important source of input to risk analysis. In practice, experts might be reluctant to characterize their knowledge and the related (epistemic) uncertainty, using precise probabilities. The theory of possibility allows for imprecision in probability assignments. The associated possibilistic representation of epistemic uncertainty can be combined with, and transformed into a probabilistic representation; in the present paper we show this with reference to a simple fault tree analysis. We apply an integrated (hybrid) probabilistic-possibilistic computational framework for the joint propagation of the epistemic uncertainty on the values of the (limiting relative frequency) probabilities of the basic events of the fault tree, and we use possibility-probability (probability-possibility) transformations for propagating the epistemic uncertainty within purely probabilistic and possibilistic settings. The results of the different approaches (hybrid, probabilistic, possibilistic) are compared with respect to the representation of uncertainty about the top event (limiting relative frequency) probability. Both the rationale underpinning the approaches and the computational efforts they require are critically examined.

We conclude that the approaches relevant in a given setting depend on the purpose of the risk analysis, and that further research is required to make the possibilistic approaches operational in a risk analysis context.

INTRODUCTION

In engineering risk analysis, a distinction is commonly made between aleatory (stochastic) and epistemic (knowledge-related) uncertainty [START_REF] Apostolakis | The concept of probability in safety assessments of technological systems[END_REF][START_REF] Aven | Foundations of Risk Analysis: A Knowledge and Decision-Oriented Perspective[END_REF][START_REF] Helton | Guest editorial: treatment of aleatory and epistemic uncertainty in performance assessments for complex systems[END_REF] . Aleatory uncertainty refers to variation in populations. Epistemic uncertainty refers to lack of knowledge about phenomena, and usually translates into uncertainty about the parameters of a model used to describe random variation.

Whereas epistemic uncertainty can be reduced, aleatory uncertainty cannot, and for this reason it is sometimes called irreducible uncertainty [START_REF] Helton | Guest editorial: treatment of aleatory and epistemic uncertainty in performance assessments for complex systems[END_REF] .

Limiting relative frequency probabilities are typically used to describe aleatory uncertainty, and subjective probabilities have traditionally been used to describe epistemic uncertainty. (In the following, probability refers to the limiting relative frequency concept whenever preceded by the term frequency, and to the epistemic/subjective concept whenever used alone.) For example, NUREG-1855 [START_REF]NUREG-1855 -Guidance on the Treatment of Uncertainties Associated with PRAs in Risk-Informed Decision Making[END_REF] , which provides guidance on how to treat uncertainties associated with probabilistic risk assessment (PRA) in a risk-informed decision-making context, states that (epistemic) parameter uncertainty in PRA may be described using subjective probability.

However, several alternatives to probability as representation of epistemic uncertainty have been suggested. These include imprecise or interval probability [START_REF] Coolen | On the use of imprecise probabilities in reliability[END_REF][START_REF] Coolen | Imprecise probability: A concise overview[END_REF][START_REF] Utkin | Imprecise reliability: An introductory overview[END_REF][START_REF] Walley | Statistical Reasoning with Imprecise Probabilities[END_REF][START_REF] Weichselberger | The theory of interval-probability as a unifying concept for uncertainty[END_REF] , probability bounds (p-box) (10,11) , fuzzy set theory [START_REF] Unwin | A fuzzy set theoretic foundation for vagueness in uncertainty analysis[END_REF][START_REF] Zadeh | Fuzzy sets[END_REF] , fuzzy probability [START_REF] Zadeh | Probability measures of fuzzy events[END_REF] , the theory of possibility [START_REF] Dubois | Possibility theory and statistical reasoning[END_REF][START_REF] Dubois | Possibility Theory: An Approach to Computerized Processing of Uncertainty[END_REF][START_REF] Zadeh | Fuzzy sets as a basis for a theory of possibility[END_REF] and the theory of belief functions [START_REF] Shafer | A Mathematical Theory of Evidence[END_REF] , also known as evidence theory or the Dempster-Shafer theory of evidence.

Specifically, it has been suggested that a possibilistic representation of epistemic uncertainty may be more adequate when sufficiently informative hard data are not available for statistical analysis and thus one has to resort to information provided by experts, mostly of qualitative nature.

Indeed, expert statements are an important source of input to risk analysis. However, an expert often does not have sufficiently refined knowledge or opinion to characterize epistemic uncertainty in terms of a probability (distribution). In these cases, the two measures of likelihood, namely possibility and necessity measures, offered by the possibility theory may be interpreted as lower and upper probabilities in the representation of imprecision in the experts' probability assignments.

The possibilistic representation of uncertainty can both be combined with and transformed into the traditional probabilistic representation. In this respect, an integrated ('hybrid') computational framework has been proposed for jointly propagating probabilistic and possibilistic representations through a model [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] . This framework has previously been tailored to event tree analysis [START_REF] Baraldi | A combined Monte Carlo and possibilistic approach to uncertainty propagation in event tree analysis[END_REF] and fault tree analysis [START_REF] Flage | Handling epistemic uncertainties in fault tree analysis by probabilistic and possibilistic approaches[END_REF] , allowing for the epistemic uncertainties on basic event frequency probabilities to be represented and propagated using both probability and possibility distributions.

Furthermore, procedures for the transformation from a possibilistic representation to a probabilistic one, and vice versa, have been suggested [START_REF] Dubois | On possibility/probability transformations[END_REF] . The transformations are not one-toone, and going from possibility (probability) to probability (possibility) some information is introduced (lost) in the transformation procedure. However, certain principles can be adopted so that there is minimum loss (introduction) of (artificial) information.

In the present paper, we extend the previous work on the hybrid procedure by applying some of the possibility-probability (probability-possibility) transformations of the literature. The different results obtained are then compared, focusing on the representation of uncertainty about the top event frequency probability, in relation to the rationale of the approaches as well as the computational efforts required. More broadly, the purpose of the paper is to review available options of epistemic uncertainty representations and evaluate their rationale and appropriateness in relation to risk analysis.

To keep the analysis simple and thus retain a clear view of each step, the object of study is a fault tree with only two basic events linked to the top event through an OR-gate. We then avoid that computational challenges related to FTA (see e.g. [START_REF] Epstein | Can we trust PRA? Reliability Engineering & System Safety[END_REF][START_REF] Cepin | Analysis of truncation limit in probabilistic safety assessment[END_REF] ) interferes with the analysis. The basic events are assumed to be independent and to have unknown frequency probabilities of occurrence. Uncertainty about one of the basic event frequency probabilities is described probabilistically, and uncertainty about the other possibilistically.

In a fault tree analysis case study [START_REF] Rao | Epistemic uncertainty propagation in reliability assessment of complex systems[END_REF] with a similar objective as the present paper, uncertainty quantification based on Dempster-Shafer theory is explored when some model parameters are assigned probability distributions and the remainder fuzzy membership functions. The representation and propagation of uncertainty about basic event frequency probabilities in fault tree analysis using evidence theory is considered in [START_REF] Limbourg | Modelling uncertainty in fault tree analyses using evidence theory[END_REF] . In [START_REF] Tanaka | Fault tree analysis by fuzzy probability[END_REF][START_REF] Liang | Fuzzy fault tree analysis using failure possibility[END_REF][START_REF] Huang | A fuzzy set approach for event tree analysis[END_REF] basic event frequency probabilities are treated as trapezoidal fuzzy numbers and the extension principle is applied to compute the frequency probability of occurrence of the top event. In order to deal with repeated basic events in fault tree analysis, a simple method for fuzzy fault tree analysis based on the α-cut method, also known as resolution identity, is presented in [START_REF] Soman | Fuzzy fault tree analysis using resolution identity and extension principle[END_REF] . A formal probabilistic (Bayesian) procedure for the use of expert opinions in the context of fault tree analysis is presented in [START_REF] Rao | Epistemic uncertainty propagation in reliability assessment of complex systems[END_REF] assuming expert input in the form of means and standard deviations of lognormally distributed failure rates.

The remainder of the paper is organized as follows. In Section 2, the fault tree studied is described. In Section 3, a brief review of the computational procedure for the integrated (hybrid) probabilistic and possibilistic propagation of epistemic uncertainty in the fault tree is described.

In Section 4, the possibility-probability (probability-possibility) transformations considered are described. In Section 5, the results of the fault tree analysis using the hybrid and transformationbased approaches are presented. Section 6 offers a discussion of the results and some conclusions.

FAULT TREE AND BASIC EVENT UNCERTAINTIES

We consider a simple fault tree comprised of two independent basic events, B 1 and B 2 , linked to the top event A through an OR-gate (Figure 1). Letting q denote the frequency probability of the top event, and q i the frequency probability of basic event i, i = 1, 2, we have

= 1 + 2 -1 2 . ( 1
)
We assume that the basic event frequency probabilities q 1 and q 2 are uncertain, and that uncertainty about q 1 is described using a beta probability density p 1 with parameter values α and β as specified in Table I (see also Figure 2), while uncertainty about q 2 is described using a triangular possibility distribution π 2 with lower support limit b, core c and upper support limit d as specified in Table I (see also Figure 3). Three cases are considered: high, medium and low uncertainty (Table I). The distribution parameter values have been chosen to obtain distributions which clearly reflect increasing uncertainty when going from the low to high uncertainty cases.

The probability distributions have increasing entropy, and the possibility distributions all have the same core value and overlapping support intervals of increasing size. As an example, B 1 could denote failure of an item for which failure data exists, and B 2 an event for which no data exists and where the triangular possibility distribution is constructed based on expert statements alone.

HYBRID UNCERTAINTY PROPAGATION

In the hybrid approach [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] , propagation of uncertainty is based on a combination of the Monte Carlo technique [START_REF] Kalos | Basics[END_REF] and the extension principle of fuzzy set theory [START_REF] Zadeh | Fuzzy sets[END_REF] . The main steps of the procedure are:

 repeated Monte Carlo samplings of the probabilistic quantities; and

 fuzzy interval analysis to process the uncertainty associated with the possibilistic quantities.

More specifically, consider the functional relationship y = g(x), where x = (x 1 , ..., x k , ..., x n ) is a vector of n parameters. Assume that uncertainty about k of the parameters, say (x 1 , ..., x k ), is described by probability distributions (F 1 , ..., F k ), and uncertainty about the remaining nk parameters, (x k+1 , ..., x n ), by possibility distributions (π k+1 , ..., π n ). For a vector of fixed values of (x 1 , ..., x k ), obtained by Monte Carlo sampling, the extension principle defines the possibility distribution of y as

= sup x,g x =u min +1 +1 , … , . (2)
Considering the simple fault tree described in Section 2, for fixed quantities q and q 1 in Equation

(1) we have

2 = -1 1-1 ,
and hence trivially by Equation ( 2),

( ) = 2 -1 1-1 , for q 1 ≤ u ≤ 1.
We see that for each Monte Carlo sampling of q 1 , an associated possibility distribution of q is obtained (Figure 4). The possibility distributions resulting from the hybrid procedure are combined using Dempster's rule [START_REF] Shafer | A Mathematical Theory of Evidence[END_REF] to obtain the belief function Bel(u) = Bel([0, u]) and the plausibility function

Pl(u) = Pl([0, u]), 0 ≤ u ≤ 1, defined by = 1 =1 , (3)
where

N i (u) = N i ([0, u])
is the necessity measure of [0, u] arising in the ith Monte Carlo sampling, and

= 1 Π =1 , (4)
where

Π i (u) = Π i ([0, u])
is the possibility measure of [0, u] arising in the ith Monte Carlo sampling. The belief and plausibility functions above can then be interpreted as bounding cumulative distributions.

In general, Equation ( 2) is equivalent to performing interval analysis on the alpha-cuts of the possibility distributions (π k+1 ,...,π n ) [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] . The uncertainty propagation procedure is then:

 Sample a set of m vectors of (x 1 ,...,x k ) values from the probability distributions (F 1 ,...,F k ).

 Determine a α-cut levels of the possibility distributions (π k+1 ,..., π n ).

 For a given Monte Carlo sampling (step 1) and α-cut (step 2), determine the lower and upper value of y.

 Repeat step 3 for all m Monte Carlo samplings and all a α-cut levels; as seen above, a possibility distribution of y is obtained for each Monte Carlo sampling, as collection of all the lower and upper values found in 3.

 The m possibility distributions of y obtained from step 3 are combined using Equations

(3) and (4).

It is important to be aware that underlying the extension principle is an assumption of a metadependence between the possibilistic quantities involved [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] : There is potentially two levels of dependence among the possibilistic quantities: a (meta-)dependence between information sources, and a (stochastic) dependence between the quantities themselves. The hybrid propagation method assumes stochastic independence between the group of probabilistic quantities and the group of possibilistic quantities. The extension principle is equivalent to performing interval analysis on α-cuts and, as a result, imposes an assumption about strong dependence between the information sources (experts) supplying the input possibility distributions.

POSSIBILITY-PROBABILITY (PROBABILITY-POSSIBILITY)

TRANSFORMATIONS

Using possibility-probability (probability-possibility) transformations, uncertainty propagation can be performed within a single calculus, i.e. using Monte Carlo sampling when transforming possibility distributions into probability distributions and using fuzzy methods when transforming probability distributions into possibility distributions.

In this Section we first review the transformations considered, and then describe their implementation on the fault tree case described in Section 2.

Review of transformation methods

We consider transformations from possibility distributions into probability distributions and vice versa. The transformations are based on given principles and ensure a consistent transformation to the extent that there is no violation of the formal rules (definitions) connecting probability and possibility when possibility and necessity measures are taken as upper and lower probabilities, and so that the transformation is not arbitrary within the constraints of these rules. Nevertheless, as noted in [START_REF] Dubois | On possibility/probability transformations[END_REF] :

... going from a probabilistic representation to a possibilistic representation, some information is lost because we go from point-valued probabilities to interval-valued ones;

the converse transformation adds information to some possibilistic incomplete knowledge.

This additional information is always somewhat arbitrary.

Given the interpretation of possibility and necessity measures as upper and lower probabilities, a possibility distribution π induces a family P(π) of probability measures. There is not a one-to-one relation between possibility and probability, and a transformation of a possibility distribution π into a probability measure P can therefore only ensure that a) P is a member of P(π); and b) P is selected among the members of P(π) according to some principle (rationale); e.g.

'minimize the information content of P', in some sense.

Analogously, a transformation from a probability measure P into a possibility distribution π can only ensure that A) P(π) includes P; and B) P(π) is selected according to some principle (rationale); e.g. 'minimize loss of information', in some sense.

We will be working with probability densities, and in the following p denotes the probability density associated with a probability measure P.

Different possibility-probability (probability-possibility) transformations have been suggested in the literature. In [START_REF] Dubois | On possibility/probability transformations[END_REF] it is argued that the following should be basic principles for such transformations:

I. The probability-possibility consistency principle

The family P(π) is formally defined as = : ∀ ⊆ , Π , i.e. as the set of probability measures P such that for all events A in the space X on which π is defined, the probability of A is less than or equal to the possibility of A. As suggested in [START_REF] Dubois | On possibility/probability transformations[END_REF] it seems natural to require a transformation to select P from P(π). This is referred to as the probability-possibility consistency principle, formulated as Π , ∀ ⊆ .

II. Preference preservation

A possibility distribution π induces a preference ordering on X, such that π(x) > π(x') means that the outcome x is preferred to x'. A transformation should therefore satisfy

> ′ ⇔ > ( ′).
Several transformations have been suggested based on the two principles above. In the following we briefly review some of these, presenting the continuous versions of their definitions.

The following two principles are described in [START_REF] Dubois | On possibility/probability transformations[END_REF] :

(i) Possibility to probability: The principle of insufficient reason

The principle of insufficient reason specifies that maximum uncertainty on an interval should be described by a uniform probability distribution on that interval. The sampling procedure for transforming a possibility distribution into a probability distribution according to this principle is:

 sample a random value α* in (0, 1] and consider the α-cut level L α* = {x : π(x) ≥ α*}; and

 sample x* at random in L α* .
In the continuous case, the density p t resulting from a transformation of π is given by

= | | ( ) 0 , ( 5
)
where |L α | is the length of the alpha-cut levels of π. To motivate this, note that = () 1 0

.

From step 1 in the sampling procedure above we have p(α) = 1, and from step 2 we have

= 1 | | .
For the integration space we note that p(x|α) = 0 for α > π(x). It can be noted that p t is the centre of gravity of P(π). The transformation in Equation ( 5) applies to upper semicontinuous, unimodal and support-bounded π.

(ii) Probability to possibility: The principle of maximum specificity Define a function h : [l, m] → [m, u], where l, m and u are, respectively, the lower support limit, mode and upper support limit of the probability distribution to be transformed.

Then, the most specific possibility distribution π t (in the sense of minimizing the area under π) that dominates a given probability density p is given by

= ℎ( ) = -∞ + +∞ ℎ( ) = + (ℎ ), (6)
where • = 1 -• and ℎ = max : . The transformation in Equation ( 6) is illustrated graphically in Figure 5. It is interesting to observe that for this transformation, we have

, ℎ = ( , ℎ ) Π( , ℎ = 1,
i.e. the transformation prescribes equality between the necessity of a given α-cut and the probability of the same α-cut. The transformation in Equation ( 6) applies to unimodal, continuous and support-bounded probability densities p. Moreover, in [START_REF] Dubois | Probability-possibility transformations, triangular fuzzy sets, and probabilistic inequalities[END_REF] it is noted that:

This criterion is not necessarily adapted to the transformation of a subjective probability distribution reflecting an expert opinion.

The following transformation has been suggested [START_REF] Dubois | A definition of subjective possibility[END_REF] when the probabilities to be transformed are subjective:

(iii) Probability to possibility: The principle of minimal commitment

The principle of minimal commitment is based on the assumptions that an agent's knowledge is minimal, and that an elicited subjective probability measure is actually induced by a belief function representing the actual state of knowledge of an agent. The principle prescribes selection of the least informative belief function among those associated with a given probability measure. It has been shown [START_REF] Dubois | A definition of subjective possibility[END_REF] that this belief function is unique and consonant, and thus induced by a possibility distribution. The transformation is given in [START_REF] Dubois | Probability-possibility transformations, triangular fuzzy sets, and probabilistic inequalities[END_REF] only for the discrete case:

= min , ,
where ρ i is the probability mass associated with outcome i. According to [START_REF] Dubois | On possibility/probability transformations[END_REF] , the continuous counterpart of Equation ( 7) is

= min ( ), ( ) +∞ -∞ . ( 8
)
The transformation in Equation ( 8) is illustrated graphically in Figure 6. In [START_REF] Dubois | On possibility/probability transformations[END_REF] it is concluded that:

Further research is needed in the continuous case. Especially it is interesting to investigate for which class of pdf and possibility distributions the transformations make sense.

Three approaches for converting probability distributions into 'equivalent' triangular or trapezoidal fuzzy sets are considered in [START_REF] Anoop | Conversion of probabilistic information into fuzzy sets for engineering decision analysis[END_REF] . The transformations involve two steps, namely the transformation of the probability distribution in question into a fuzzy set, which is then transformed again into the 'equivalent' triangular or trapezoidal fuzzy set by curve fitting to a standard distribution class.

(iv) Probability to possibility: Normalization of probability density

The membership function of the fuzzy set resulting from the first step of the transformation is given by

= sup , (9)
i.e. by normalisation of the probability density. For the second step, the following three approaches are considered: least square curve fitting, conservation of uncertainty (in an entropy-sense), and minimization of the Hausdorff distance.

The distribution resulting from Equation ( 9), when taken to be a possibility distribution, does not in general adhere to the probability-possibility principle [START_REF] Dubois | Fuzzy Sets and Systems: Theory and Applications[END_REF] .

Other transformation principles are also referred to in [START_REF] Dubois | On possibility/probability transformations[END_REF] , e.g.:

(v) Possibility to probability: The maximum entropy principle Select the P in P(π) which maximizes entropy. In general, this transformation violates the preference preservation constraint.

Implementation on the fault tree in Section 2

In the present paper, we apply transformations (i)-(iv), though transformation (iv) is only considered as a reference for the possibility distributions resulting from transformations (ii) and

(iii), and unlike in [START_REF] Anoop | Conversion of probabilistic information into fuzzy sets for engineering decision analysis[END_REF] we will work directly with μ p rather than with a standard distribution class fitted to μ p .

Transformations (ii) and (iii) only apply to probability densities with bounded support. In the present work, we only deal with the beta probability density defined on the interval [0,1].

Transformation (i) only applies to unimodal possibility distributions, thus excluding common distribution classes such as the trapezoidal and uniform ones. In the present work we only deal with the triangular possibility distribution, for which Equation ( 5) yields:

2 = - 1 -ln(1 -2 ( )), (10)
noting that |L α | = d + α (c -d) -[b -α (b -c)] = -(d -b)(1 -α).
In the computations we have used the sampling procedure described in Section 4.1, rather than a sampling procedure from the above density.

RESULTS

In this Section we first present the results of applying transformation (i) to the triangular possibility distributions for q 2 , and transformations (ii)-(iv) to the beta probability densities of q 1 .

Then the results of applying the hybrid approach are presented, along with the results of the transformation-based approaches.

In the computations we have considered a = 10 3 alpha-cuts and m = 10 3 Monte Carlo samplings.

Transformation of basic event frequency probability distributions

We first consider the application of transformation (i) to the triangular possibility distribution π 2 of the basic event frequency probability q 2 (Figure 7, top). The probability densities resulting from the transformation (Figure 7, middle) tend to infinity for q 2 = 0.2, i.e. at the core of the transformed possibility distributions; cf. Equation (10). Looking at the cumulative distributions (Figure 7, bottom), we obtain a visual impression of the probability distribution resulting from the transformation as the center of gravity of the family of probability distributions induced by the possibility distribution. We now consider the application of transformations (ii)-(iv) to the beta probability distribution p 1 of the basic event frequency probability q 1 (Figure 8, top) into possibility distributions (Figure 8, middle). As can be seen for the cumulative distributions (Figure 8, bottom), the possibility distributions resulting from transformations (ii)-(iv) serve as bounds for the transformed probability distribution. However, as noted in Section 4.1, adherence to the probability-possibility consistency principle is not generally guaranteed for transformation (iv).

Fault tree: Hybrid approach and transformation-based approaches

The results of applying the hybrid approach and an approach based on transformation (i) are shown together in Figure 9. As can be seen, the probability distribution resulting in the transformation-based approach lies between the lower and upper cumulative distributions of the hybrid approach.

Figure 9 Cumulative distributions for the top event frequency probability q; hybrid approach (solid lines) and probabilistic approach based on transformation (i) (dashed line); high uncertainty (top), medium uncertainty (middle) and low uncertainty (bottom).

In the hybrid approach, the probability distribution of q 1 and the possibility distribution of q 2 are combined to yield what may be interpreted as lower and upper probability distributions, respectively. Hence, the limiting cumulative distributions for q resulting from the hybrid approach can be used to derive lower and upper values of the probability that the top event frequency probability lies in an interval, say [0, u]. For example, for the fault tree studied, in the large uncertainty case, we find that Bel(q ≤ 0.35) = 0.05 and Pl(q ≤ 0.35) = 0.83: thus, it can only be said that the probability P(q ≤ 0.35) is in the interval [0.05, 0.83]. Alternatively, we may consider some percentiles obtained from the two limiting cumulative distributions, say the 95 percentiles Q 95 lower = 0.45 and Q 95 upper = 0.37. The former is defined by derived, upon which a transformation from any representation of uncertainty (possibility, upper and lower probabilities, belief functions etc.) into the pignistic probability function is based.

The focus on decisions and need for expected utility theory and hence probability is also emphasized in [START_REF] Lindley | The probability approach to the treatment of uncertainty in artificial intelligence and expert systems[END_REF] :

Why do we want to study uncertainty? Aside from the intellectual pleasure it can provide, there is only one answer: to be able to make decisions in the face of uncertainty. Studies that do not have the potentiality for practical use in decision making are seriously inadequate. An axiomatic treatment of decision making shows (Savage, 1954; DeGroot, 1970) that maximization of expected utility is the only satisfactory procedure. This uses, in the expectation calculation, the probabilities and these, and only these, are the quantities needed for coherent decision making by a single decision maker. Only the utilities, dependent on the consequences, not on the uncertainties, need to be added to make a rational choice of action. How can one use fuzzy logic or belief functions to decide? Indeed, consider a case where Bel(A) + Bel(not A) < 1. Because you have so little belief in either outcome do you, like Buradin's ass, starve to death in your indecision between A and its negation? Reality demands probability. [START_REF] Lindley | The probability approach to the treatment of uncertainty in artificial intelligence and expert systems[END_REF] Considering that the transformation can be made both ways, from probability to possibility, and vice versa, the question arises: when should the transformation be made into probability, and when into possibility? Emphasizing decision theory and expected utility theory, as seen above, the answer would be always into probability, so long as a decision is involved. Others might argue the conservativeness of making the transformation into possibility, as the possibilistic representation is weaker than the probabilistic one.

The hybrid approach also results in a weaker representation than a purely probabilistic one, yet stronger than a transformation-based possibilistic approach. The latter results in a possibility distribution as output, and hence probability intervals on the form [0, v] or [w, 1], where v and w are numbers between 0 and 1. In the hybrid approach, on the other hand, a probability interval could be of the form [v, w], where v and w are numbers between 0 and 1 and v < w.

Looking at the issue of uncertain representation in the framework of risk analysis, we may distinguish between two goals of a risk analysis:

1. Provide input to an expected utility analysis (alternatively, cost-benefit analysis)

Provide decision support by giving insights into the uncertainties that are involved

If an expected utility analysis (cost-benefit analysis) is the ultimate goal, then probability is required, and the choice is between the pure and transformation-based probabilistic approaches.

A comparison of these is beyond the scope of the present paper.

On the other hand, if the goal is to provide decision support by giving insights into the uncertainties that are involved, and under the premise that uncertainty has been quantified using both probability and possibility, then the choice is between either of the transformation-based approaches and the hybrid approach. The transformation-based approaches add or remove information. This is an unattractive feature given the goal of the analysis. In contrast, the hybrid approach does not alter the uncertainty descriptions given as input. It does, however, introduce a knowledge dependency assumption, as pointed out in [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] :

The extension principle [...] is equivalent to performing interval analysis on α-cuts and hence assumes strong dependence between information sources (observers) supplying the input possibility distributions, since the same confidence level is chosen to build these αcuts.

As a consequence of the dependence between the choice of confidence levels, one cannot interpret the calculus of possibilistic variables as a conservative counterpart to the calculus of probabilistic variables under stochastic independence. [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] Computationally, the hybrid approach is more demanding than any of the transformation-based approaches (Table III). From the discussion above, we may conclude that the approaches of uncertainty representation relevant in a given setting depend on the purpose of the risk analysis. On the other hand, the present paper is of an explorative naturefurther research is required to make the possibilistic representation and approaches operational in a risk assessment context. In this respect, we may suggest a methodological development in relation to the hybrid computational framework: firstly, considering that in the context of risk assessment we are interested in uncertainty about the events involvedthe top event in a fault tree analysisit would be interesting to determine lower and upper values of the top event probability, and not only upper and lower cumulative distributions of its frequency probability. Secondly, a more general setting than the one considered here is where the frequency probability concept is introduced for some but not all basic events, and uncertainty about the non-frequency-probability-based events is treated by direct (predictive) epistemic uncertainty assignments. This would be the required setting for unique events, meaning events for which a large population of similar situations cannot be meaningfully defined.

Figure 1

 1 Figure 1 Simple fault tree.

Figure 2

 2 Figure 2 Beta probability densities of q 1 .

Figure 3

 3 Figure 3 Triangular possibility distributions of q 2 .

Figure 4

 4 Figure 4 Possibility distributions of q resulting from Equation (2) and 10 Monte Carlo samplings of q 1 .

Figure 5

 5 Figure 5 Transformation (ii); the value of the possibility function π t at x, π t (x), equals the shaded area.

Figure 6

 6 Figure 6 Transformation (iii); the value of the possibility function π t at x equals the shaded area.

Figure 7

 7 Figure 7 Transformation of triangular possibility distribution (top, solid line) into the associated probability density (middle, dashed line) using transformation (i); corresponding cumulative distributions also shown (bottom).

Figure 8

 8 Figure 8 Transformation of beta probability density (top, solid line) into the associated possibility distribution (middle) using transformation (ii) (dotted line), transformation (iii) (dashed line) and transformation (iv) (dash-dotted line); corresponding cumulative distributions also shown (bottom).

Table III

 III Computation times for the hybrid and transformation-based approaches for the fault tree in Section 2. On a 3 GHz dual core computer with 3.5 GB RAM.

	Method	Computation time a
	Hybrid	105 seconds
	Transformation (i)	0.29 second
	Transformation (ii)	2.19 seconds
	Transformation (iii) 4.20 seconds
	Transformation (iv) 0.99 seconds

a

lower = 0.95, and hence

ACKNOWLEDGEMENTS

The authors are grateful to two anonymous reviewers for useful comments and suggestions to an earlier version of the paper.

The work presented in this paper was performed in part while R. Flage was visiting Politecnico di Milano in the period March -June 2009. He would like to acknowledge Politecnico di Milano and co-authors E. Zio and P. Baraldi for making his stay possible, and memorable. For R. Flage and T. Aven the work on the paper has been funded by the Research Council of Norway through the PETROMAKS research programme. The financial support is gratefully acknowledged.

For P. Baraldi and E. Zio the work has been partially funded by the "Foundation pour une Culture de Securite Industrielle" of Toulouse, France, under the research contract AO2006-01.

In a risk analysis context, Q 95 lower is the interesting quantity since it guarantees that the probability that the true value of q is lower than Q 95 lower , P(q ≤ Q 95 lower ), is greater than or equal to 0.95. Thus, it can be interpreted as a conservative assignment of the percentile with respect to the imprecision arising from the input. If the interval [0, Q 95 lower ] is considered, the hybrid approach also provides an upper value for P(q ≤ Q 95 We see that the interval [0.95, 1] reflects the imprecision about P(q ≤ 0.45) that results from the use of the possibility distribution π 2 as a representation of uncertainty of q 2 .

Applying transformations (ii)-(iv), we see that in the high uncertainty case (Figure 10, top), the lower cumulative distribution resulting from the hybrid approach crosses the lower cumulative distributions resulting from all the transformation-based approaches. In the medium and low uncertainty cases (Figure 10, middle and bottom, respectively), on the other hand, the cumulative distributions resulting from the hybrid approach stay between those resulting from the transformation-based approaches.

Figure 10 Cumulative distributions for the top event frequency probability q; hybrid approach (solid lines) and possibilistic approach based on transformation (ii) (dotted lines), transformation (iii) (dashed lines) and transformation (iv) (dash-dotted lines) ; high uncertainty (top), medium uncertainty (middle) and low uncertainty (bottom).

Table II gives a comparison of the 5 and 95 percentile values of the distribution functions shown in Figure 9 and Figure 10. We see that the bounds are broader in the transformation-based approaches (ii-iv) compared to the hybrid approach. This is due to: a) the transformation of the precise probability distributions taken directly as input in the hybrid approach into the imprecise possibility distributions in the transformation-based approaches, and b) the use of the extension principle for the propagation of the uncertainty from the basic event probabilities into the top event probability in the transformation based approach. The latter introduces a dependence between the possibilistic variables which result in broder bounds [START_REF] Baudrit | Joint propagation of probabilistic and possibilistic information in risk assessment[END_REF] .

DISCUSSION AND CONCLUSIONS

Considering probability and possibility as applied in the present paper, we may distinguish between three different approaches to the treatment of epistemic uncertainties:

1. A pure approach 2. A transformation-based approach

A hybrid approach

By a pure approach is meant that uncertainty about all basic event frequency probabilities is quantified directly using the same representationeither probability or possibility. We do not consider such an approach in the present paper; the premise is that the uncertainty about the basic event frequency probabilities has been quantified using probability for one of the basic events and possibility for the other.

By a transformation-based approach is meant that uncertainty about each basic event frequency probability is quantified using either probability or possibility, and in the end all probability distributions involved are transformed into possibility distributions, or vice versa. By applying such transformations, information is added or removed, depending on which direction the transformation is made. Starting from a possibility distribution, transformation (i) returns a probability distribution, and thus adds to the information that has been given as input.

Transformations (ii) and (iii) return, respectively, the most specific and least committed possibility distributions compatible with a given probability distribution, and thus reduce on the information given as input. Of course, additional assumptions are required, on the form of transformation principles.

What would be the purpose of applying such transformations in a practical decision-making setting? The motivation in [START_REF] Smets | Constructing the pignistic probability function in a context of uncertainty[END_REF] is that decision-making requires expected utility theory, which again requires probability. In [START_REF] Smets | Constructing the pignistic probability function in a context of uncertainty[END_REF] it is distinguished between a so-called credal level, where beliefs are 'entertained' and quantified by any representation, and a so-called pignistic (from greek pignus, meaning a bet, in reference to the betting interpretation of probability) level, where beliefs are used to take decisions, and where probability is required. Based on special bets and some coherence requirements, a so-called generalized insufficient reason principle can be


Gaétan Hains
email: gaetan.hains@u-pec.frchong.li@exqim.com

Chong Li

Youry Khmelevsky
email: youry.khmelevsky@ubc.ca

Brandon Potter

Jesse Gaston

Andrew Jankovic

Sam Boateng

William Lee

Generating a Real-Time Algorithmic Trading System Prototype from Customized UML Models (a case study)

Keywords: real-time systems, software engineering, documentation, scalability, source code generation, UML, EMF, Eclipse

Real-time algorithmic trading systems are widely used by pension funds, mutual funds, some hedge funds, market makers and other institutional traders, to manage market impact and risk, to provide liquidity to the market. The technologies of real-time information processing and high-performance computing, such as the parallel bridging model -SGL [1], are essential for such systems. However, many errors can be made with todays tools, for example, the distraction of developers because they must focus both on financial algorithms, parallel computing and coding, or compiler mis-optimization, etc. In this paper, we describe practical results with the software design of a real-time algorithmic trading prototype by undergraduate students within the CoSc 319 software engineering project course at the University of British Columbia's Okanagan campus (Canada) in collaboration with a post graduate student from the University Paris-Est (France). The prototype can be modified by end-users on the UML model level and then used with automatic Java code generation and execution within the Eclipse IDE. During the case study an advanced coding environment was developed for providing a visual and declarative approach to trading algorithms development so as to generate directly portable bitcode on Low-Level Virtual Machine (LLVM) 1 from financial specification of trading strategies. During the project, Canadian students collaborated with a research engineer from a hedge fund in Paris.

Introduction

Computer Science research has enormous potential for applications. Yet much of the current research is of an incremental stovepipe" or inward-looking nature, even though Computer Science has a unique ability to fundamentally transform virtually every other discipline [START_REF] Feamster | Can great research be taught?: independent research with cross-disciplinary thinking and broader impact[END_REF]. This paper's objective is to discuss our experience and new challenges in Computer Science and Software Engineering (SE) Project courses at University of British Columbia Okanagan (UBC O) in Canada, in collaboration with the international student research project sponsors, Laboratoire d'Algorithmique, Complexit et Logique (LACL) in Universit Paris-Est Crteil (UPEC) in France.

We are going to discuss a research project, sponsored by LACL: Real-Time Algorithmic Trading System Prototype". In this projects students attempted to develop a new approach for specialpurpose programming language code generation from UML models by developing a new plugin for Eclipse IDE2 . In the present day now it is common to see code generators produce whole sections of code for programmers reducing the time and complexity of a program creation. This technique is also commonly used in businesses where an advanced programmer is not easily accessible so that they can create a program to do what they want quickly and easily with a few clicks of a button. The easiest way to form a set of code is from a well-formed UML transferred to XML form and after that to any form of code you want. Although this is a very convenient way to create code, the problem that occurs is the transformation does not add any real functionality for the program. This is why you need an extra library of information to create the functionality of the code that the generated code could not. So our job is to add onto the current code generation tools to create the functionality that has been requested by our clients for their hedge funds. This program will allow them to create a simple UML diagram and be able to generate code to calculating moving averages" [START_REF] Potter | Parallel Code Generation Plug-in XML to Java Plug-in Project Documentation[END_REF]. In some student research projects from 2005 students actively used industrial IDEs, tools and workbenches with code generators, wizards and templates [START_REF] Khmelevsky | Research and teaching strategies integration at postsecondary programs[END_REF]. In papers [START_REF] Khmelevsky | Research and teaching strategies integration at postsecondary programs[END_REF][START_REF] Khmelevsky | Software development pro-jects in academia[END_REF] we discussed some SE student projects in detail.

The following OSs, DBMSs, frameworks, IDEs and development tools were used in students' software projects intensively: • JDeveloper "provides a visual WYSIWYG editor for HTML, JSP, JSF, and allows developers to modify the layout and properties of components visually: the tool re-generates the code. Declarative features enable programmers to generate EJBs or POJOs based on tables in relational databases. JDeveloper automates the creation of Java EE artifacts" 3 .

• Oracle Designer "is Oracle's CASE tool for designing an information system and generating it. Designer incorporates support for business process modelling, systems analysis, software design and system generation. Designer allows organizations to design and rapidly deliver scalable, client/server systems. After generating the information system one is able to edit the generated code with Oracle Developer Suite" 4 . "Designer incorporates support for business process modelling, systems analysis, software design and system generation. Designer allows organizations to design and rapidly deliver scalable, client/server systems that can adapt to changing business needs" 5 .

• Oracle Application Express (Oracle APEX) "is a rapid web application development tool" 6 . "With Application Express, coding is declarative. No code is generated or compiled. Declarative code yields fewer differences between developers and this consistency makes Application Express applications easy to maintain and manage" 7 .

• IBM Rational Software Architect (RSA) "provides integrated design and development support for model-driven development with UML" 8 . "You can use RSA for Java 2 Platform, Enterprise Edition (J2EE Platform) technology, you can convert designs and UML diagrams drawn in the Modeling perspective into code, and also convert the UML models you create into C++ code as needed" 9 .

• IBM Rational Rose Enterprise "provides a common modeling language for enabling faster creation of quality software, Jump-start your Ada, ANSI C++, C++, CORBA, Java, J2EE, Visual C++ and Visual Basic applications with code generated from visual models" 10 .

• Actifsource "is a code generator plug-in for the Eclipse IDE. Generic code templates enable code generation. Supported languages are Groovy, Java, C/C++, Scala, etc. Regeneration of code happens in real-time whenever model, meta-model or code templates change" 11 .

2 Real-Time Algorithmic Trading System Prototype Design The business domain area of the project was chosen by the sponsors from UPEC: real-time algorithmic trading for a real hedge fund in Paris. Algorithmic trading is widely used by pension funds, mutual funds, some hedge funds, market makers and other institutional traders, to manage market impact and risk, to provide liquidity to the market. The technologies of highperformance computing, such as the parallel bridging model -SGL [START_REF] Li | A simple bridging model for highperformance computing[END_REF], are essential for such systems so as to ensure that complex strategies can process stock-exchange data as milli-second rates. However, many errors can be made with today's tools, for example, the distraction of developers because they must focus both on financial algorithms, parallel computing and coding, or the compiler mis-optimization, etc. The sponsors from UPEC proposed to develop an advanced coding environment for providing a visual and declarative approach to trading algorithms development which can directly generate portable bitcode on Low-Level Virtual Machine (LLVM) from financial specification of trading strategy to avoid the above issues. In this project, students should build a visual and declarative coding environment with which they can generate trading algorithms in Java. During the project, students had the possibility to collaborate with a research engineer from a hedge fund in Paris. With this project, students could also extend their knowledge in several fields: financial trading strategies like mean-reversion12 or/and pairtrading13 ; parallel computing and HPC models (e.g. SGL model [START_REF] Li | A simple bridging model for highperformance computing[END_REF]), real-time trading systems, as well as compilation and code generation of programming languages, etc. The Use Case diagram for the real-time trading system prototype is shown on Figure 1, where StockWatch (see Figure 4) must process real-time data from the Yahoo Stock. The simplified Domain Model is shown on Figure 2 [START_REF] Potter | Parallel Code Generation Plug-in XML to Java Plug-in Project Documentation[END_REF].

We tried to avoid the traditional method in which we must generate different code several times from very high-level abstract to high-level programming languages, then to middle-level and low-level programming languages, until we reach machine code. Instead of that, students should use UML as front-end, and Java (as a first step before an LLVM version) as back-end to generate executable code directly from high-level specification. They firstly investigated how to specify an algorithmic trading strategy using UML. After that, they learned how to build an Abstract Syntax Tree (AST) from UML specification. Then, students prepared a module to generate code automatically from the AST. Students investigated different approaches to find a solution for the problem: model-driven development and automatic code generation for the general purpose languages. One of the approaches is based on reverse engineering. Reverse engineering is an old activity and a young discipline [START_REF] Canfora | Achievements and challenges in software reverse engineering[END_REF]. "In fact, developers have always struggled with analyzing software components to gather information that the documentation leaves out, examining source code to reconstruct the underlying rationale and design choices, and inspecting data formats to maintain communications among applications. Pushing the adoption of reverse engineering techniques in the development practice is still a major need, requiring appropriate education of developers both in university courses and within industry, and to support reverse engineering techniques and tools with empirical evidence about their performance and usability and with guidelines for their adoption" [START_REF] Canfora | Achievements and challenges in software reverse engineering[END_REF]. In this projects students were developing a tool, which should allow them to generate code from the UML models with additional specifications. As defined in [START_REF] Zschaler | Towards modular code generators using symmetric language-aware aspects[END_REF], model-driven engineering allows constructing software from abstractions that are more closely fitted to the problem domain and that better hide technical details of the solution space. "Code generation is used to produce executable code from these abstractions, which may result in individual concerns being scattered and tangled throughout the generated code. The challenge, then, becomes how to modularize the code-generator templates to avoid scattering and tangling of concerns within the templates themselves" [START_REF] Zschaler | Towards modular code generators using symmetric language-aware aspects[END_REF]. Students investigated different approaches, especially related to reverse and forward SE, Eclipse Modeling Framework 14 (EMF) and Model Driven Architecture (MDA). On the other hand, their research lacked Executable UML (xUML), which is a "rigorous, objectoriented system development method that has been successfully deployed on many strategically critical projects in sectors such as telecommunications, automotive, aerospace and defense, since 1994" 15 . xUmlCompiler 16 can be used to generate java persistence annotated (JPA) classes, which offers a software viewer for the system and generates persistence.xml resources for quick testing turnaround. The xUML as well as Shlaer-Mellor/Executable UML toolset 17 , UML/SysML 18 -based modeling and simulation [START_REF] Mischkalla | Closing the gap between UML-based modeling, simulation and synthesis of combined HW/software systems[END_REF] can be used in future research projects.

Real-Time Algorithmic Trading System Implementation

We summarize here the results of the Real-Time Algorithmic Trading System Prototype implementation. The code generation within the student research projects is a new trend in CoSc education. Traditionally, we stressed the study of programming languages and utilization of them, but now we can use more model-driven design and development code generation in our curricula, even within capstone student projects and sponsored projects from Industry. This project was aimed to develop a Java code generator that takes information from a UML and created a working real-time Java application that may run in parallel. A universal java pro- ducing system from a UML is impossible to do within the current UML standards, so for this project the students required a narrower focus. This project was focused much more specifically on using the UML as more than an interface and from their parsing out the required data and combined with a library of functions, producing a simple java class that took in the required data and produced a calculated value as output. Creating a java program from a UML was impossible to do universally, so instead what this project aims to do is to use a library of commands that can be called by essentially embedding them into the UML and having a library of commands produce the Java application which will in this case be a real-time trading algorithm with the sole purpose of determining, buy, sell or do nothing [START_REF] Potter | Parallel Code Generation Plug-in XML to Java Plug-in Project Documentation[END_REF]. The System Prototype Architecture is shown on Figure 3.

As it is shown on the Figure 2, user uses EMF to create a specification for the plugin. The user calls a plugin from Eclipse with the right click menu. The code generator then calls the parser which takes UML data and then the code generator creates Stock Watch Monitor java application (Stock Watch). The user can execute Stock Watch manually or code generator can execute Stock Watch on completion automatically. The Stock Watch collects data from Yahoo in real-time and produce table with the data results, as it is shown on Figure 4 [3].

How the Plugin Works

XML Parsing

Using the EMF plug-in we were able to produce a UML diagram of the specifications as it's shown on Figure 5, which is stored as an XML file known locally as an .ecore file (see example on Figure 6.). Using a simple Java parser we extracted the relevant information from the .ecore file and it then gathered the required methods from the library adding them to the generated output. The parsed data is shown on Figure 7.

Generating Code

When the Generate option is selected from the right click menu of a .ecore file in eclipse the GeneratePopupActionClass is called and the run method is called. The run method then creates a ConsoleGenerator object and invokes the generateConsoleApplication method. The generate-ConsoleApplication method creates a file named OutputClass.java which contains the main for the program to be run. The java file is then compiled and added to a .jar so it can be easily executed. The jar will be located in the root of the C drive and will be named GeneratedApp.jar. Generation status: currently generates a standard console application based on a set of parameters specified in UML. Parameters include (see Figure 5):

• Stock symbol of the stock to watch

• For each stock specify the statistic for decision making e.g. Average(). Note: should be declared as a function in UML.

• For each stock specify the BUY and SELL points e.g. BUY34 or BUYAVERAGE

List of Library Functions: The current list of functionality that can be specified in the UML for code generation (not case sensitive):

• average -Specified by the Average.java file in the source.

• stddev -Specified by the StdDev.java file in the source.

Data collection and mathematical calculations done with multiple threads. The GUI has also runs in it own separate thread. Functions: To add a function, developers need to do the following:

• Create a java class which computes the desired algorithm value.

• Specify which functions from the class are needed to be publicly accessible

• Submit the class and a description to the development team of the P-est Plugin

To add a function to the distributed library, developers need to do the following (see Figure 5):

• Create a java class which computes the desired algorithm value.

• Specify which functions from the class are needed to be publicly accessible

Running the Generated Code

This option works in much the same way as the above Generate option with the one difference being that the created jar is executed after being compile. The project source code can be accessed from SourceForge.net repository by using the following URL: http://sourceforge.net/projects/pestplugin/files/ [START_REF] Potter | Parallel Code Generation Plug-in XML to Java Plug-in Project Documentation: Source Code and Design Diagrams[END_REF] 3.2 Regular Usage

EMF Usage

• Create a new Project within Eclipse.

• Create a UML diagram (see Figure 5).

Plug-in Usage

• Right-click the .ecore file.

• Select Code Generation.

• Select Parser, Generate Code or Generate and Run.

• The output file will be called OutputClass.java and will be placed at the root of the C drive.

• If you selected Generate and Run, the code will also be packaged into a jar and executed.

Detailed instructions for Parsing the Data

This subsubsection explains how the prototype will generate a Java source code:

• The initial stage of the prototype requires that the user create a UML diagram that will fit with the specifications of our library. This will include the algorithms, variables and how they will interact with one another (see Figure 5).

• Upon creation of the UML, an XML is created that will state all the attributes, variables and functions that the user specified in the UML. Using this we can easily obtain information we need to generate code. This is automatically created when a UML is made (see Figure 6).

• Parsing the XML (Ecore File) -Now that we have an XML we can parse the data so that we can obtain the information we need to generate the code. We do so by right clicking our Ecore file and selecting the Parse function (see Figure 9).

• Parsed XML Data -The parsed data will supply the information above. We will have the class name (specified by the user), the functions (from our supplied Libraries), and any parameters along with their data type for storing information (see Figure 7).

Conclusion

We have provided here a case study for the real-time algorithmic trading system prototype with automatic Java source code generation from the end-users UML models. During the case study an advanced coding environment was developed for providing a visual and declarative approach to trading algorithms development which can generate directly portable bitcode on LLVM from financial specification of trading strategy to avoid the above issues. Due to lack of project time, the LLVM code generation was not implemented within the proposed prototype system. During the project, Canadian students collaborated with a research engineer from a hedge fund in Paris. Familiarity with existing software development tools is both necessary and encouraged by such projects. The international and collaborative dimension of our latest educational project is also important to introduce students to international, heterogeneous and asynchronous teams.

A new library of mathematical functions for stock interactions and a new plug-in for Eclipse that generates code were developed and implemented during the project.

Figure 1 :

 1 Figure 1: Use Case Diagram of the Real-Time Trading System Prototype.

Figure 2 :

 2 Figure 2: Simplified Domain Model of the Real-Time Trading System Prototype.

Figure 3 :

 3 Figure 3: The System Prototype Architecture.

Figure 4 :

 4 Figure 4: Real-Time Stock Watch Monitor with the Graphical Stock Information Diagram.

Figure 5 :

 5 Figure 5: End-User UML Diagram of the On-line Stock Information Sources.

Figure 6 :

 6 Figure 6: Example of the .ecore XML file.

Figure 7 :

 7 Figure 7: The Parsed Data Example.

•

  Add a function in the FunctionInterface class to access the data from the new class The Parser plugin-in Class Diagram is shown on Figure 8 execution within Eclipse IDE is shown on Figure 9.

Figure 8 :

 8 Figure 8: Parser Plug-in Class Diagram.

Figure 9 :

 9 Figure 9: Parser Plug-in within Eclipse.

  Contents 1 Introduction 1.1 SW Engineering tools and code generators . . . . . . . . . . . . . . . . . . . . . . How the Plugin Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 XML Parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Generating Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.3 Running the Generated Code . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Regular Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 EMF Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Plug-in Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Detailed instructions for Parsing the Data . . . . . . . . . . . . . . . . . .

	2 Real-Time Algorithmic Trading System Prototype Design
	3 Real-Time Algorithmic Trading System Implementation
	3.1 4 Conclusion

  14 http://www.eclipse.org/modeling/emf/ 15 http://www.kc.com/XUML/xumlsupportsmda.php 16 http://www.ohloh.net/p/xuml-compiler, http://code.google.com/p/xuml-compiler/ 17 http://code.google.com/p/smexuml-tk/ 18 SysML is an OMG standard profile for UML defined for generalSystems Modelling

http://llvm.org/

http://www.eclipse.org/

http://en.wikipedia.org/wiki/Mean reversion (finance)

http://en.wikipedia.org/wiki/Pairs trade

Acknowledgment

Our thanks goes to the Team Epik from UBC Okanagan: Brandon Potter, Jesse Gaston, Andrew Jankovic, Sam Boateng and William Lee, who successfully designed and implemented the realtime system prototype within CoSc 319 SW Engineering Project in Winter 2012.