Balanced truncation for linear switched systems

We propose a model order reduction approach for balanced truncation of linear switched systems. Such systems switch among a finite number of linear subsystems or modes. We compute pairs of controllability and observability Gramians corresponding to each active discrete mode by solving systems of coupled Lyapunov equations. Depending on the type, each such Gramian corresponds to the energy associated to all possible switching scenarios that start or, respectively end, in a particular operational mode. In order to guarantee that hard to control and hard to observe states are simultaneously eliminated, we construct a transformed system, whose Gramians are equal and diagonal. Then, by truncation, directly construct reduced order models. One can show that these models preserve some properties of the original model, such as stability and that it is possible to obtain error bounds relating the observed output, the control input and the entries of the diagonal Gramians.


Introduction
In recent years, the need for accurate mathematical modeling of physical and artificial processes for simulation and control has been steadily increasing. To cope with it, inclusion of more detail at the modeling stage is required, which inevitably leads to analyzing larger-scale, more complex dynamical systems. Such high dimensional systems are often linked to spatial discretization of underlying time-dependent coupled partial differential equations (PDE).
In broad terms, model order reduction (MOR) is concerned with finding efficient computational prototyping tools to replace such complex and large models by simpler and smaller models that capture their dominant characteristics. Such reduced order models (ROM) could be used as efficient surrogates for the original model, replacing it as a component in larger simulations. For details on different MOR techniques, we refer the readers to the book [1] and to the surveys [4,6].
Hybrid systems are a class of nonlinear systems which result from the interaction of continuous time dynamical subsystems with discrete events. These systems are hence described by both discrete and continuous states, inputs and outputs. The transitions between the discrete states may result in a jump in the continuous internal variable. The discrete dynamics is determined by a finite-state deterministic automaton equipped with outputs (the so-called Moore automaton).
Switched systems constitute a subclass of hybrid systems, in the sense that the discrete dynamics is simplified, i.e. any discrete state transition is allowed and the set of discrete events coincides with the set of discrete states.
A switched system is a dynamical system that consists of a finite number of subsystems and a logical rule that orchestrates switching between these subsystems. These subsystems or discrete modes are usually described by a collection of differential or difference equations. The discrete events interacting with the subsystems are governed by a piecewise continuous function, i.e. the switching signal.
One can classify switched systems based on the dynamics of their subsystems, for example continuous-time or discrete-time, linear or nonlinear and so on. In this work we analyze continuous-time linear switched systems (LSS) with reset maps (or coupling/switching matrices). The latter term refers to matrices that scale the continuous state at the switching times.
Hybrid and switched systems represent useful models for distributed embedded systems design where discrete controls are routinely applied to continuous processes. In particular, switched systems have applications in control of mechanical and aeronautical systems, power converters and also in the automotive industry. For a detailed characterization of theses classes of dynamical systems, we refer the readers to the books [16,19,37,38]. In the past years, hybrid and switched systems have received increasing attention in the scientific community, which can be partly explained by the fast development of the switch control research area (see [18,24,40]). In this context, adaptive control techniques based on switching between different controllers are used to achieve stability and improve transient response. The study of the properties of hybrid and switched systems includes such topics as stability (see [13,37,40]), realization including observability/controllability (see [27,30]), analysis of switched DAEs (see [21,39]) and numerical solutions (see [17]).
In some cases, the complexity of verifying and assessing general properties of these systems is very high so that the use of these models is limited in applications where the size of the state space is large. A useful tool for dealing with such complexity is MOR. A very prolific MOR method that has been continuously developed over the years is balanced truncation (BT). It was initially introduced in the systems and control theory in [23,26]. The main idea behind BT is to transform a dynamical system to a balanced form defined in such a way that appropriately chosen controllability and observability Gramians are equal and diagonal. Then a reduced-order model is computed by truncating the states corresponding to the small diagonal elements of the Gramians. For more details on BT especially from a practical point of view (i.e. application to large scale systems, solution of Lyapunov equations etc.), see [7,20].
In this paper we present a model order reduction algorithm for linear switched switched based on balanced truncation. We consider linear switched systems whose linear subsystems may have different state-space dimensions, and where the change of the discrete mode is accompanied with a change in the continuous state using linear reset maps. As it is usual in balanced truncation, the proposed method is based on the following steps. First, observability/controllability Gramians are calculated. Then, using these Gramians a state-space transformation is calculated such that after the application of this state-space transformation, the observability and controllability Gramians are equal to each other and they are diagonal. Finally, the reduced model is obtained by discarding those states which correspond to small diagonal elements (referred to as singular values) of these Gramians.
In this paper we propose the definition of new type of Gramians for LSS. More precisely, for each discrete mode we define observability/controllability Gramians.We propose two definitions of observability/controllability Gramians: one definition defines observability/controllability Gramians as solutions of an LMI, the other one defines them as solution of Sylvester equations. The latter Gramians satisfy the LMIs of the first definition. Note that both the LMIs and the Sylvester equations mix Gramians which belong to different discrete modes. The proposed Gramians exist even if the underlying LSS is not exponentially stable for all switching signals, but only for slow enough switching signals. Furthermore, we present an analytical error bound for the L 2 norm of the difference between the outputs of the original and reduced LSS. This error bound is formulated in terms of singular values of the Gramians. However, this error bound is valid only for slow enough switching signals, i.e., for switching signals with large enough dwell time. Recall that dwell time is the minimal amount of time spent in each discrete mode.
Considerable attention has been dedicated in recent years to the problem of MOR for linear switched system. The related work can be grouped into the following categories.
In [14,41,43,44] the matrices of the reduced order model were obtained by solving a set of LMIs, and the papers in this group differ from each other in the specific assumptions they imposed on the system at hand and the form of the LMIs employed. More precisely, for a given dimension of the reduced model and for a given error bound these papers propose a set of LMIs, solution of which can be used to calculate the matrices of the reduced order model. The L 2 gain of the system representing the difference between the input-output behavior of the original and the reduced model is then bounded by the fixed error bound. The advantage of [14,41,43,44] is that error bounds are available. The disadvantage is that the proposed conditions are only sufficient, and the trade-off between the dimension of the reduced model and the error bound is not clear. Moreove, the computational complexity of solving those LMIs might be to high. In contrast to [14,41,43,44], the current paper proposed a method, whose applicability depends on the existence of solution for a few simple LMIs which are necessary to find the observability/controllability Gramians. Once the existence of these Gramians is assured, the model reduction method can be applied. Moreover, there is an analytic error bound and the trade-off between the approximation error and the dimension of the reduced system is formalized in terms of the singular values of those Gramians. Furthermore, under some very mild assumptions, the Gramians can be obtained by solving Sylvester equations instead of LMIs. Another difference with respect to [14,41,43,44] is that we consider a more general class of switched systems: in contrast to [14,41,43,44] the switched systems considered are allowed to have reset maps and the linear subsystems may have different state-space dimensions.
In [25], a model reduction method is proposed for switched systems with autonomous switching, i.e. switching which depends on continuous outputs. The proposed method is based on balanced truncation of the linear sub-models. However, [25] proposes no error bounds. In contrast, in this paper we consider switched systems with external switching (the switching signal is an external input), and we provide analytic error bounds.
In [9][10][11] balanced truncation for discrete-time switched systems was studied. The balanced truncation was based on discarding those states which correspond to the small singular values of the Gramians. The Gramians themselves were defined as solutions of the LMIs. An analytic error bound based on singular values of the Gramians was provided. However, the model reduction procedure of [9][10][11] provided a reduced model whose linear subsystems at each discrete mode depended on the switching signal and often they may not exist. switching signal. More precisely, if q(k) denotes the discrete mode at time step k, the matrices of the reduced model had where (A q , B q , C q ) and (Ā q ,B q ,C q ) are the matrices of the linear subsystem associated with the discrete mode q for the original and reduced models respectively, and L q , R q are suitable matrices. For example, if the switching signal is 123121, then A 2 = L 3 A 2 R 2 andĀ 2 = L 1 A 2 R 2 has to hold simultaneously. In [10,11] no conditions are provided to guarantee that this is possible. Moreover, if we consider the switching signal 121124, then we get a different set of equalities whichĀ 2 should satisfy. That is, the model reduction algorithm of [9][10][11] need not always yield a well-posed switched system, even if the Gramians exist, moreover, the parameters of this switched system will depend on the switching signals. In contrast to [9][10][11], in this paper we deal with continuous-time switched systems, and the parameters of the reduced model do not depend on the time-varying switching signals (of course, the parameters of each linear subsystem will depend on the discrete mode the subsystem is associated with).
In [22] a model reduction algorithm is proposed which is based on finding observability/controllability Gramians for each linear subsystem and then bringing them into a diagonal form by a common state-space transformation. Moreover, [22] proposes necessary and sufficient conditions for the existence of such a transformation.
In contrast to the current paper [22] presents no error bound for the difference between the input-output behavior of the original and of the reduced model. Moreover, in contrast to [22] we consider systems with reset maps and linear subsystems whose dimensions may vary according to the discrete state.
In [2,3,34] model reduction procedures based on moment matching is proposed. In contrast to the current paper, those methods do not allow for analytical error bounds. However, in [2,3] it is guaranteed that the reduced model will have the same input-output behavior for certain switching signals. As to [34], in contrast to the present paper, it considers switched systems with autonomous switching and it proposed a model reduction procedure which guarantees that the reduced model has the same steady-state output response to certain inputs as the original model.
In [31,35,36] model reduction based on generalized observability/reachability Gramians are proposed. The method of [31,35,36] applies only to quadratically stable linear switched systems. Here, quadratic stability means that there exists a common quadratic Lyapunov function for all the linear subs-systems. Quadratic stability is known to be sufficient but not necessary for the linear switched system to be exponentially stable for any switching signal and zero continuous input. The Gramians at hand are solutions of a certain LMI. After calculating a solution of the LMI, a linear state-space transformation is applied to the original model such that the observability Gramian becomes diagonal and equals the controllability Gramian. Then the states corresponding to small singular values of these Gramians are thrown away. Furthermore, in [31] an analytical error bound is presented which involves the singular values of the Gramians. The current paper can be seen as an improvement upon [31,35,36]. The algorithm proposed in this paper can be applied to switched systems which are not quadratically stable, and like in [31,35,36] there is a clear error bound and trade-off between the size of the reduced order model and approximation error. However, the price we pay for it is that the error bound is valid only for switching signals with a sufficiently large dwell time. Another improvement upon [31,35,36] is that we consider switched systems with reset maps and with linear subsystems whose dimensions are not necessarily the same.
The definitions of Gramians proposed in this paper are inspired by the definitions previously encountered for the case of bilinear and stochastic systems (see [5,42]).
Finally, it is worth mentioning that MOR for LSS is related to the notion of approximate bisimulation introduced in [15]. The paper [15] does not directly address model reduction. Instead, it proposes a definition of simulation relations among hybrid systems. Informally, an approximate simulation relation between two hybrid systems is a multivalued map between their state spaces, which approximately respects the dynamics and the output map of the systems at hand. As a consequence, if two hybrid systems are related by an approximation simulation relation, then their outputs will be close to each other. If one of the hybrid systems has a simpler structure, for example, it is a finite-state transition system, then the existence of a approximation simulation relation allows to use the simple system for control synthesis or verification. While the general goal of model reduction and of finding approximate simulation relations is the same (both aim at replacing a complex model by a simpler one), the details a very different. In particular, in model reduction, the aim is to replace a model with a model of the same type but with less states. For example, a switched system is replaced by another switched system with a smaller number of states. In contrast, the goal in using approximate simulation relations is to replace a hybrid/nonlinear system by a finite-state transition system, which is approximately similar to the original system. A formal comparison between classical model reduction approaches and the ideas of [15] would certainly be very useful, but it would go beyond the scope of this paper.
The paper is organized as follows; in the second section, we introduce continuoustime linear switched systems in a formal way. Furthermore, we provide a characterization of input-output mappings in time domain corresponding to such systems. Section 3 describes the procedure of constructing infinite energy Gramians for the simplified case with only two discrete modes. Next, in Section 4 we provide a system theoretic interpretation of such Gramians (for the general case with D modes). Furthermore, we formally introduce the balancing algorithm followed by the MOR step, i.e. the truncation. A measure of the quality of approximation by reduction is provided by means of a error bound. Additionally, we investigate the possibility of preserving system theoretic properties such as stability, for the reduced system. Section 5 is designated for the numerical experiments while a summary of the findings and the conclusion are presented in Section 6.

Linear switched systems
Definition 1 A continuous time linear switched system (LSS) is a control system of the form: : where = {1, 2, . . . , D}, D > 1, is a set of discrete modes, σ (t) is the switching signal, u is the input, x is the state, and y is the output.
The system matrices A q ∈ R n q ×n q , B q ∈ R n q ×m , C q ∈ R p×n q , where q ∈ , correspond to the linear system active in mode q ∈ , and x 0 is the initial state. We consider the E q matrices to be invertible. Furthermore, the transition from one mode to another is made via the so called switching or coupling matrices K q 1 ,q 2 ∈ R n q 2 ×n q 1 where q 1 , q 2 ∈ .

Remark 1
The case for which the coupling is made between identical modes is excluded, Hence, when q 1 = q 2 = q, consider that the coupling matrices are identity matrices, i.e. K q,q = I n q .

The notation
= (n 1 , n 2 , . . . , n D , is used as a short-hand representation for LSSs described by the equations in (1). The vector n = n 1 n 2 · · · n D is the dimension (order) of .
The restriction of the switching signal σ (t) to a finite interval of time [0, T ] can be interpreted as finite sequence of elements of × R + of the form: where q 1 , . . . , q k ∈ and 0 < t 1 < t 2 < · · · < t k ∈ R + , t 1 + · · · + t k = T , such that for all t ∈ [0, T ] we have: In short, by denoting T i := t 1 + . . . + t i−1 + t i , T 0 := 0, T k := T , write Intuitively, the switching signal defined above specifies that in the interval [T i−1 , T i ) the mode q i is active and hence the continuous state and output change according to the linear system associated with this mode, i.e., Remark 2 (The number of entries of the vector x(t) changes with time) Note that the continuous state depends on the discrete mode, in fact, the dimension of the space it belongs to changes when the discrete mode changes. This is due to the fact that the state-space dimension of linear systems associated with different modes can be different.
Note that in order to define x, the (3) are not sufficient, as the initial state of the differential equation in (3) is not specified. This calls for a careful and formal definition of what we mean by a solution of an LSS. To this end, denote by P C(R + , R n ), P c (R + , R n ), the set of all piecewise-continuous, and piecewise-constant functions, respectively.
is called a solution, if the following conditions simultaneously hold: 2. For all t ∈ R + , y(t) = C σ (t) x(t) holds.

Remark 3 (Existence and uniqueness of solution)
The solution of a linear switched system is unique for every initial state, continuous input and switching signal. More precisely, for every initial state x 0 , input signal u and switching signal σ , there exists a unique function x : R + → D i=1 R n i , and y : R + → R p which satisfies the conditions of Definition 2, and such that x(0) = x 0 . It is sufficient to show that there exists a unique function x : R + → D i=1 R n i such that x(0) = x 0 and which satisfies the conditions of Definition 2. In order to show existence, for every i ∈ N, define the functions z i : [T i−1 , T i ] → R n i recursively as follows: let z 0 : [0, T 1 ] → R n i be the solution of the differential equationż 1 It is clear that x satisfies Definition 2. Assume thatx : R + → D i=1 R n i satisfies the conditions of Definition 2 andx(0) = x(0). We will show by induction that for every i ∈ N, the restrictions ofx and x to [T i , T i+1 ) are equal. Indeed, for i = 0, consider he restriction ofx to [0, T 1 ) is a solution of the differential equationż 1 (t) = A q 1 z 1 (t) + B q 1 u(t) with the initial condition z 1 (0) =x(0) = x(0), and hence by the uniqueness of solutions of differential equations, restriction ofx to [0, T 1 ) equals the restriction of z 1 to [0, T 1 ), and the latter equals the restriction of x to [0, T 1 ). Assume that the induction hypothesis is true for i ≤ k. In particular, this implies that the restrictions of x andx to [T k , T k+1 ) are equal. In particular, lim t T k+1 and hence x(T k+1 ) = K q k+1 ,q k+2 lim t T k+1 Since the restrictions of x andx to [T k+1 , T k+1 ) are solutions of the same differential equationż k+1 (t) = A q k+1 z k+1 (t) + B q k+1 u(t) with the same initial condition z k+1 (T k+1 ) =x(T k+1 ) = x(T k+1 ), by uniqueness of the solution of a differential equation, the restrictions of x andx to [T k+1 , T k+2 ) are equal.
The switching matrices K q i ,q i+1 allow having different dimensions for the subsystems active in different modes. If the K q i ,q i+1 matrices are not explicitly given, it is considered that they are identity matrices.
The input-output behavior of an LSS system can be described in time domain using the mapping f(u, σ ). This particular map can be written in generalized kernel representation (as suggested in [28]) using the unique family of analytic functions: g q 1 ,...,q k : R k + → R p and h q 1 ,...,q k : R k + → R p×m with q 1 , . . . , q k ∈ , k 1 such that for all pairs (u, σ ) and for T = t 1 + t 2 + · · · + t k we can write: (4) where the functions g, h are defined for k 1, as follows, In the rest of the paper, we will make the following assumption.

Assumption 21
If is an LSS of the form (3), we assume that for all q = 1, . . . , D, A q is stable, i.e. all eigenvalues of A q have a strictly negative real part.
Assumption 1 implies that each linear subsystem of the LSSs are stable. However, this does not imply that the LSS at hand is stable for any switching signal, see [16,19,37,38] for counter-examples.
Remark 4 (Role of minimallity) Since in this paper we aim at proposing a MOR method for LSS, it is natural to discuss the issue of LSS of minimal order realizing a certain input-output function. Indeed, transforming an LSS to a minimal order one, while preserving its inputoutput behavior could be a first step toward model order reduction. There exists a complete realization theory and a minimization algorithm for linear switched systems [27,29]. According to this theory, a linear switched system is called minimal, if the sum of the dimensions of its LTI subsystems is minimal among all the linear switched systems describing the same input-output function. It is also shown that minimality is equivalent to observability and reachability of the linear switched system. Here, observability means that any non-zero continuous state will yield a non-zero output for a suitable switching signal, and reachability means that the span of all states reached by varying continuous input and switching signals is the whole state-space. It is well known [27,29] that a linear switched system can be observable (respectively reachable), without any of its LTI sub-systems being observable (respectively reachable). Based on this observation, it can be shown by means of counter-examples that minimality of a linear switched system does not imply that of its LTI sub-systems, i.e., it can happen that a linear switched system is minimal, but the LTI subsystems are not. For this reason we do not assume minimality of the LTI subsystems, as it would exclude a large class of input-output behaviors which are realizable by linear switched systems.
In particular, [27,29] propose algorithms for transforming a linear switched system to a minimal one, while preserving its input-output function. Hence, that minimization algorithm can be considered as a primitive model reduction algorithms, which eliminates those states which do not contribute to the input-output behavior of the system. Note that the minimization algorithm produces a system whose input-output behavior is exactly the same as that of the original system, while the goal of model reduction is to produce a system whose input-output behavior is sufficiently close, but not necessarily the same as that of the original system. Since the former goal is a special case of the latter one, minimization algorithms can be viewed as subclasses of model reduction algorithms. However, since they aim at preserving exactly the same input-output behavior, they tend to produce too large systems.
Naturally, before applying any model reduction to a linear switched system, one can use the minimization algorithm of [27,29] to obtain a smaller linear switched system model. However, in this paper we prefer not to restrict attention to minimal LSS, as it is not necessary and in fact would lead to technical complications. More precisely, the proposed algorithm could yield non-minimal models, even if applied to minimal LSS. Since the main analytical result of the paper is proven using repeated application of the model reduction procedure for eliminating one single state, assuming minimality could lead to technical difficulties. Indeed, if our assumptions include minimality of the LSS at hand, then after applying the model reduction procedure to eliminate one state, we might end up with an LSS which is not minimal. Then, we could no longer apply the same model reduction algorithm to this reduced LSS. We could minimize this reduced LSS. However, for the proof we need this LSSs to be balanced with Gramians which are diagonal and which are sub-matrices of the balanced Gramians of the original LSS. It is not clear if applying the minimization algorithm will preserve these properties.
The remark that the proposed algorithm may result in non-minimal LSS might seem counter-intuitive. Intuitively, the proposed algorithm, like all the other balanced truncation algorithms, will eliminate certain poorly controllable and poorly observable states. However, we have no proof that the proposed algorithm will eliminate unobservable or unreachable states. In fact, it is known that the balanced truncation algorithm from [31] may result in nonminimal models. Note that in our algorithm we require that the observability and reachability Gramians are positive definite. While in the LTI case this would imply minimality of the LTI system, it is not clear if our assumptions imply minimality of the switched system. In fact, the counter-example of [31] is a strong indication that this is not the case. However, since the Gramians proposed in this paper are different from that of [31], formally we cannot be certain. All these issues require further research.

Energy Gramians for LSS for two modes
The purpose of this section is to provide some intuition behind the general definition of Gramians which will be presented in Section 4 later on. For simplicity of the exposition, we first consider the simplified case D = 2 (the LSS system switches between two modes only). This situation is encountered in most of the numerical examples in the literature we came across. see Section 4.

Setup and notations
Assume that there are two discrete modes, i.e., D = 2. Depending on the values of the switching signal σ (t), the original system switches between the following subsystems, 1 : where dim( 1 ) = n 1 (i.e. x 1 ∈ R n 1 and A 1 ∈ R n 1 ×n 1 , B 1 , C T 1 ∈ R n 1 ) and also dim( 2 ) = n 2 (i.e. x 2 ∈ R n 2 and E 2 , A 2 ∈ R n 2 ×n 2 , B 2 , C T 2 ∈ R n 2 ). Notice that we allow both the two subsystems to be written in descriptor format (having possibly singular E matrix).
Denote, for simplicity, with K 1 the coupling matrix when switching from mode 1 to mode 2 (instead of K 1,2 ) and, with K 2 , the coupling matrix when switching from mode 2 to mode 1 (instead of K 2,1 ) with K 1 ∈ R n 2 ×n 1 and K 2 ∈ R n 1 ×n 2 .
In the following, for the first two levels we present the generalized kernels, which were previously defined in (6), i.e., Consider a LSS system as described in (1) with two operational modes, i.e D = 2 and = {1, 2}. Consider dim( k ) = n k for k = 1, 2 and let K 1 ∈ R n 2 ×n 1 and K 2 ∈ R n 1 ×n 2 be the coupling matrices.

Definition 3
For ν ∈ {1, 2}, let ν,+ and +,ν be the ordered sets containing all tuples that can be constructed with symbols from the alphabet = {1, 2} and that start (and respectively end) with the symbol ν. Also, no two consecutive characters are allowed to be the same. Hence, explicitly write the new introduced sets as follows: Definition 4 Let the i th unit vector of length k be denoted with In some contexts we may use the alternative notation e i,k to emphasize its dimension k. The identity matrix I k ∈ R k×k can be written as I k = [e 1,k e 2,k . . . e k,k ]. Also, let 0 k, ∈ R k× be an all zero matrix. When k = , we use the notation 0 k =∈ R k×k or simply 0 when the dimension is clearly inferred.
If we choose q 1 = 1, then it follows that (q 1 , q 2 , . . . , q k ) ∈ 1,+ . Examples of energy functionals associated to sequences from 1,+ , are for instance the following In general, define the level k infinite Gramian corresponding to mode q 1 ∈ {1, 2} as Note that due to Assumption 1, the infinite integrals in (11) are well defined. By making use of the recurrence relation it follows that the k th Gramian corresponding to mode 1 (or respectively mode 2) can be written in terms of the (k − 1) th Gramian corresponding to mode 2 (or mode 1), as Next, introduce the linear reachability Gramians for the case with no switching. They are denoted with P (1) q , correspond to mode q ∈ {1, 2}, and can be defined as It is a well known result that P (1) q satisfies the following Lyapunov equation: Proposition 1 With Assumption 1, the level k reachability Gramians corresponding to modes 1 and 2 from (11) are the unique solutions of the recursive systems of linear equations: where k > 1 and P (1) q 1 is as in (14).
Proof of Proposition 2 By multiplying the equality in (12) with A q 1 to the left and with A T q 1 to the right, we write Hence it follows that, for q 1 , q 2 ∈ {1, 2} with q 1 = q 2 , we write (15) and (16).
If q 1 = 1 is chosen, then it follows that (q k , q k−1 , . . . , q 1 ) ∈ 1,+ . Examples of energy functionals associated to sequences from +,1 , are the following Note that the infinite integrals in (18) are well-defined due to Assumption 1. By using the following recurrence relation, the k th observability Gramian corresponding to mode 1 (or respectively mode 2) can be written in terms of the (k − 1) th observability Gramian corresponding to mode 2 (or respectively mode 1), as The linear observability Gramian (for the case with no switching) Q (1) q which corresponds to mode q ∈ {1, 2}, can be written as It is a well known result that Q (1) q satisfies the following Lyapunov equation: Proposition 2 With Assumption 1, the level k observability Gramians corresponding to modes 1 and 2 defined in (18) are the unqiue solution of the recusive systems of linear equations where the starting point is represented by the linear Gramians (with no switching) Proof of Proposition 4 By multiplying the identity in (19) with A T q 1 to the left and with A q 1 to the right, we write Hence it follows that, for q 1 , q 2 ∈ {1, 2} with q 1 = q 2 , we write which proves the statements in (22) and (23).

Infinite Gramians and Lyapunov equations
Next, we will propose a definition of reachability/observability Gramians which collects level k reachability/observability Gramians. We will start with reachability Gramians.
Definition 5 Introduce the infinite reachability Gramian P q 1 corresponding to mode q 1 ∈ {1, 2} of the LSS system as in terms of the multivariate functions g r q in (10) or matrices P (k) q 1 in (11).
Note that P q 1 is computed by taking into account the inner products of energy functionals associated to all possible switching sequences (of any length k) that start in mode q 1 .

Definition 6
Introduce the infinite observability Gramian Q q 1 corresponding to mode q 1 ∈ {1, 2} of the LSS system as Note that Q q 1 is computed by taking into account the inner products of energy functionals associated to all possible switching sequences (of any length k) that end in mode q 1 .
Note that the existince of the newly defined Gramians is not evident. The following result from [42] addresses the existence of the newly defined Gramians. In a nutshell, it states that this holds if the norm of the coupling matrices is sufficiently small. In order to state this result, we need the following notation. Write the matrices {P q , A q , B q , C q }, q ∈ {1, 2} and {K q 1 ,q 2 }, q 1 , q 2 ∈ {1, 2} in block-diagonal format, as

Proposition 4 Assume (27) of Proposition 3 holds. Then the infinite reachability Gramians defined in (24) satisfy the following system of generalized coupled Lyapunov equations
Proof of Proposition 5 By adding the equalities stated in (15) and (16) for k > 2 as well as the one corresponding to k = 1 (in (13)), it follows that , which shows the validity of the equalities introduced in (28). (25), satisfy the following system of generalizaed coupled Lyapunov equations

Proposition 5 Assume (27) of Proposition 3 holds. Then the infinite observability Gramians defined in
in terms of the multivariate functions g o q in (10) and matrices Q (k) (18).

Proof of Proposition 6
By adding the equalities stated in (22) and (23) for k > 2 as well as the one corresponding to k = 1 (in (20)), it follows that , 2}, which shows the validity of the equalities presented in (29).
Remark 5 Instead of solving the two equations in (29) separately, one can solve one equation and recover the reachability Gramians P 1 and P 2 as block diagonal entries of P D .
Remark 6 Additional to (26), write the matrices {Q q }, q ∈ {1, 2} in block-diagonal format, Hence, instead of solving the two equations in (29) separately, one can solve one equation and recover the observability Gramians as the block diagonal entries of Q D .
For high order examples, it is not trivial to solve such generalized Lyapunov equations as (30) and (31). A possible approach is to approximate these solutions with truncated sums of positive definite matrices, where P For practical applications, solving many such Lyapunov equations is expensive. One can compute low rank factors instead of the full solutions to speed up the calculations ad avoid memory problems (for example, by using the toolbox in [32]).

Extension to LSS with D ≥ 2 modes
Below, we extend the definitions of reachability/observability Gramians presented above for the case D = 2 to the general case of D > 2 modes. To this end, let = {1, 2, . . . , D}, D 2 and fix the starting mode q 1 ∈ . Introduce the switching scenario (q 1 , q 2 , . . . , q k ) ∈ k . Since we exclude equal neighboring modes, i.e. q j = q j +1 , 1 j k − 1, it follows that there are (D − 1) k−1 ways of choosing such a switching sequence (q 1 , q 2 , . . . , q k ). For D = 2, there was only one possible sequence chosen uniquely.
For general number of modes D, we have to take into consideration the inner products corresponding to all sequences. Hence we adapt the definition of P (k) q 1 from (11) as follows where g r q 1 ,q 2 ,...,q k (t 1 , t 2 , . . . , t k ) : R k + → R n q 1 ×m is defined in the exactly same way as in (10), but now for the general case of D ≥ 2, i.e., g r q 1 ,q 2 ,...,q k (t 1 , t 2 , . . . , t k ) = e A q 1 t 1 K q 2 ,q 1 e A q 2 t 2 K q 3 ,q 2 · · · K q k ,q k−1 e A q k t k B q k . Note that the infinite integrals in (33) are well defined, due to Assumption 1. Again, one can write a recurrence relation by fixing the mode indexes q 3 , . . . , q k , g r q 1 ,q 2 ,...,q k (t 1 , t 2 , . . . , t k ) = D q 2 =1, q 2 =q 1 e A q 1 t 1 K q 2 ,q 1 g r q 2 ,q 3 ,...,q k (t 2 , t 3 , . . . , t k ).
Next, it follows that the k th reachability Gramian corresponding to mode q 1 can be written in terms of the (k − 1) th reachability Gramians corresponding to modes \ {q 1 }, as Similarly, we adapt the definition of Q (k) q 1 from (18) as follows g r q 1 ,q 2 ,...,q k (t 1 , t 2 , . . . , t k ) T dt 1 dt 2 . . . dt k .
Next, it follows that the k th reachability and observability Gramian corresponding to mode q 1 can be written in terms of the (k − 1) th reachability respectively observability Gramians corresponding to modes \ {q 1 }, as Definition 7 Define the infinite reachability Gramian corresponding to mode q 1 ∈ , as Definition 8 Define the observability Gramians as Similarly to the case of D = 2, the question of existence of infinite reachability/observability Gramians arises. It turns out that there exist an extension of Proposition 3 to the general case D 2. Again, the justification of what we propose comes from Theorem 2 in [42], which addresses the existence of bilinear infinite Gramians for MIMO systems. In order to present the announced result, we need the following notation, which is an extension of (26) defined for D = 2.
Let τ n k : {1, . . . , n} → {1, . . . , n} be a cyclic permutation of index k where k ∈ {0, 1, . . . , n − 1}. The explicit rule is given by τ n k ( ) = mod(k + , n), ∈ {1, . . . , n}, while the permutation τ n k can also be written as, For all X ∈ {A, B, C, P, Q} and k ∈ {1, . . . , D − 1}, consider the notations n i is a block-permutation matrix written in terms of D k , by replacing its one entries with identity matrices I n i of appropriate dimensions. For example, choose D = 3 and k = 2, and write the matrix˜ Note that, following the definition of n k , we can write that˜ 3 2 = n 1 +n 2 +n 3 n 1 +n 3 . Hence, the existence of the new proposed Gramians is assured when, basically, the norm of the coupling matrices is sufficiently small. Note also that, if D = 2, the exact result from (27) is obtained. Note that we can generalize the results form Remark 3 and 4 for the case with D modes. Moreover, the equations satisfied by the reachability Gramians P i , for i ∈ {1, 2, . . . , D} can be extended from (28), as follows

A D is stable and
if the condition (44) of Proposition (6) holds. Similarly, if the condition (44) of Proposition (6) holds, then the system of generalized Lyapunov equations is satisfied by the matrices Q i , ∈ .
Remark 7 One can rewrite the D equations stated in (45) as one equation in the following way,

Remark 8 Similarly, we can rewrite the equations in (46) as only one equation,
The Gramians introduced in Definitions 7 and 8 are mainly going to be used for the original possibly large-scale system. In this case, we would like to avoid computing the Gramians as solutions of LMIs (as in [31]). Additionally, we present a more relaxed definition of Gramians which will turn out to be useful for model reduction.

Definition 9 Let M > 0 be a constant The collection of matrices
is said to be M-relaxed reachability Gramians, if they satisfy the following collection of LMI, ∀i ∈ {1, 2, . . . , D} : Similarly, the collection of matrices {Q i > 0} D i=1 is said to be M-relaxed reachability Gramians, if they satisfy the following collection of LMI.
Remark 9 (Relationship between Gramians and relaxed Gramians) Let {P q } D q=1 be infinite reachability Gramians according to Definition 7 and assume that for all q ∈ {1, 2, . . . , D}, That is, under mild assumptions, infinite reachability (resp. observability) Gramians are also M-relaxed reachability (resp. observability) Gramians for a suitable constant M > 0. Note that the converse is not necessarily true.

Main results
In this section, we will provide a collection of results that involve the new defined infinite Gramians. In particular, these results will correspond to the more general case with D discrete modes, as presented in Definitions 7, 8 and 9. In this section, we will assume the following. In particular, if Assumption 2 holds, then the sets of M-relaxed reachability and observability Gramians are not empty. Moreover, in this case, all the linear subsystems are stable, i.e.

Energy bounds relating the input or output signals
First, we present the system theoretic interpretation approach; one can write upper and lower bounds of the energy of observation and respectively, of the energy of control in terms of the quantities Q i and P i . (1) (2), with t i μ, ∀i 1, and any solution (x, u, σ, y) of with zero input u(t) = 0, the following holds

Lemma 1 Consider an LSS as defined in
where q 1 ∈ represents the index of the first discrete mode in which operates.
Proof of Lemma 1 It is easy to see that K T i,j Q j K i,j , i, j = 1, . . . , D are positive semidefinite, hence there scalars γ i,j > 0 to satisfy the following inequalities γ  (2) and with minimal dwell time μ, we will prove the bound stated in (51). Recall that Q q satisfies (50). Let x(t) the corresponding solution to (1), and also introduce the functions where T i = i =1 t . By considering the uncontrolled case, the input function is considered to be u(t) = 0, ∀t. Using that dx(t) For t ∈ [T i−1 , T i ), compute the time derivative of W (x(t)) as defined in (3) in terms of the one corresponding to V (x(t)), as

C i x(t), t ∈ [T i−1 , T i ), it follows that ∂W (x(t)) ∂t −e M(t−T i−1 ) y(t) T y(t).
(55) Introduce the following notation By integrating the inequality (55) from From (52) and (53), it follows that and additionally, using that x( From (59) and using that γ = min By combining (58) and (60), we can write Since switching signals σ with minimal dwell time μ are considered, it follows that t i μ ⇒ Putting together the inequalities in (57) and (62), it follows that Now using the convention T 0 = 0 and adding all the inequalities in (63), we obtain Since W (x(T )) = x T (T )Q q +1 x(T ) 0, from (64) it follows that, Now using that W (x(0)) = x(0) T Q q 1 x(0), the result in (51) is hence proven.  solution (x, u, σ, u) of with x(0) = 0, the following bound holds

Proof of Lemma 2 Since for every
For any piecewise continuous switching signal σ : R → satisfying the conditions in (2) and with minimal dwell time μ, we will prove the bound stated in (66). Recall that P q satisfies (49). By multiplying the inequality (49) with P −1 i both to the left and to the right, we write Let x(t) be the corresponding solution to (1), and also introduce the function Using +2x(t) T P −1 q i B q i u(t), and by using the inequality in (67), it follows that Hence, the following inequality holds as,

By denoting W (x(t)) = e M(t−T i ) V (x(t)), for t ∈ [T i−1 , T i ), it follows that
and by combining (70) and (71) and integrating from T i−1 to t, we obtain Following the same line of thought as in Section 4.1.1, one can show that the following holds: W (x(t)) for i > 0 and W (x(0 − )) =

W (x(0)). By combining this statement with the inequality in (72), and by using the fact that e M(s−T i ) 1, ∀s ∈ [T i−1 , T i ), one can write
Since x(0) = 0, it follows that W (x(0 − )) = 0. Also, from the definition of the function W, it is clear that Hence, from (73), we directly conclude that which proves the result in (66).

Balancing transformation and truncation
In this section, we introduce the procedure for model order reduction by balanced truncation, and we prove a bound of the approximation error.
Procedure 51 Let = (n 1 , n 2 , . . . , n D , {(A q , B q , C q )|q ∈ }, {K q i ,q i+1 |q i , q i+1 ∈ }) be a linear switched system. Define the balanced LSS¯ = (n 1 , n 2 , . . . , n D , {(Ā q ,B q ,C q )|q ∈ }, {K q i ,q i+1 |q i , q i+1 ∈ }) as follows Gramians which satisfy (49) and Mrelaxed observability Gramians {Q q > 0} D q=1 which satisfy (50). 2. Find square factor matrices U q so that P q = U q U T q . Additionally, compute the eigenvalue decomposition of the symmetric matrix U T q Q q U q , as where q is a diagonal matrix with the real entries sorted in decreasing order. 3. Construct the transformation matrices S q ∈ R n q ×n q as follows 4. The matrices corresponding to the balanced realization¯ are computed in the following way (for any q, q 1 , q 2 ∈ ) Proposition 7 Condsider the matricesP q = S q P q S T q ,Q q = S −1 q T Q q S −1 q , q = 1, 2, . . . , D. Then for every q = 1, 2, . . . , D,P q = q =Q q , and {P q } D q=1 , {Q q } D q=1 are M-relaxed reachability and observability Gramians respectively of¯ .
Proof To prove these results, proceed as follows and similarly for the observability transformed Gramian. The following result holds for any i ∈ :Ā We will prove only the first inequality since the proof for the second is similar. By multiplying the equation in (49) corresponding to mode i with S i to the left and with S T i to the right, we write Finally, if we multiply D i=1,i =j K j,i P j K T j,i > 0 by S i in the left and by S T i on the right, it follows That is, (77) holds.
After the system is rewritten in the equivalent balanced realization, the next step will be to construct a reduced order system by eliminating states similar as to the linear case with no switching. One can partition the balanced realization of the original LSS in the following wayĀ The truncation orders are chosen to be less than the dimensions of the subsystems, i.e. r i n i .
By writing the dynamics of both the original balanced system¯ and the reduced systemˆ , and continuing with the transition of the state variable from mode q i to mode q i+1 at time T i again for both systems we finally conclude that the original output and the one corresponding to the reduced LSS are written asȳ We also partition the balanced Gramians corresponding to the system¯ as By plugging in the matrices in (79) and (84), into the equation (77)-(78), it follows that Hence, the reduced-order diagonal matricesˆ i , i ∈ are also M-relaxed reachability/observability Gramians of the reduced systemˆ .

Error bound
In this section we present a bound on the L 2 norm of the difference between the observed outputs corresponding to the original LSS and to the reduced LSS. We will show that this bound depends on the L 2 norm of the chosen control input and on the neglected elements of the balanced reduced Gramians. Some of the derivations presented here are inspired from techniques used prior in the dissertations [8,33] and in the more recent contribution [5], that provides a bound for BT applied to stochastic systems.
We assume that all pairs of the original Gramians (P i , Q i ), defined as the solutions of the equations (45) and (46), are transformed through the corresponding balanced transformations Recall the inequalities (77) and (78). By multiplying the first inequality of (77) with −1 to the left and to the right, one can again write that From (87) and (78) it directly follows that the following relations hold for any vectors z and v Next, for all i ∈ {1, 2, . . . , D}, proceed to partition the transformed Gramians i Let β = max i∈ β i . Let (x, u, σ, y) be a solution of¯ . By splitting the state variablex(t) as Note that the following holds: Define the function (92), satisfies

Lemma 3 The temporal derivative of the function V, as defined in
for all t ∈ [T i−1 , T i ).

Proof of Lemma 3
By putting together (79), (80) and (81) and by using the notation in (91), we can write thatẋ By using (94) and the inequality in (89), one can write that where Similarly, by using (95) and the inequality in (88) for z = x c (t) and v = 2u(t), one can show that d dt where From (97) and (99), observe that α o = β 2 q i α c . Hence, by adding the inequality in (96) with the one in (98) multiplied by β 2 q i , it follows that and by using the definition of V (t) in (92), it automatically proves the result in (93).
Introduce the concatenation of the state variables and of the coupling matrices corresponding to the (balanced) original and reduced systems, t ∈ [T i−1 , T i ) (100) From (82) and (100), it follows thatx(T i ) =K q i ,q i+1 lim t T ix (t). Note that the function V defined in (92), can also be written as a function ofx(t), as where the matricesR q ∈ R 2n q −1×2n q −1 are defined for any q ∈ , as First, we present a result for one step reduction. The L 2 norm of the output error computed as the differences between the original output and the output corresponding to the reduced system is bounded by the norm of the input.
Introduce the function W ( (93) and (104), we write that Repeating the reasoning from the proof of Lemma 2, it follows that allowing T → ∞ and by using the definition of the function , we can write Hence, the result in (103) has been proven.
Remark 10 By partitioning the set of discrete modes in two disjoint subsets, as = {1, 2, . . . , D} = 1 2 , we emphasize two different cases when reducing the system q ∈ 1 ⇒ perform reduction by 1 of the LTI subsystem in mode q, q ∈ 2 ⇒ do not change the LTI in mode q. (107) Next, introduce the balanced Gramians corresponding to the two subsets, as We conclude that the bound in (103) still holds for the setup that was introduced in (107), as follows Here, the selection of the scalar β is restricted only to diagonal Gramians corresponding to the discrete modes from 1 . The proof is similar to the one just presented and will be skipped for brevity reasons.
Next, we will present a more general result by extending Theorem 1 from one step reduction to reduction to any dimension by allowing possibly different reduction levels for each active mode q ∈ . Consider that the diagonal Gramians associated to the original and reduced systems can be written as for q ∈ {1, 2, . . . , D} and σ q,1 σ q,2 . . . σ q,r q . . . σ q,n q > 0. For ∈ {1, 2, . . . , ξ}, introduce the following diagonal matrices (111) Similarly, let Â q ∈ R r q, ×r q, , B q ∈ R r q, ×m q , Ĉ q ∈ R p q ×r q, , K q 1 ,q 2 ∈ R r q 2 , ×r q 1 , , be the (1, 1) blocks of the matrices defined in (79); Note that for = 0, the element¯ 0 coincides to the original LSS in balanced format, i.e.ˆ 0 =¯ . Moreover, when = ξ , it follows thatˆ ξ =ˆ , withˆ as introduced in Definition 13.

Theorem 2 Let
= (n 1 , n 2 , . . . , n D , {(A q , B q , C q )|q ∈ }, {K q i ,q i+1 |q i , q i+1 ∈ }) be a linear switched system which satisfies Assumption 51 and letˆ be a reduced order system obtained from introduced in Definition. There exists μ > 0 such that for any switching signal σ of the form (2) with minimal dwell time μ (i.e. t i > μ, ∀i), such that for any control input u ∈ L 2 (R m ), if (x, u, σ, y) is a solution of and  (x, u, σ,ŷ) is a solution ofˆ and x(0) = 0,x(0) = 0, then Proof of Theorem 2 We start by applying the result of Theorem 1 (for one step reduction) as adapted in Remark 10 (allowing adjustable reduction levels for different modes), toˆ −1 andˆ for all ∈ {1, 2, . . . , ξ}. Consider the following two subsets of , Note thatˆ is the result of a one-step reduction applied toˆ −1 and by Proposition 8 it satisfies Assumption 51. Next, denote withŷ andŷ −1 the outputs corresponding to the systemsˆ and, respectivelyˆ −1 for input u ∈ L 2 , switching signal σ (t) with minimal dwell time μ and initial zero states, i.e., (x k , u, σ,ŷ k ) is a solution of which implies that the result in (114) is thus proven.
The values r q, represent the intermediate reduction orders for each subsystem. Moreover, the transition of the diagonal Gramians ˆ q for ∈ {0, 1, 2} is made as follows: Step = 0 → At this step, write the original balanced Gramians 0ˆ q = q , q ∈ .
Remark 11 (Choice of the model order) The idea behind the choice of the model order of the reduced system is the following. After bringing the original model to balanced form, as described in Procedure 1, we choose each integer r q in such a manner that the diagonal elements σ q,r q +1 , . . . , σ q,n q −r q are small, more precisely, such that η , η = max n q −r q , q∈ σ q,n q − +1 is small, where ξ = max q∈ (n q − r q ).
The choice of the model order is not unique. First, it is determined by how much approximation error we would like, and it represents a trade-off between the order of each linear subsystem and the bound β of the estimation error. However, even if we fix the approximation error, there are several choices of the dimensions of the linear subsystems of the reduced model. For example, assume for example that we are dealing with two modes D = 2, n 1 = 5, n 2 = 3, σ 1,1 = 20, σ 1,2 = 10, σ 1,3 = 5, σ 1,4 = 0.08, σ 1,5 = 0.02 and σ 2,1 = 30, σ 2,2 = 0.9, σ 2,3 = 0.1. Then, if we set r 1 = 3 and r 2 = 3, then ξ = 2, and the guaranteed error bound is β = σ 1,4 + σ 1,5 = 0.1. However, we can achieve the same error bound by choosing r 1 = 5 and r 2 = 2. That is, the same approximation error can be achieved either by discarding 2 states in the linear system associated with mode 1, or discarding 1 state in the linear system associated with mode 2. However, if we are satisfied with an error bound β = 0.2, then we could take r 1 = 3 and r 2 = 2, i.e., we discard 2 states from the linear system associated with mode 1 and we discard 1 state from the linear system associated with mode 2. Indeed, in this case then the analytical error bound will be β = σ 1,4 +σ 1,5 +σ 2,3 +σ 2,2 = 0.2.

Using Gramians instead of M-relaxed Gramians
Computing M-relaxed Gramians requires solving LMIs and it is computationally demanding. Moreover, M-relaxed Gramians are not unique. Hence, instead of using M-relaxed Gramians, it could be more advantageous to use infinite reachability and observability Gramians defined in Definition 7-8. Note that by Remark 9, if {P q } D q=1 , {Q q } D q=1 are infinite reachability and observability Gramians and , for all q = 1, 2, . . . , D, then by Remark 9 the infinite reachability and observability Gramians are also M-relaxed reachability and observability Gramians respectively. Hence, the balanced truncation procedure presented in Section 5.2 can be applied to infinite reachability and observability Gramians.
More precisely, let = (n 1 , n 2 , . . . , n D , {(A q , B q , C q )|q ∈ }, {K q i ,q i+1 |q i , q i+1 ∈ }) be an LSS, and let {P q } D q=1 , {Q q } D q=1 be infinite reachability and observability Gramians. Let us apply Procedure 51 to using the Gramians The balanced LSSSi is such that the matrices P q = S q P q S T q ,Q q = S −1 q T Q q S −1 q are diagonal and equal to q , q = 1, 2, . . . , D. Moreover, the matrices q =P q ,Q q are also infinite reachability and observability Gramians as they satisfȳ Letˆ be the reduced LSS obtained according to the Definition 2, using the infinite reachability and observability GramiansP q =Q q = q , q = 1, 2, . . . , D. Note that the reduced Gramiansˆ q , q = 1, 2, . . . , D are no longer infinite reachability and observability Gramians. More precisely, they satisfy the following inequalitieŝ However, even though the reduced Gramiansˆ i are not infinite reachability and observability Gramians of the reduced order LSS, the error bound of Theorem 2 still applies. In fact, this was exactly the motivation behind introducing relaxed Gramians.
Recall that the proof of the error bound in Theorem 2 relies on repeated application of Theorem 1 and on the fact that truncated LSS are also balanced. The latter presents an error bound for the case when only one state is discarded from each linear subsystem during the truncation step. Theorem 1 remains true even when the balanced truncation procedure is formulated only for infinite reachability/observability Gramians instead of the relaxed ones. However, if the balanced truncation was formulated only for infinite reachability and observability Gramians as opposed to relaxed reachability and observability Gramians, then the repeated application of Theorem 1 would no longer be possible, as the truncated LSS would not be balanced (since the truncated matricesˆ q do not satisfy the definition of infinite reachability/observability Gramians).

Stability preservation
Stability preservation is a very sought after property when devising MOR techniques.
As pointed out in [19], a switched system is stable if all individual subsystems are stable and the switching is sufficiently slow to permit the transient effects to vanish after each switching time. In this book, Chapter 3.2 presents stability under slow switching with multiple Lyapunov functions. We present a definition of stability in a uniformly exponentially sense and with imposing again the condition of a minimal dwell time μ. This definition was initially introduced in [19]. Moreover, we will show that the reduced order models constructed through the proposed balancing reduction technique, satisfy the conditions of this particular type of stability.
Definition 12 A linear switched system as described in (1), is uniformly exponentially stable with dwell time μ if there exist constants K, M > 0 such that for any solution (x, u, σ, y), the inequality holds for any t 0, for a control input considered to be zero (i.e. u = 0) and the switching signal σ (t) having minimum dwell time μ > 0.

Lemma 4 Consider an LSS which satisfies Assumption 51. There exists a constant
μ > 0 such that is uniformly exponentially stable with a dwell time μ.
The absolute value of the difference between the two outputs is presented in Fig. 2.

Second example -a CD player system
For the next experiment, consider the CD player system from the SLICOT benchmark examples for MOR (see [12]). This linear system of order 120 has two inputs and two outputs. We consider that, at any given instance of time, only one input and one output are active (the others are not functional due to mechanical failure). For instance, consider mode j to be activated whenever the j th input and the j th output are simultaneously failing (where j ∈ {1, 2}).
In this way, we construct an LSS system with two operational modes. Both subsystems are stable SISO linear systems of order 120, i.e. we can write n 1 = n 2 = 120. This initial linear switched system (which will be denoted with ) is reduced by means of the new balanced truncation procedure (which we refer to in the following as BT1) to obtainˆ BT 1 and also by means of the balancing method proposed in Fig. 1 Switching signal σ (t) and output y(t) corresponding to both andˆ [22] (which we refer to in the following as BT2) to obtainˆ BT 2 . In the later reference, it has been shown that, if certain conditions are satisfied (see Corollary IV.3 in [22]), a simultaneous balanced truncation technique can be applied to LSS. In most practical examples, the existence of a global transformation matrix is not guaranteed. Hence, in [22], the authors propose instead a method of balancing the so-called average Gramians, i.e. P avg = 1 D D i=1 P i and Q avg = 1 D D i=1 Q i . We first proceed with a frequency domain simulation. By varying the frequency variable ω in the interval [10 0 , 10 6 ]rad/sec, we compute the frequency response corresponding to mode j ∈ {1, 2}, i.e. the magnitude of the function H j = C j (ωI n j − A j ) −1 B j , in the specified frequency range. The frequency response of the two original subsystems is depicted in Fig. 3.  Next, we compute reduced order models using both of the reduction methods discussed above, i.e. BT1 and BT2. The truncation orders for the reduced systems are chosen to be the same for each mode, i.e k 1 = k 2 = 33. In Fig. 4, we depict the magnitude of the frequency domain approximation error between the original system and the reduced ones, i.e.ˆ BT 1 andˆ BT 2 . The figure presents the error for each mode, separately. Let j be the subsystem of the LSS that corresponds to mode j ∈ {1, 2}, as introduced in (7). The same applies for the notationsˆ and, respectively, to the LSŜ BT 2 . Next, for both reduction methods, we compute the relative approximation errors for both modes. This is performed with respect to the H κ norm, where κ ∈ {2, ∞}.   Table 1. Note that, for both types of norms and for each of the two operational modes, the balanced truncation method we propose produces lower errors than those of the one introduced in [22].
As for the first example, we compare the time domain response of the original linear switched system with the ones corresponding to the two reduced models. We use the same signal as in Section 5.1 as control input, i.e. u(t) = 1/2 sin(20t)e −t/2 + 1/20e −t/2 . The switching times t i are randomly chosen within [0,10]sec so that t i > 0.5sec, ∀i.
The switching signal σ is depicted in the upper part of Fig. 5, while in the lower part of Fig. 5, the outputs of the three LSS (original one and the two reduced ones) are displayed.
Notice that the output of the original system is well approximated when using any of the two MOR methods.
Finally, by inspecting the time domain error between the original response and the one corresponding to the two reduced models (depicted in Fig. 6), observe that the new proposed method generally produces better results. The error curve corresponding to the BT1 method is below the error curve corresponding to the BT2 method for most of the points on the time axis.  We conclude that the new proposed balancing method produces better results than the one proposed in [22], in the sense that the original output is better approximated for this particular choice of LSS and control input. Moreover, our method can be applied to LSS with subsystems having different dimensions n i , i ∈ and provide reduced order models again with possibly different dimensions r i , i ∈ in different modes. The other method is constrained to having n 1 = . . . = n D so that the computation of the average Gramians P av and Q av is possible. Also, for BT2 it is assumed that a common Lyapunov function exists, which is arguably restrictive. Moreover, another advantage is that one can derive an error bound of the output error for the new proposed method, as presented in Section 4.2.1. This is also true for the second method proposed in [22].

Conclusion
In the current work, we have proposed a balanced truncation procedure for the class of linear switched systems which is based on the computation of infinite energy Gramians. These special matrices can be computed by solving generalized Lyapunov equations instead of solving systems of LMIs. The new balancing method has several advantages.
We provided connections between the new Gramians and system theoretical quantities (observation and controlling energy), by means of lower or upper bounds. Moreover, it turned out that an error bound involving the inputs, outputs and the truncated entries of the Gramians, could be derived. Finally, by applying the proposed procedure, the reduced order LSS can be proven to be uniformly exponentially stable with certain minimum dwell time, given that the original LSS also had this property.