optimal control of continuous-time switched …...1 optimal control of continuous-time switched...

16
1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica ed Elettronica, Universit` a di Cagliari, Piazza D’Armi, 09123 Cagliari, Italy e-mail: {seatzu,daniele.corona,giua}@diee.unica.it Alberto Bemporad Dip. Ingegneria dell’Informazione, Universit` a di Siena Via Roma 56, 53100 Siena, Italy e-mail: [email protected] Abstract— The paper deals with optimal control of switched piecewise affine autonomous systems, where the objective is to minimize a performance index over an infinite time horizon. We assume that the switching sequence has a finite length, and that the decision variables are the switching instants and the sequence of operating modes. We present two different approaches for solving such an optimal control problem. The first approach iterates between a procedure that finds an optimal switching sequence of modes, and a procedure that finds the optimal switching instants. The second approach is inspired by dynamic programming and identifies the regions of the state space where an optimal mode switch should occur, therefore providing a state feedback control law. I. I NTRODUCTION Recent technological innovations have caused an ever in- creasing interest in the study of hybrid systems and many significant results have appeared in the literature [9], [11], [26], [40]. A hybrid system has many operating modes, each one governed by its own characteristic dynamical law [15]. Typi- cally, mode transitions are classified as autonomous when they are triggered by variables crossing specific thresholds (state events) or by the elapse of certain time periods (time events), or controlled when they are triggered by external input events. A. Optimal control of Hybrid Systems: state of the art The problem of determining optimal control laws for hybrid systems and in particular for switched systems, has been extensively investigated in the last years and many results can be found in the control and computer science literature. Many authors considered very general problem statements so that it is only possible to derive necessary conditions for optimality, other authors provided methods for computing open-loop optimal trajectories. However very few practical algorithms were given for computing a state-feedback optimal control law. Here we review the most relevant literature. For continuous-time hybrid systems, Branicky and Mitter [10] compare several algorithms for optimal control, while To appear on the IEEE Trans. on Automatic Control, 2006. Branicky et al. [9] discuss general conditions for the existence of optimal control laws for hybrid systems. Necessary optimality conditions for a trajectory of a switched system are derived using the maximum principle by Sussmann [33] and Piccoli [26], who consider a fixed sequence of finite length. A similar approach is used by Riedinger et al. [28], who restrict the attention to linear quadratic cost functionals but considering both autonomous and controlled switches. Hedlund and Rantzer [20], [21] use convex dynamic pro- gramming to approximate hybrid optimal control laws and to compute lower and upper bounds of the optimal cost, while the case of piecewise-affine systems is discussed by Rantzer and Johansson [27]. For determining the optimal feedback control law these techniques require the discretization of the state space in order to solve the corresponding Hamilton-Jacobi- Bellman equations. Gokbayrak and Cassandras [19] use a hierarchical decom- position approach to break down the overall optimal control problem into smaller ones. In so doing, discretization is not involved and the main computational complexity arises from a higher-level nonlinear programming problem. In [11] Cassan- dras et al. consider a particular hybrid optimization problem of relevant importance in the manufacturing domain and develop efficient solution algorithms for classes of problems. Xu and Antsaklis have surveyed several interesting op- timal control problems and methods for switched systems in [38]. Among them, we mention an approach based on the parametrization of the switching instants [39] and one based on the differentiation of the cost function [36]. Using similar approaches, a problem of optimal control of switched autonomous systems is studied in [35]. However the method encounters major computational difficulties when the number of available switches grows. In [37] the authors consider a switched autonomous linear system with linear discontinuities (jumps) on the state space and a finite time performance index penalizing switching and a final penalty, and study the problem only for fixed mode sequences. Bengea and De Carlo [7] apply the maximum principle to an embedded system governed by a logic variable and a contin- uous control. The provided control law is open loop, however

Upload: others

Post on 11-May-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

1

Optimal Control of Continuous-Time SwitchedAffine Systems

Carla Seatzu, Daniele Corona, Alessandro GiuaDip. Ingegneria Elettrica ed Elettronica, Universita di Cagliari,

Piazza D’Armi, 09123 Cagliari, Italye-mail: {seatzu,daniele.corona,giua}@diee.unica.it

Alberto BemporadDip. Ingegneria dell’Informazione, Universita di Siena

Via Roma 56, 53100 Siena, Italye-mail: [email protected]

Abstract— The paper deals with optimal control of switchedpiecewise affine autonomous systems, where the objective is tominimize a performance index over an infinite time horizon. Weassume that the switching sequence has a finite length, and thatthe decision variables are the switching instants and the sequenceof operating modes. We present two different approaches forsolving such an optimal control problem. The first approachiterates between a procedure that finds an optimal switchingsequence of modes, and a procedure that finds the optimalswitching instants. The second approach is inspired by dynamicprogramming and identifies the regions of the state space wherean optimal mode switch should occur, therefore providing a statefeedback control law.

I. INTRODUCTION

Recent technological innovations have caused an ever in-creasing interest in the study of hybrid systems and manysignificant results have appeared in the literature [9], [11], [26],[40].

A hybrid system has many operating modes, each onegoverned by its own characteristic dynamical law [15]. Typi-cally, mode transitions are classified as autonomous when theyare triggered by variables crossing specific thresholds (stateevents) or by the elapse of certain time periods (time events),or controlled when they are triggered by external input events.

A. Optimal control of Hybrid Systems: state of the art

The problem of determining optimal control laws for hybridsystems and in particular for switched systems, has beenextensively investigated in the last years and many resultscan be found in the control and computer science literature.Many authors considered very general problem statements sothat it is only possible to derive necessary conditions foroptimality, other authors provided methods for computingopen-loop optimal trajectories. However very few practicalalgorithms were given for computing a state-feedback optimalcontrol law. Here we review the most relevant literature.

For continuous-time hybrid systems, Branicky and Mitter[10] compare several algorithms for optimal control, while

To appear on the IEEE Trans. on Automatic Control, 2006.

Branicky et al. [9] discuss general conditions for the existenceof optimal control laws for hybrid systems.

Necessary optimality conditions for a trajectory of aswitched system are derived using the maximum principle bySussmann [33] and Piccoli [26], who consider a fixed sequenceof finite length. A similar approach is used by Riedinger etal. [28], who restrict the attention to linear quadratic costfunctionals but considering both autonomous and controlledswitches.

Hedlund and Rantzer [20], [21] use convex dynamic pro-gramming to approximate hybrid optimal control laws and tocompute lower and upper bounds of the optimal cost, while thecase of piecewise-affine systems is discussed by Rantzer andJohansson [27]. For determining the optimal feedback controllaw these techniques require the discretization of the statespace in order to solve the corresponding Hamilton-Jacobi-Bellman equations.

Gokbayrak and Cassandras [19] use a hierarchical decom-position approach to break down the overall optimal controlproblem into smaller ones. In so doing, discretization is notinvolved and the main computational complexity arises from ahigher-level nonlinear programming problem. In [11] Cassan-dras et al. consider a particular hybrid optimization problem ofrelevant importance in the manufacturing domain and developefficient solution algorithms for classes of problems.

Xu and Antsaklis have surveyed several interesting op-timal control problems and methods for switched systemsin [38]. Among them, we mention an approach based onthe parametrization of the switching instants [39] and onebased on the differentiation of the cost function [36]. Usingsimilar approaches, a problem of optimal control of switchedautonomous systems is studied in [35]. However the methodencounters major computational difficulties when the numberof available switches grows. In [37] the authors consider aswitched autonomous linear system with linear discontinuities(jumps) on the state space and a finite time performance indexpenalizing switching and a final penalty, and study the problemonly for fixed mode sequences.

Bengea and De Carlo [7] apply the maximum principle to anembedded system governed by a logic variable and a contin-uous control. The provided control law is open loop, however

Page 2: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

2

some necessary and sufficient conditions are introduced foroptimality.

Shaikh and Caines [32] consider a finite-time hybrid optimalcontrol problem and give necessary optimality conditions fora fixed sequence of modes using the maximum principle. In[31] these results are extended to non-fixed sequences byusing a suboptimal result based on the Hamming distancepermutations of an initial given sequence. Finally, in [30], theauthors derive a feedback law (similar to that one considered inthis paper) but for a finite time LQR problem whose solutionsare strongly dependent of the initial conditions, thus providingopen-loop solutions.

Egerstedt, Wardi and Delmotte in [16] considered an opti-mal control problem for switched dynamical systems, wherethe objective is to minimize a cost functional defined on thestate and where the control variable consists of the switchingtimes. A gradient-descent algorithm is proposed based on anespecially simple form of the gradient of the cost functional.

The hybrid optimal control problem becomes less complexwhen the dynamics is expressed in discrete time or as discrete-events. For discrete-time linear hybrid systems, Bemporadand Morari [6] introduce a hybrid modeling framework that,in particular, handles both internal switches, i.e., caused bythe state reaching a particular boundary, and controllableswitches (i.e., a switch to another operating mode can bedirectly imposed), and showed how mixed-integer quadraticprogramming (MIQP) can be efficiently used to determineoptimal control sequences. They also show that when theoptimal control action is implemented in a receding horizonfashion by repeatedly solving MIQPs on-line, an asymptoti-cally stabilizing control law is obtained. For those cases whereon-line optimization is not viable, Bemporad et al. [1], [2]and Borrelli et al. [8] propose multiparametric programmingas an effective means for solving in state-feedback form thefinite-time hybrid optimal control problem with performancecriteria based on 1-, ∞-, and 2-norms, by also showing thatthe resulting optimal control law is piecewise affine.

In the discrete-time case, the main source of complexityis the combinatorial number of possible switching sequences.By combining reachability analysis and quadratic optimiza-tion, Bemporad et al. [3] propose a technique that rules outswitching sequences that are either not optimal or simply notcompatible with the evolution of the dynamical system.

For a special class of discrete-event systems, De Schutterand van den Boom [13], [29] proposed an optimal receding-horizon strategy that can be implemented via linear program-ming.

An algorithm to optimize switching sequences that has anarbitrary degree of suboptimality was presented by Lincolnand Rantzer in [23], and in [24] the same authors consider aquadratic optimization problem for systems where all switchesare autonomous.

B. The proposed approach

In this paper we focus our attention on switched systems,that are a particular class of hybrid systems in which allswitches are controlled by external inputs. Giua et al. [17], [18]

considered the optimal control of continuous-time switchedsystems composed by linear and stable autonomous dynamicswith a piecewise-quadratic cost function. The assumption isthat the switching sequence has finite length N and that themode sequence is fixed, so that only the switching instantsmust be optimized. They provided a numerically viable wayof computing a state-feedback control law in the form ofN switching regions, where the k-th switching region, k =1, . . . , N is the set of states where the k-th switch must occur.

In this paper, we solve an optimal control problem forcontinuous-time switched affine systems with a piece-wisequadratic cost function. We first present the procedure toconstruct the optimal switching regions for a finite-length fixedsequence. Secondly, we propose two different approaches tosolve a similar optimal control problem when in the finite-length switching sequence both the switching instants and themode sequence are decision variables.

The first approach is called master-slave procedure (MSP)[4] and exploits a synergy of discrete-time and continuous-time techniques alternating between two different procedures.The master procedure is based on mixed-integer quadraticprogramming (MIQP) and finds an optimal switching sequencefor a given initial state, assuming the switching instants areknown. The “slave” procedure is based on the constructionof the switching regions and finds the optimal switchinginstants, assuming the mode sequence is known. Although weformally prove that the algorithm always converges, the globalminimum may not always be reached. A few simple heuristicscan be added to the algorithm to improve its performance. Arelated approach that optimizes hybrid processes by combiningmixed-integer linear programming (MILP) to obtain a candi-date switching sequence and dynamic simulation was proposedin [25]. A two-stage procedure which exploits the derivativesof the optimal cost with respect to the switching instants wasproposed in [39].

The second approach, called switching table procedure(STP) [5], is based on dynamic programming ideas and allowsone to avoid the explosion of the computational burden withthe number of possible switching sequences. It relies onthe construction of switching tables and can be seen as ageneralization of the slave procedure. In fact, the switchingtables not not only specify the regions of the state space wherean optimal switch should occur, but also what the optimalnext dynamical mode must be. The solution is always globallyoptimal and in state-feedback form. A similar approach basedon the construction of “optimal switching zones” was alsoused in [30].

To summarize: STP is guaranteed to find the optimalsolution and provides a “global” closed-loop solution, i.e., thetables may be used to determine the optimal state feedbacklaw for all initial states. On the other hand, MSP is notguaranteed to converge to a global optimum: it only providesan open-loop solution for a given initial state. Note howeverthat, as a by-product, it also provides a “local” state-feedbacksolution, as the slave procedure consists of tables that may beused to determine a state feedback policy (this, however, isonly optimal for small perturbations around the given initialstate). Furthermore, MSP handles more general cost functions

Page 3: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

3

than STP, such as penalties associated with mode switching,and requires a lighter computational effort. Henceforth, bothprocedures have pros and cons, and preferring one to anotherwill depend on the application at hand.

Finally, in the last section of the paper we discuss thecomputational complexity of the two approaches.

The problem considered in this paper where the modesequence is a decision variable is significant in all thoseapplications where the controller has the ability of choosingamong several dynamics. There are many cases in which it isnecessary to consider finite length sequences as we do in thepaper. As an example, when there is a cost associated to eachswitch an infinite switching sequence would lead to an infinitecost. Furthermore, we also feel that solving the optimizationproblem in the case of a finite length sequence is a necessaryfirst step to derive an optimal control law for an infinite timehorizon and an infinite number of available switches: in theliterature this setting is typically considered when addressingstabilizability issues of switched linear autonomous systems(see for instance [14]).

The paper is structured as follows. In Section 2 we providethe exact problem formulation. In Section 3 we restrict ourattention to the case of a fixed sequence of modes. In Sec-tion 4 we illustrate the master-slave procedure. The switchingtable procedure is then illustrated in Section 5. A detailedcomparison among the two proposed approaches is performedin Section 6.

II. PROBLEM FORMULATION

We consider the following class of continuous-time hybridsystems, commonly denoted as switched affine systems,

x(t) = Ai(t)x(t) + fi(t), i(t) ∈ S, (1a)x(t+) = Ji,jx(t−) if i(t−) = i, i(t+) = j, (1b)

where x(t) ∈ Rn, i(t) ∈ S is the current mode and representsa control variable, S , {1, 2, . . . , s} is a finite set of integers,each one associated with a matrix Ai ∈ Rn×n and a vectorfi ∈ Rn, i ∈ S . Equation (1b) models a reset condition, byallowing that whenever at time t a switch from mode i(t−) = ito mode i(t+) = j occurs, the state jumps from x(t−) tox(t+) = Ji,jx(t−), where Ji,j ∈ Rn×n are constant matrices,i, j ∈ S , Ji,i = I , and the continuity of the state trajectory atthe switching instant from mode i to mode j is preserved ifJi,j = I .

In order to make (1) stabilizable on the origin, we assumethe following:

Assumption 2.1: There exists at least one mode i ∈ S suchthat Ai is strictly Hurwitz and fi = 0. ¥

A. Optimal control problem

The main objective of this paper is to solve the optimalcontrol problem

V ∗N , min

I,T{F (I, T )

,∫∞0

x′(t)Qi(t)x(t)dt +N∑

k=1

Hik−1,ik

}

s.t. x(t) = Ai(t)x(t) + fi(t)

x(0) = x0

i(t) = ik ∈ S for τk ≤ t < τk+1, k = 0, . . . , N,

0 = τ0 ≤ τ1 ≤ . . . ≤ τN < τN+1 = +∞,

x(τ+k ) = Jik−1,ik

. . . Jih−1,ihx(τ−h )

if τh−1 < τh = . . . = τk < τk+1,(2)

where Qi are positive semi-definite matrices, and x0 is theinitial state of the system.

In this optimization problem there two types of decisionvariables:• T , {τ1, . . . , τN} is a finite sequence of switching times;• I , {i0, . . . , iN} is a finite sequence of modes.

Accordingly, the cost consists of two components: a quadraticcost that depends on the time evolution (the integral) and acost that depends on the switches (the sum), where Hi,j ≥ 0,i, j ∈ S , is the cost for commuting from mode i to mode j,with Hi,i = 0, ∀i ∈ S .

Note that in the last equation of (2), we slightly generalizedmodel (1b) by allowing that more than one consecutive switchmay occur at the same time instant τh = τh+1 = · · · = τk.

Denote by i∗(t), t ∈ [0,+∞), i∗(t) = i∗k for τ∗k−1 ≤ t <τ∗k , k = 0, . . . , N , the switching trajectory solving (2), andby I∗, T ∗ the corresponding optimal sequences. By lettingδk , τk − τk−1 ≥ 0 be the time interval elapsed betweentwo consecutive switches, k = 1, . . . , N , the optimal controlproblem (2) can be rewritten as

V ∗N , min

I,T

{N∑

k=0

[x′kQik

(δk+1)xk + cik(δk+1)xk

+αik(δk+1)] +

∑Nk=1 Hik−1,ik

}

s.t. xk+1 = Jik,ik+1Aik(δk+1)xk + fik

(δk+1),k = 0, . . . , N − 1

x0 = x(0)(3)

whereAi(δ) , eAiδ,

fi(δ) ,∫ δ

0

eAitfidt,(4)

Qi(δ), ci(δ), αi(δ) can be obtained by simple integration andlinear algebra, as reported in Appendix A, or even resortingto numerical integration.

B. Affine versus linear models

Before proceeding further, we observe that the originalaffine dynamics (1a) can be rewritten as a linear dynamics

Page 4: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

4

by simply augmenting the state space from Rn to Rn+1:

d

dt

[x(t)x(t)

]=

[Ai(t) fi(t)

0 0

] [x(t)x(t)

](5)

with x(0) = 1. Note that the (n+1)-th state variable x(t) is afictitious variable that does not influence the cost function. Ifthe new weighting matrices are semi-definite matrices of theform [

Qi 00 0

]

for all i ∈ S .Henceforth, without loss of generality, in the rest of the

paper when necessary we will deal with the optimal control ofswitched piecewise linear systems whose performance indexis the same as in the previous formulation (2). This will bedone in Section 3 and Section 5, where the procedures basedon the construction of the switching tables are presented.

On the contrary, the master-phase of the procedure discussedin Section 5 may explicitly handle affine models and weprefer to deal with the general form (1a) when presenting thisapproach.

We also observe that Assumption 2.1 is sufficient to ensurethat the system is stabilizable on the origin (and hence that theoptimal control problem we consider is solvable with a finitecost) but it is not strictly necessary. As an example, assumethat all dynamics Ai have a displacement term fi 6= 0 butthat at least one dynamics, say Aj , is Hurwitz. One can makea linear state-coordinate transformation x → z + A−1

j fj andpenalize — whenever mode i is active — the deviation fromthe target state through the quadratic term (x−A−1

j fj)′Qi(x−A−1

j fj) = z′Qiz.

III. FIXED MODE SEQUENCE

For ease of exposition, in this section the attention is focusedonto the case in which the sequence of operating modes isfixed and only the switching instants are decision variables,which is a common ingredient both for the slave-phase of themaster-slave algorithm and for the switching table procedurepresented in the next sections.

We consider linear dynamics as explained in Subsection II-B. Given that the switching sequence I = {i0, . . . , iN} is pre-assigned, to simplify the notation we denote the state matricesas Ak , Aik

for k = 0, · · · , N . We also denote the jump(resp., switching cost) matrices as Jk , Jik−1,ik

(resp., Hk ,Hik−1,ik

) for k = 1, · · · , N .Let us also observe that in the general optimization prob-

lem (2) although the number of allowed switches is N , itmay possible to consider also solutions where only m <N switches effectively occur. This can be done choosingim = im+1 = · · · = iN : in this case the switching costonly depends on the first m switches, because by definitionHim,im+1 = . . . = HiN−1,iN

= 0 (recall that Hi,i = 0).We also want to keep this additional feature when restrictingour attention to the fixed mode sequence problem formulation.Thus we explicitly introduce a new variable m ≤ N that isequal to the number of switches effectively occurring in anoptimal solution. Accordingly, we assume that τm+1 = · · · =

τN = τN+1 = +∞ so that once the system switches to modeAm at time τm, it will always remain in that mode.

Summarizing, the optimization problem we consider in thissection is

V ∗N , min

T

{F (T ) ,

∫ ∞

0

x′(t)Qi(t)x(t)dt +m∑

k=1

Hk

}

s.t. x(t) = Akx(t) for τk ≤ t < τk+1, k = 0, . . . ,m,

x(0) = x0

0 = τ0 ≤ τ1 ≤ . . . ≤ τm < τm+1 = +∞,

x(τ+k ) = Jk . . . Jhx(τ−h )

if τh−1 < τh = . . . = τk < τk+1,

m ≤ N(6)

or equivalently

minT

{m∑

k=0

x′kQk(δk+1)xk +m∑

k=1

Hk

}

s.t. xk+1 = Jk+1Ak(δk+1)xk, k = 0, . . . ,m− 1x0 = x(0)m ≤ N

(7)

where for ease of notation we have set

Ak(δk+1) , eAk(τk+1−τk), k = 0, . . . , m− 1,

Qk(δk+1) , Qik(τk+1 − τk), k = 0, . . . , m.

(8)

Now, we show that the optimal control law for the aboveoptimization problem takes the form of a state–feedback, i.e.,to determine if a switch from Ak−1 to Ak should occur it isonly necessary to look at the current system state x. Moreprecisely, the optimization problem can be solved computinga set of tables Ck (k = 1, . . . , N ). Each table represents aportion of the state space Rn in two regions: R and R′. Ifthe current system dynamics is Ak−1 we will switch to Ak assoon as the state reaches a point in the region R of the tableCk, for k = 1, . . . , N .

To prove this result, we also show constructively how thetables Ck can be computed.

A. Computation of the Switching Tables

The cost associated to any evolution of the system consistsof two parts: the cost associated to the event–driven evolution,i.e., to the number of switches that occur, and the cost ofthe time–driven evolution. We will consider the two partsseparately.

Definition 3.1 (Event cost): Let us assume that after kswitches the current system dynamics is that correspondingto matrix Ak: in the future evolution up to N − k switchesmay occur. We define the remaining event cost starting fromdynamics Ak and executing j = 0, 1, . . . , N−k more switchesrecursively as follows:

Ek,0 = 0, and Ek,j = Ek,j−1 + Hk+j for j ≥ 1.

¥

Page 5: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

5

In a similar manner we would also like to compute the costof the time–driven evolution.

Definition 3.2 (Time cost): Let us assume that after kswitches the current system dynamics is that correspondingto matrix Ak and the current state vector is x. The remainingtime cost starting from the initial state x with dynamics Ak

and executing j = 0, 1, . . . , N − k additional switches is

Tk,j(x, %1, . . . , %j) = x′Qk(%1)x

+x′eA′k%1J ′k+1Qk+1(%2)Jk+1eAk%1x

+...

+x′eA′k%1J ′k+1 · · · eA′k+j−1%j J ′k+jQk+j(+∞) ·· Jk+je

Ak+j−1%j · · · Jk+1eAk%1x,

where %i = τk+i−τk+i−1 ≥ 0 represents the time spent withindynamics Ak+i−1. ¥Function Tk,j(x, %1, . . . , %j) depends on j different parameters%i (i = 1, . . . , j). We need to compute the optimal time cost bya suitable choice of these parameters. It is easy to prove usingsimple dynamic programming arguments that this optimal costcan be computed by solving j one-parameter optimizations.

Procedure 1: The optimal value

T ∗k,j(x) = min%1,...,%j≥0

Tk,j(x, %1, . . . , %j)

can be recursively computed as follows.• Assume that j = 0, i.e., no future switch occurs. Then

there is only one possible future evolution (henceforth itis optimal): the system evolves for ever with dynamicsAk. The optimal remaining cost is

T ∗k,0(x) = x′Qk(+∞)x. (9)

We also define, with a notation that will be clear in thesequel, %k,0(x) = +∞.

• Assume that j additional switches occur, with j =1, . . . , N − k. We first consider a remaining evolutionsuch that: (a) the system evolves with dynamics Ak for atime %; (b) a switch to Ak+1 occurs after %; (c) the futureevolution is the optimal evolution that allows only j − 1additional switches. The remaining cost starting from xdue to this time–driven evolution is

Tk,j(x, %) = x′Qk(%)x + T ∗k+1,j−1(Jk+1eAk%x). (10)

We define the value of % that minimizes (10) for all valuesof j = 1, . . . , N − k 1:

%k,j(x) = arg min%≥0

Tk,j(x, %), (11)

and denote the optimal value as

T ∗k,j(x) = Tk,j(x, %k,j(x)). (12)

It is obvious that

T ∗k,j(x) , min%≥0 Tk,j(x, %)

= min%1,...,%j≥0 Tk,j(x, %1, . . . , %j) , T ∗k,j(x).

¥1We can have that %k,j(x) is a set (not a single value). In this case we

assume a single value (i.e., the minimum) is taken.

Let us now state an elementary result.Proposition 3.1: If x is a vector such that x = λy, with

‖y‖2 = 1 and λ ∈ R \ {0}, the cost function of the time-driven evolution is such that

(a) T ∗k,j(x) = λ2T ∗k,j(y); (13)(b) %k,j(x) = %k,j(y). (14)

Proof: This can be proved inductively.Clearly the result holds for j = 0 (base step) because by

definition

T ∗k,0(x) = x′Qk(+∞)x = λ2y′Qk(+∞)y = λ2T ∗k,0(y),

and

%k,0(x) = %k,0(y) = ∞.

Assume the result holds for T ∗k,j−1(x); we show that it alsoholds for T ∗k,j(x) (inductive step). In fact:

Tk,j(x, %) = x′Qk(%)x + T ∗k+1,j−1(Jk+1eAk%x)

= λ2y′Qk(%)y + λ2T ∗k+1,j−1(Jk+1eAk%y)

= λ2Tk,j(y, %),

and from this it immediately follows that:

T ∗k,j(x) = λ2T ∗k,j(y),

and

%k,j(x) = arg min%≥0

Tk,j(x, %) = arg min%≥0

λ2Tk,j(y, %)

= arg min%≥0

Tk,j(y, %) = %k,j(y).

Having introduced the necessary notation, we can finallycompute the optimal evolution that starts from a vector x, interms of the optimal evolution that starts from a vector y onthe unitary semi-sphere and parallel to x.

Theorem 3.1: Let Ak be the current dynamics and let thecurrent state vector at time t be x = λy with ‖y‖2 = 1 andλ ∈ R \ {0}.

i) The optimal remaining cost starting from x is

Fk(x) = minj=0,...,N−k

{λ2T ∗k,j(y) + Ek,j}, (15)

ii) The optimal remaining number of switches starting fromx is

jk(x) = arg minj=0,...,N−k

{λ2T ∗k,j(y) + Ek,j} (16)

iii) The optimal evolution switches to Ak+1 at time τk+1 =t + δk+1(x), where

δk+1(x) = %k,jk(x)(x) = %k,jk(x)(y). (17)

Proof: The optimal remaining cost starting from x de-pends on a discrete decision variable, i.e., the number of

Page 6: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

6

switches j that in this case belongs to the set {0, · · · , N − k}and on the continuous decision variables %i’s. Thus:

Fk(x) = minj = 0, · · · , N − k

%1, . . . , %j ≥ 0

{Tk,j(x, %1, . . . , %j) + Ek,j}

= minj=0,··· ,N−k

{ min%1,...,%j≥0

Tk,j(x, %1, . . . , %j) + Ek,j}= min

j=0,··· ,N−k{min

%≥0Tk,j(x, %) + Ek,j}

= minj=0,··· ,N−k

{T ∗k,j(x) + Ek,j}= min

j=0,··· ,N−k{λ2T ∗k,j(y) + Ek,j}

and the other two statements trivially follow from this. ¤According to the previous proposition, assume that k

switches have occurred and Ak is the current dynamics withcurrent state vector x. Then, the remaining cost is minimizedby an evolution that executes immediately the k +1-th switchto Ak+1 if and only if δk+1(x) = 0. This leads to the definitionof a switching table.

Definition 3.3: The table Ck is a partition of the state spacein two regions:

• the optimal region R for the k−th switch is defined asfollows: ∀ x 6= 0, x ∈ R if δk(x) = 0. Moreover, sincewe want R to be a closed region, we assume that 0 ∈ Rif 0 ∈ ∂R where ∂R is the boundary of R.

• The complementary region: R′ = Rn \ R.

¥The following result, that immediately follows from Theo-

rem 3.1 and Definition 3.3, characterizes the switching regions.Corollary 3.1: A state vector x = λy, with ‖y‖2 = 1 and

λ ∈ R \ {0}, belongs to region R of Ck+1 if and only if thereexists an index j∗ ∈ {1, · · · , N − k} such that the followingtwo conditions are both verified:

(a) λ2T ∗k,j∗(y) + Ek,j∗ = minj=0,··· ,N−k

{λ2T ∗k,j(y) + Ek,j

}(18)

(b) %k,j∗(y) = 0. (19)

¥A final observation. To compute the switching table Ck+1

and to determine the optimal remaining cost Fk(x), we onlyneed to compute the value %k,j(y) with a one-parameteroptimization (see equations (11) and (14)) for all y on theunitary semi-sphere: this can be easily done with a numericalprocedure.

We discretize the unitary semisphere with the proceduredescribed in Appendix B. In particular, in all the examplesexamined the number of samples has been heuristically chosento ensure a reasonable tradeoff between accuracy and compu-tational cost.

The corresponding values of T ∗k,j(y) can be obtained ap-plying equation (12), while to determine if a vector x = λybelongs to R and to compute the corresponding optimalremaining cost we only need to apply equations (18) and (19).

B. Structure of the Switching Regions

We now discuss the form that the switching regions maytake.

Let us first consider the case of zero switching costs.Proposition 3.1: Consider the case in which

H1 = · · · = HN = 0. Then for all k = 0, . . . , N − 1the switching region R of table Ck+1 is such that:

y ∈ R =⇒ (∀λ ∈ R) λy ∈ Ri.e., the region R is homogeneous.

Proof: Thanks to equation (16), it is immediate to seethat if all costs are zero

jk(x) = arg minj=0,...,N−k λ2T ∗k,j(y)

= arg minj=0,...,N−k T ∗k,j(y) = jk(y)

and by equation (17) δk+1(x) = δk(y). Thus δk+1(y) = 0 =⇒δk+1(x) = 0. ¤

We now consider the case of non-zero switching costs. Letus first state a trivial fact.

Fact 3.1: For all x ∈ Rn, k = 1, . . . , N and j =1, . . . , N − k it holds: T ∗k,j(x) ≤ T ∗k,j−1(x).

Proof: This can be easily shown using the definition oftime cost. In fact

T ∗k,j(x) = T ∗k,j(x) = min%1,...,%j−1,%j≥0

Tk,j(x, %1, . . . , %j−1, %j)

≤ min%1,...,%j−1≥0

Tk,j(x, %1, . . . , %j−1, +∞)

= min%1,...,%j−1≥0

Tk,j−1(x, %1, . . . , %j−1)

= T ∗k,j−1(x) = T ∗k,j−1(x)

¤We can finally state the following result.Proposition 3.2: For all k = 0, . . . , N − 1, and for all y ∈

Rn (with ‖y‖2 = 1) there exists a finite λ(k, y) > 0, thatdepends on k and y, such that the switching region R of tableCk+1 has the following property:

λ(k, y)y ∈ R =⇒ (∀λ : |λ| ≥ λ(k, y)) λy ∈ R.

Proof: For all k and for all y on the unitary semi-spherewe can define

= min{j | T ∗k,j(y) = T ∗k,N−k(y)}.This allows us to write, also according to Fact 3.1, that the

optimal remaining time costs can be ordered as follows

T ∗k,0(y) ≥ T ∗k,1(y) ≥ . . . > T ∗k,(y) = · · · = T ∗k,N−k(y),

while by definition the remaining event costs can be orderedas follows

Ek,0 ≤ Ek,1 ≤ . . . ≤ Ek,k(y) ≤ · · · ≤ Ek,N−k+1.

We now define

λ(k, y) =

0 if = 0

maxj=0,...,−1

√Ek, − Ek,j

T ∗k,j(y)− T ∗k,(y)otherwise

Page 7: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

7

−1 0 1

−0.5

0

0.5

1C1 C

2

C3

−1 0 1

−0.5

0

0.5

1

−1 0 1

−0.5

0

0.5

1

−1 0 1

−0.5

0

0.5

1

Fig. 1. The switching regions Ck , k = 1, 2, 3 in the case of no cost associatedto switches, and the system evolution for x0 = [0.6 0.6]′.

so that we can write that for all λ ∈ R with |λ| ≥ λ(k, y) andfor all j = 0, . . . , N − k + 1, it holds

λ2T ∗k,(y) + Ek, ≤ λ2T ∗k,j(y) + Ek,j .

Thus the optimal remaining evolution starting from x = λywith |λ| ≥ λ(k, y) will contain more switches and x belongsto R if and only if %k(y) = 0. ¤

We finally denote

λ = maxk=1,...,N

max|y|=1

λ(k, y). (20)

C. Numerical Examples

Let us now present the results of some numerical simula-tions. In particular, we consider a second order linear systemwhose dynamics may only switch between two matrices A(1)

and A(2). We also assume that only three switches are possible(N = 3) and the initial system dynamics is A0 = A(1). Thus,the sequence of switching is A0 = A(1) → A1 = A(2) →A2 = A(1) → A3 = A(2), where

A(1) =[ −1 1−18 −5

], A(2) =

[1 −51 −3

].

We also assume that all Jk’s are equal to the identity matrix.Finally, we take Q0 = Q1 = Q2 = Q3 = diag{1 2}.

We consider two different cases. We firstly assume thatno cost is associated to switches. Secondly, we associate aconstant cost to each switch.First case

The switching regions Ck, k = 1, 2, 3, are shown in Figure 1where the following color notation has been used: the lighter(green) region represents the set of states where the systemswitches to the next dynamics, while the darker (blue) regionrepresents the set of states where the system still evolves withthe same dynamics. Note that these regions have only beendisplayed inside the unit disc because they are homogeneous.

In the bottom right of Figure 1 we have shown the systemevolution in the case of x0 = [0.6 0.6]′.

The switching times are τ1 = 0.01, τ2 = 0.35 and τ3 =0.40, and the optimal cost is F (τ1, τ2, τ3) = 0.15.

−2 0 2−2

−1

0

1

2

−2 0 2−2

−1

0

1

2

−2 0 2−2

−1

0

1

2

C1 C

2

C3

−2 0 2−2

−1

0

1

2

Fig. 2. The switching regions Ck , k = 1, 2, 3 in the case of non-zero costsassociated to switches, and the system evolution for x0 = [1.3 1.4]′.

−2 −1 0 1 2−2

−1

0

1

2

Fig. 3. The switching regions C3 for different values of the cost H3 ∈{0.1, 0.5, 2}.

Second caseNow, let us assume that non-zero costs are associated to

switches. In particular, let us assume that H1 = H3 = 0.3 andH2 = 0.1.

The switching regions Ck, k = 1, 2, 3, are shown in Figure 2where we used the same color notation as above, i.e., thelighter (green) region represents the set of states where thesystem switches to the next dynamics, and the darker (blue)region represents the set of states where the system stillevolves with the same dynamics.

In this example λ is < 2 and it is sufficient to display theregions within the circle of radius 2.

In the bottom right of Figure 2 we have shown the systemevolution in the case of x0 = [1.3 1.4]′. In this case, theswitching times are τ1 = 0.014, τ2 = 0.5 and τ3 = +∞, andthe optimal cost is F (τ1, τ2, τ3) = 0.75.

Modification of the regionsTo show how the switching region Ck may change as Hk

varies, we have also computed for this example the regionsC3 for different values of H3 ∈ {0.1, 0.5, 2}.

These regions are shown in Figure 3, where larger regionscorrespond to smaller values of H3.

Page 8: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

8

IV. MASTER-SLAVE PROCEDURE

In this section we propose a solution to the optimal controlproblem (2) in which both the switching instants and theswitching sequence are decision variables, and the initial statex(0) is given. The procedure exploits a synergy of discrete-time and continuous-time techniques, by alternating betweena “master” procedure that finds an optimal switching sequenceand a “slave” procedure that finds the optimal switchinginstants.

Problem 1 (Master): For a fixed sequence of switchingtimes τ1, . . . , τN , solve the optimal control problem (3) withrespect to i0, . . . , iN . Denote by

{i0, . . . , iN} = fM (τ1, . . . , τN ) (21)

and VM (τ1, . . . , τN ) the optimizing mode sequence and thecorresponding optimal value, respectively. ¥

Problem 2 (Slave): For a fixed sequence of switching in-dices ı0, . . . , ıN , solve the optimal control problem (3) withrespect to τ1, . . . , τN . Denote by

{τ1, . . . , τN} = fS (ı0, . . . , ıN ) (22)

and VS (ı0, . . . , ıN ) the optimizing timing sequence and thecorresponding optimal value, respectively. ¥An approach for solving the slave phase has been extensivelydiscussed in the previous section. Here below we describe away to solving the master phase.

A. Master Algorithm

For a fixed sequence of switching times τ1, . . . , τN , themaster algorithm solves the optimal control problem (3) withrespect to i0, . . . , iN . We assume here that τN < +∞; if suchis not the case the problem can be simplified discarding theinfinity switching times τk+1 = · · · = τN = +∞ and workingon the shorter prefix τ1 ≤ · · · ≤ τk < +∞.

It is a purely combinatorial problem that can be rephrasedas:

minI

{F (I) ,

N∑

k=0

[x′kQik

(k)xk + cik(k)xk + αik

(k)]

+∑N

k=1 Hik−1,ik

}

s.t. xk+1 = Jik,ik+1Aik(k)xk + fik

(k),k = 0, . . . , N − 1

x0 = x(0),(23)

whereAik

(k) , eAik(τk−τk−1),

fik(k) ,

∫ τk

τk−1

eAik(τk−t)fik

dt,

Qik(k) , Qik

(τk − τk−1)

cik(k) , cik

(τk − τk−1)

αik(k) , αik

(τk − τk−1)

(24)

and where Qik(δk), cik

(δk) and αik(δk) can be computed as

outlined in Appendix A or resorting to numerical integration.

Problem (23) can be efficiently solved via Mixed-IntegerQuadratic Programming (MIQP) [22], [12]. To this end, weneed to introduce the binary variables γk

i ∈ {0, 1}, whereγk

i = 1 if and only if the system is in the i-th mode betweentime τk and τk+1:

[γki = 1] ↔ [ik = i], ∀k = 0, . . . , N, ∀i ∈ S, (25a)

s⊕

i=1

γki = 1, ∀k = 0, . . . , N, (25b)

i∈Sas

γNi = 1, (25c)

where the exclusive-or constraint (25b) follows by the fact thatonly one dynamics can be active in each interval [τk, τk+1),and in (25c) Sas is the set of indices i ∈ S such that Ai

is strictly Hurwitz and fi = 0, so that the last dynamicsbe asymptotically stable and linear (Sas is nonempty byAssumption 2.1).

We also need to introduce the continuous variables z0i ∈ Rn,

where z0i = x(0) if i0 = i or zero otherwise,

z0i = x0γ

0i , ∀i ∈ S, (26)

and the continuous variables zki,j ∈ Rn, j ∈ S , k = 1, . . . , N ,

where zki,j = x(τ+

k ) if ik−1 = i, ik = j, or zero otherwise:

zki,j = Ji,j(Ai(k)xk + fi(k))γk−1

i γkj ,

∀k = 1, . . . , N, ∀i, j ∈ S,(27a)

xk =∑s

i,j=1 zki,j , ∀k = 1, . . . , N. (27b)

Constraint (26) can be transformed into the following set ofmixed-integer linear inequalities by using the so-called “big-M” technique [34], [6]:

z0i ≤ x0 + M(1− γ0

i ), i ∈ S,−z0

i ≤ −x0 + M(1− γ0i ), i ∈ S,

z0i ≥ −Mγ0

i ,z0i ≤ Mγ0

i

(28)

where M ∈ Rn is an upper bound on the state vector x (moreprecisely, the j-th component M j of M is an upper bound on|xj |, where xj is the j-th component of the state vector), andtherefore an upper bound on x0 and on xi,j

k+1 = Ji,j(Ai(k)xk+fi(k)), for all k = 0, . . . , N − 1, i, j ∈ S , where xi,j

k+1 wouldbe the state at time τk+1 if at time τk the system switches fromthe ith to the jth mode. Usually a suitable M can be chosen onthe basis of physical considerations on the switched system.

Constraint (27a) can be also transformed into a set ofmixed-integer linear inequalities by generalizing the abovetransformation to the case of the product of an affine functionof continuous variable and two integer variables as in (27a),namely by transforming the conditions

[γk−1i = 0] ∨ [γk

j = 0] → [zki,j = 0], (29a)

[γk−1i = 1] ∧ [γk

j = 1] → [zki,j = Ji,j(Ai(k)xk

+fi(k))],(29b)

where ∨, ∧ denote the logic “or” and “and”, respectively, into

Page 9: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

9

the linear mixed-integer inequalities

zki,j ≤ Mγk−1

i , (30a)

zki,j ≤ Mγk

j , (30b)

−zki,j ≤ Mγk−1

i , (30c)

−zki,j ≤ Mγk

j , (30d)

zki,j ≤ Ji,j(Ai(k)xk + fi(k)) + M(2− γk−1

i − γkj ), (30e)

−zki,j ≤ −Ji,j(Ai(k)xk − fi(k)) + M(2− γk−1

i − γkj ),(30f)

∀k = 1, . . . , N, ∀i, j ∈ S.

Note that in the absence of resets (J = I), it is not necessaryto introduce Ns2 real vectors zk

i,j , as by proceeding asin (26),(28) Ns vectors zk

i would be sufficient.Finally, constraints (25b)–(25c) can be expressed as

s∑

i=1

γki = 1, ∀k = 0, . . . , N,

γNi = 0, ∀i 6∈ Sas.

(31)

The terms Hik,ik+1 in (23) can be instead expressed as aquadratic function of the γ variables,

Hik,ik+1 =

γ1k

. . .γs

k

0 H12 . . . H1s

H21 0 . . . H2s

......

. . ....

Hs1 Hs2 . . . 0

γ1k+1

. . .γs

k+1

.

(32)Note that (32) only contains terms γi

k, γjk+1, and therefore the

cost term∑N

k=0 Hik,ik+1 leads to a nonconvex quadratic func-tion of the vector of integer variables. In order to overcomethis issue2, we add a constant term K in the cost functionin (23), K ∈ R. This clearly does not change the optimalswitching sequence. Then, by virtue of (31), we substitute

K =∑

k=0...Ni=1...s

K

(N + 1)γi

k (33a)

=∑

k=0...Ni=1...s

K

(N + 1)(γi

k)2 (33b)

and choose K large enough so that the overall cost functionis a convex function.

Summing up, the master problem (23) is equivalent to theMIQP

minxk, γk

i , zki

k = 1, . . . , N + 1i = 1, . . . , s

s∑

i=1

[(z0

i )′Qi(0)z0i + ci(0)z0

i + αi(0)γ0i

]

+N∑

k=1

s∑

i=1

αi(k)γki +

s∑

j=1

[(zk

i,j)′Qi(k)zk

i,j

+ci(k)zki,j

]+ (32) + (33b)

s.t. (27b), (28), (30), (31).(34)

2Mixed-integer quadratic programming solvers determine the solution bysolving a sequence of standard quadratic programs in which the integervariables are either fixed or relaxed between the whole interval [0, 1]. SuchQP problems must be convex problems in order to be solved efficiently.

Note that additional constrains on the possible modeswitches can be easily embedded in (34) as linear integerconstraints. For example, [γk−1

i = 1] → [γkj = 0] is

equivalent to γk−1i − (1− γk

j ) ≤ 0.Another interesting case is that in which the initial mode

i0 = ı is assigned. In this case we add the constraint γ0ı = 1.

B. Slave Algorithm

The slave algorithm has been extensively discussed in theprevious Section 3. Note however that in the problem formu-lation (6) an integer variable m ≤ N has been introduced tokeep into account the number of switches effectively occurringin an optimal solution. Now, a sequence of τ ’s, namely,{τ1, . . . , τN}, of fixed length N is needed to iterate betweenthe two procedures. This has two important consequences.• Firstly, in the case of m < N , we complete the time

sequence by simply taking τm+1 = . . . = τN = +∞.• Secondly, all switching costs Hk, k = 1, . . . , N con-

tribute to the performance index F (T ). As a conse-quence, the term

∑mk=1 Hk in (6) should be replaced

by the constant term∑N

k=1 Hk. Thus, being this termconstant, it can be obviously neglected when solving theslave phase.

C. Master-Slave Algorithm

The proposed master-slave algorithm is structured as fol-lows:

Algorithm 4.1:

1. Initialize T (0) ← {τ1, . . . , τN}, k = 1, I(0) =,

{−1, . . . ,−1};(e.g., τk are randomly or uniformly

distributed); Let ε > 0 a given tolerance;

2. Solve the master problem I(k) ← fM (T (k − 1));3. If

|F (T (k − 1), I(k))− F (T (k − 1), I(k − 1))| ≤ ε (35)

set T (k) ← T (k − 1) and go to 7.

4. Solve the slave problem T (k) ← fS(I(k));5. k ← k + 1;6. Go to 2.;

7. Set {τ1, . . . , τN} ← T (k), {i0, . . . , iN} ← I(k);8. End

Proposition 4.1: Algorithm 4.1 stops after a finite numberof steps Nstop.

Proof: Let V (k) , F (T (k), I(k)). Clearly,

V (k − 1) = F (T (k − 1), I(k − 1)) ≥ F (T (k − 1), I(k))≥ F (T (k), I(k)) = V (k).

Since {V (k)} is a monotonically nonincreasing sequencebounded between V (0) and 0, it admits a limit as k → ∞.Therefore, V (k)− V (k − 1) → 0 as k →∞, and hence (35)

Page 10: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

10

is satisfied after a finite number kε of iterations for any givenpositive tolerance ε.

Definition 4.1: The optimal control problem (2) is saidswitch-degenerate if there exist a sequence T and I1 6= I2

such that F (I1, T ) = F (I2, T ). ¥Definition 4.2: The optimal control problem (2) is said

time-degenerate if there exist a sequence I and T1 6= T2 suchthat F (I, T1) = F (I, T2). ¥

Note that the result of Proposition 4.1 also holds in the caseof degeneracy.

We remark that although Algorithm 4.1 converges to asolution (I, T ) after a finite number Nstop of steps, such asolution may not be the optimal one, as it may be a localminimum where both the master and the slave problems donot give any further improvement. Note that the global solutioncan be computed by enumeration by solving a slave problemfor all possible sN switching sequences I .

Algorithm 4.1 computes the optimal switching policy fora given initial state. On the other hand, for small enoughperturbations of the initial state such that the optimal switchingsequence does not change, the optimal time-switching policy isimmediately available as a by-product of the slave algorithm,because of its state-feedback nature.

We finally remark that Algorithm 4.1 may be formulated byoptimizing with respect to T first, for a given initialization ofthe switching sequence I . The advantage of switching betweenthe master and slave procedures depends on the informationavailable a priori about the optimal solution. For instance whenthe algorithm is solved repeatedly for subsequent values of thestate vector (such as in a receding horizon scheme), it may beuseful to use the previous switching sequence as a warm startand optimize with respect to T first.

We finally remark the following about degeneracies:1) Time-degeneracy: ik = ik−1 implies that the switching

instant τk is undetermined (multiple solutions for T )2) Switch-degeneracy: τk = τk−1 implies that mode ik is

undetermined (multiple solutions for I)Ways to handle such degenerate cases will be highlighted inthe next section.

D. Numerical Examples

Example 1Consider a second order linear system whose dynamics may

be chosen within a finite set {A1, A2, A3}, where

A1 =[ −5.179 −1.414

1 0

], A2 =

[ −10.115 −3.0822 0

],

A3 =[ −2.414 −1.414

1 0

].

We associate to each dynamics a weight matrix:

Q1 = diag{1, 1}, Q2 = diag{8, 2}, Q3 =[

1 0.50.5 1

].

As only three modes are possible, s = 3, the control variablei(t) only takes values from the finite set of integers S ={1, 2, 3}. Let the initial state vector be x0 = [1 1]′ and N = 3be the number of allowed switches.

step τ1 τ2 τ3 i0 i1 i2 i3 F(I,Τ )1 M 0.290 0.498 0.672 1 3 3 3 1.446191 S 0.280 0.290 0.300 1 3 3 3 1.446152 M 0.280 0.290 0.300 1 2 3 3 1.444592 S 0.180 0.240 0.240 1 2 3 3 1.440263 M 0.180 0.240 0.240 1 2 3 3 1.44026

TABLE IRESULTS OF EXAMPLE 1.

Algorithm 4.1 is applied to determine the optimal modeand timing sequence with the initial timing sequence T0 ={0.290, 0.498, 0.672} (randomly generated). The resulting op-timized mode sequence is I∗ = {1, 2, 3, 3} and the optimalcost value is V ∗

3 = 1.44026. Note that in this case only twoswitches are required to get the optimal cost value.

Detailed intermediate results are reported in Table 1, whereone may also observe that the procedure converges after only3 steps. This also implies that the most burdensome part ofthe algorithm, i.e., the slave problem, is only solved twice.

The correctness of the solution has been validated throughan exhaustive inspection of all admissible mode sequences.More precisely, for each admissible mode sequence the cor-responding optimal timing sequence and cost value werecomputed by the slave algorithm. As a result, it turns outthat V ∗

3 = 1.44026 is indeed a global minimum. Obviously,being only two the switches required to optimize the costvalue, the minimum cost may also be obtained by usingother mode sequences. As an example, I = {3, 1, 2, 3} andT = {0, 0.180, 0.240} is an optimal solution as well.

Several random tests highlighted that the convergence ofthe algorithm to a global minimum is heavily influenced bytwo factors. First, the initial switching times sequence shouldbe such that τk > τk−1. In fact, if τk = τk+1 for some k,only a suboptimal solution — that corresponds to a smallernumber of switches — is usually computed. Second, the firstswitching time should not be greater than two or three timesthe maximum time constant associated to each dynamics: ifthis is not the case, only degenerate solutions with no switchare usually found.Example 2

We present here an heuristics that in many cases improvesthe performance of the Algorithm 4.1. Consider the secondorder switched linear system with dynamic matrices

A1 =[

1 −10100 1

], A2 =

[1 −10010 1

],

A3 =[ −0.1 0

0 −0.1

]

(f1 = f2 = f3 = 0) and let Q1 = Q2 = Q3 = I , N = 3,x0 = [1 1]′. Note that while A1 and A2 are unstable matrices,A3 is strictly Hurwitz, so that Assumption 2.1 is satisfied.

We take as initial timing sequence T0 ={0.001, 0.005, 0.010} and apply the master-slave algorithm todetermine the optimal mode sequence. The provided solutionis I = {1, 1, 2, 3} and the corresponding performance indexis V3 = 1.42998. Detailed results are reported in Table II.

Page 11: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

11

step τ1 τ2 τ3 i0 i1 i2 i3 F(I,Τ )1 M 0.001 0.005 0.010 2 2 2 3 5.630171 S 0.000 0.000 0.009 2 2 2 3 5.630172 M 0.000 0.000 0.009 1 1 2 3 5.630172 S 0.000 0.089 0.143 1 1 2 3 1.429983 M 0.000 0.089 0.143 1 1 2 3 1.42998

TABLE IIRESULTS OF EXAMPLE 2 WHEN THE MASTER-SLAVE ALGORITHM IS

APPLIED IN ITS ORIGINAL FORM.

step τ1 τ2 τ3 i0 i1 i2 i3 F(I,Τ )1 M 0.001 0.005 0.010 2 2 2 3 5.630171 S 0.000 0.089 0.143 3 1 2 3 1.429982 M 0.000 0.089 0.143 1 1 2 3 1.429982 S 0.009 0.062 0.116 2 1 2 3 0.125693 M 0.009 0.062 0.116 2 1 2 3 0.12569

TABLE IIIRESULTS OF EXAMPLE 2 WHEN THE MASTER-SLAVE ALGORITHM IS

APPLIED IN ITS MODIFIED FORM.

Nevertheless, this solution is not optimal and this maybe easily verified through an exhaustive inspection of alladmissible switching sequences.

A careful examination of the solution suggests the presenceof time-degeneracy, being I = {1, 1, 2, 3} a switching se-quence that corresponds to only two switches. Thus, when it isused by the slave algorithm, it may only compute a suboptimalsolution.

A simple heuristic solution to this problem — that iseffective in this case, as well as in many other instancesthat were examined — consists of modifying the switchingsequence computed via the master algorithm that correspondsto a number of switches that is less that N before runningthe slave algorithm. In particular, we suggest to arbitrarilychange the mode sequence so that the original sequence isstill contained in the new one but two consecutive indices arenever the same.

Using such an heuristics, the results reported in Table IIIwere obtained. In particular, observe that at the first step ofthe whole procedure the slave algorithm does not examine theswitching sequence firstly computed by the master algorithm,but computes the optimal timing sequence corresponding toa new sequence I = {3, 1, 2, 3}, that has been randomlygenerated by arbitrarily modifying the first mode so as to avoidtime-degeneracy. At this step, the value of the performanceindex decreases but the optimum is not computed yet. Thesame reasoning is repeated at the third step and in this casethe optimal value of the cost is found and the procedure stops.The results of an exhaustive search show that the computedsolution is optimal thus revealing the effectiveness of themodified procedure.

Although the above heuristics is effective in most instances,a condition is required that stops the algorithm whenever aloop is detected, so that cycling is avoided.

V. SWITCHING TABLE PROCEDURE

Let us consider again the optimal control problem (2) orequivalently (3) and assume that Assumption 1 is satisfied. Inthis section we show how to solve this problem generalizingthe procedure derived in Section 3 to compute the optimalcontrol law when the sequence is fixed. Again for simplicitywe assume that dynamics are linear, because affine dynamicscan be easily reduced to linear dynamics as shown in (5).

In particular we show that for a given mode i ∈ S andfor a given switch k ∈ 1, . . . , N it is possible to constructa table Ci

k that partitions the state space Rn into s regionsR1,R2, . . . ,Rs. Whenever ik−1 = i we use table Ci

k todetermine if a switch should occur: as soon as the state reachesa point in the region Rj (with j 6= i) we will switch to modeik = j, while no switch will occur while the system’s statebelongs to Ri.

A. Computation of the Switching Tables

In this section we denote Fk,i(x) the optimal cost to infinityof an evolution that starts with dynamics ik = i from the statex. We will show later how this value can be computed.

We can also define the following cost functions.Definition 5.1: Let us assume that ik = i, i.e., after k

switches the current system dynamics is that correspondingto matrix Ai, and let the current state vector be x.• For k ∈ {0, . . . , N} and i ∈ S we define:

T ∗k,i(x, i) = x′Qi(+∞)x (36)

the remaining cost of an evolution that starts with dy-namics Ai from x and never switches and we denote

%k,i(x, i) = +∞. (37)

• For k ∈ {0, . . . , N − 1} and i, j ∈ S with i 6= j, wedefine

Tk,i(x, j, %) = x′Qi(%)x + Fk+1,j(Ji,jeAi%x) + Hi,j

(38)the remaining cost of an evolution that starts with dynam-ics Ai from x, switches after a time % to Aj and fromthen on follows an optimal evolution.We also denote

%k,i(x, j) = arg min%≥0

Tk,i(x, j, %), (39)

the value of % that minimizes (38) while the correspond-ing minimum is

T ∗k,i(x, j) = Tk,i(x, j, %k,i(x, j)). (40)

¥Proposition 5.1 (Optimal remaining cost): Let us assume

that ik = i, i.e., after k switches the current system dynamicsis that corresponding to matrix Ai, and let the current statevector be x = λy with ‖y‖ = 1 and λ ∈ R \ {0}.

1) If k = N then the remaining optimal cost starting fromx is:

FN,i(x) = T ∗N,i(x, i). (41)

2) If k ∈ {0, . . . , N − 1} then:

Page 12: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

12

i) the remaining optimal cost starting from x is:

Fk,i(x) = minj∈S

T ∗k,i(x, j); (42)

ii) the next dynamics reached by the optimal evolutionis

jk+1,i(x) = arg minj∈S

T ∗k,i(x, j) (43)

where jk+1,i(x) = i means that no other switchwill occur;

iii) the optimal evolution switches to Ajk+1,i(x) at

time τk+1 = t + δk+1,i(x), where

δk+1,i(x) = %k,i(x, jk+1,i(x)). (44)

Proof:If k = N the systems is forced to evolve with dynamics Ai

to infinity and the remaining cost (that is also optimal) is theone given in equation (41).

If k<N , we have two options. If no future switch occursthen the remaining cost will be T ∗k,i(x, i). If at least a futureswitch will occur, the two decision variables are the timebefore the first switch occurs (parameter % ≥ 0) and thedynamics reached after the switch (parameter j ∈ S \ {i}),while after the switch it is necessary to follow an optimalevolution such that the remaining cost is minimized. Hence:

Fk,i(x) = min{T ∗k,i(x, i), minj ∈ S \ {i}

% ≥ 0

{Tk,i(x, j, %)}}

= min{

T ∗k,i(x, i), minj∈S\{i}

{T ∗k,i(x, j)}}

= minj∈S T ∗k,i(x, j).

¤According to the previous proposition, the optimal remain-

ing cost can be computed recursively, first computing for allvectors x ∈ Rn and all dynamics i ∈ S the costs FN,i(x),then the costs FN−1,i(x), etc.

The procedure may be simplified when all switching costsare zero, as shown in the following proposition.

Proposition 5.2: Assume that all switching costs are zero,i.e., Hi,j = 0 for all i, j ∈ S . If x is a vector such thatx = λy, with ‖y‖2 = 1 and λ ∈ R \ {0}, with the notationof Definition 5.1 we have that for all k ∈ {0, . . . , N} and alli, j ∈ S

(a) T ∗k,i(x, j) = λ2T ∗k,i(y, j), (45)(b) %k,i(x, j) = %k,i(y, j), (46)(c) Fk,i(x) = λ2Fk,i(y), (47)

Proof: Clearly, according to equations (36) and (37), theresults (a) and (b) hold for k = N and i = j. This also implies,by equation (41), that the result (c) holds for k = N .

We now recursively show that results (a)-(c) hold for allvalues of k. Assume in fact that Fk,i(x) = λ2Fk,i(y). Byequations (38) and (40), it also holds that T ∗k−1,i(x, j) =λ2T ∗k−1,i(y, j), hence by equation (39), %k−1,i(x, j) =%k−1,i(y, j) and finally by equation (42) Fk−1,i(x) =λ2Fk−1,i(y). ¤This proposition implies that when all switching costs arezero to determine the optimal costs it is sufficient to evaluate

the functions Fk,i(x) only for vectors x on the unitary semi-sphere.

We can finally extend the definition of table given inSection 2.

Definition 5.2: The switching table Cik is a partition of the

state space in s regions Rj (for j ∈ S) defined as follows• The region Rj = {x ∈ Rn | δk,i(x) = 0, jk,i(x) = j 6=

i} is the set of points where it is optimal to switch fromik−1 = i to ik = j 6= i.

• The complementary region is Ri = Rn \⋃j 6=iRj . ¥

B. Computation of the Table for the Initial Mode

To decide the optimal initial mode i0 we may use theknowledge of the cost F0,i(x) (i.e., of the optimal cost toinfinity starting from state x with dynamics i0 = i) that isevaluated during the construction of the table Ci

1.Definition 5.3: Table C0 is a partition of the state space Rn

into s regions Ri (i ∈ S) where each region is defined as:Ri = {x | (∀j ∈ S)F0,i(x) ≤ F ∗0,j(x)}. ¥

According to this definition, if the initial state belongs toregion Ri we must choose i0 = i to minimize the total cost.

−1 0 1−1

0

1

C11

−1 0 1−1

0

1

C12

−1 0 1−1

0

1

C13

−1 0 1−1

0

1

C21

−1 0 1−1

0

1C

22

−1 0 1−1

0

1

−1 0 1−1

0

1

C31

−1 0 1−1

0

1

C32

−1 0 1−1

0

1

C33

C23

Fig. 4. The set of tables for the numerical example where N = 3 andS = {1, 2, 3}.

C. Structure of the Switching Regions

We now discuss the form that the switching regions maytake in the case of zero switching costs.

Proposition 5.1: Consider the case in which Hi,j = 0 forall i, j ∈ S . Then any region Rj of table Ci

k and of table C0

is such that y ∈ Rj =⇒ (∀λ ∈ R) λy ∈ Rj , i.e., the regionRj is homogeneous.

Proof: When all switching costs are zero, we have shownthat equations (45) and (46) hold. Thus, is immediately followsthat in this case jk,i(x) = jk,i(y) and δk,i(x) = δk,i(y). ByDefinition 5.2 this implies that all regions of table Ci

k arehomogenous for k = 1, . . . , N .

Page 13: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

13

The table used to select the initial mode has the sameproperty. In fact, assume equation (47) holds: taking (as aparticular case) k = 0 one can see that by Definition 5.3 theregions of table C0 are homogenous as well. ¤

D. Numerical Examples

Let us consider again the second order linear system con-sidered in Subsection 4.3, Example 2.

We first execute the off-line part of the procedure, consistingin the construction of the N×s = 9 tables Ci

k, for k, i = 1, 2, 3.Results are reported in Figure 4 where the following colornotation has been used: Red color (medium gray) is used todenote region R1, i.e., the set of states where the system eitherswitches to A1 if the current variable of the control variableis i(t) 6= 1, or no switch occur if i(t) = 1; light blue (lightgray) denotes region R2, and dark blue (dark gray) is used todenote R3.

As an example, by looking at C21 we know that, if the initial

dynamics is A2, then the system may either switch to A1 orstill evolve with the same dynamics A2: on the contrary aswitch to dynamics A3 may never occur.

In Figure 5 we have reported table C0 that shows thepartition of the state space introduced in Subsection 3.3. Thesame color notation has been used. In particular, this tableenables us to conclude that the global optimum may only bereached when the initial system dynamics is either A1 or A2.On the contrary, whenever the initial system dynamics is A3,we may only reach a suboptimal value of the performanceindex.

Now, let us present the results of some numerical simulation.Let us assume that the initial state is x0 = [1 1]′. We computethe optimal mode sequence for all admissible initial systemdynamics, i.e., we assume i0 = 1, 2, 3, respectively. Detailedresults may be read in Table IV where we have reported theoptimal mode sequence, the optimal timing sequence and thecorresponding cost value for the different initial dynamics. Wemay observe that the best solution may only be reached whenthe initial system dynamic is the second one. In the other casesonly a suboptimal value of the cost may be obtained. Note thatthese results are in accordance with those of Figure 5 beingx0 ∈ R1.

The correctness of the solution has been validated throughan exhaustive inspection of all admissible mode sequences.More precisely, for each admissible mode sequence we havecomputed the optimizing timing sequence and the correspond-ing cost value. In such a way we have verified that V ∗

3 = 0.126is indeed the global optimum.

VI. DISCUSSION ON COMPUTATIONAL COMPLEXITY

A. Theoretical analysis

Let us first discuss the computational complexity involvedin the construction of the tables for a fixed mode sequence interms of operations required. In this case, a single table Ck isassociated to the k-th switch and it contains only two regions:Rik−1 , i.e., the set of state vectors where we continue usingmode ik−1, and Rik

, i.e., the set of state vectors where weswitch to mode ik.

i0 i1 i2 i3 τ1 τ2 τ3 V3

1 2 1 3 0.000 0.009 0.060 0.6692 1 2 3 0.009 0.062 0.116 0.1263 2 1 3 0.000 0.009 0.060 0.669

TABLE IVRESULTS OF THE NUMERICAL EXAMPLE WHEN THE INITIAL STATE IS

x0 = [1 1]′ .

−1 0 1−1

−0.5

0

0.5

1C

0

Fig. 5. Table C0.

We have to distinguish two cases.• Assuming that not all switching costs are zero, it is

necessary to discretize the state space within a regioncentered around the origin and large enough to containsall vectors of length smaller than or equal to λ asdefined in eq. (20). The two regions of the table canbe determined by solving a one-parameter optimizationproblem for each discretization point. If the state spaceis Rn and we assume a uniform sampling with r samplesalong each dimension the complexity for constructingeach table is rnc, being c the number of operationsrequired to find the value of % that minimizes (10).

• On the contrary, if all switching costs are zero it issufficient to grid the unitary semisphere. In this casewe can assume that the complexity for constructing eachtable is rn−1c.

Thus, the complexity of solving the optimal control problemfor a fixed sequence of length N + 1 is f1(N) = Nrn−1c orf ′1(N) = Nrnc, in the case of zero and non-zero switchingcosts, respectively, because for each switch a new table mustbe determined.

It is important to observe that the choice of the number ofsamples r is a trade-off. The proposed procedure can always beapplied even when the number of samples is small: in this case,however, the switching sequence that leads to the final stablemode will most likely only be sub-optimal. By increasing thenumber of samples one can get as close as desired to theoptimal solution.

When the switching sequence is not fixed, using the switch-ing table procedure STP given in Section 5, for each switch itis necessary to compute s tables, one for each possible mode.Now, for sake of simplicity assume that all switching costsare zero. The complexity of computing the generic table Ci

k

is (s − 1)rn−1c. In fact each table contains s regions thatcan be determined solving s − 1 one-parameter optimizationproblems for each vector y on the unitary semi-sphere. Thus

Page 14: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

14

the complexity of solving the optimal control problem (2) fora sequence of length N +1 is f2(N, s) = Ns(s−1)rn−1c. Onthe contrary, if not all switching costs are zero, following thesame argument one can immediately show that the complexityis f ′2(N, s) = Ns(s− 1)rnc. In any case, the complexity is aquadratic function of the number of possible dynamics.

Note that the amount of data required to construct theswitching tables is equal to g(s) = 2srn−1 or g′(s) = 2srn,depending on the switching costs. In fact, when computingthe tables relative to the k-th switch we only look at the stables relative to the k + 1-th switch, where for each gridpoint we keep track of two values: the region it belongs toand the optimal remaining costs when N −k +1 switches areavailable. Note however that once the switching tables havebeen constructed (the off-line part of the procedure is finished)we do not need to keep memory of the optimal remainingcosts.

Let us finally discuss the computational complexity of themaster-slave procedure MSP. The complexity of solving MSPis f3(N) = αf1(N) + d = αNrn−1c + d, where α is thenumber of times the slave procedure is executed and d isthe cost for solving the master MIQP problems. Note in fact,that the slave algorithm is always invoked with zero switchingcosts. In theory, d = d(N, s) and in the worst case it growsexponentially with N and s. Parameter α depends in generalon all the data of the problem. However, for problems withrelatively small s and N , as those shown in the paper, it turnsout that d ¿ αNrn−1c and α ≤ 5.

From all these considerations, one may conclude that from acomputational point of view MSP offers the best performance.For all other aspects, STP is better. In fact STP always finds anoptimal solution while MSP may converge to a local minimum.Furthermore, the solutions provided by MSP are local, i.e., theoptimal sequence and the corresponding tables are valid for agiven initial state x(0) and for bounded disturbances. On thecontrary, the tables constructed by STP provide the optimalstate feedback law for all initial states.

B. Numerical simulationsWe conclude this section with a brief presentation of some

numerical examples randomly generated, in order to provide abetter idea of the time required to perform the off-line phaseof the STP. Calculations have been done using the softwareMatlab 7, on an Intel Pentium 4 with 2 GHz and 256 MbRAM.

We consider 3 different switched linear systems composedof 4 stable dynamics. The state space of the three systemshas dimension n = 2, 3, 4, respectively. No cost is associatedto the switches, thus we used a discretization of the unitarysemisphere as explained in Appendix B. We compare thetime requested to compute a single table assuming that thesequence is not fixed. We need not specify the maximumnumber of allowed switches N because the time spent forthe computation of each table does not depend on N or onthe remaining number of switches.

To compare the three cases, the optimal value of % thatminimizes the remaining cost (see eq. (39)) has been deter-mined by looking at a finite time horizon: 0 ≤ % ≤ %max = 3

dimension time [s] parameters of the discretization samplingsn = 2 32 Nθ = 101 101n = 3 3593 Nθ = 120, Nϕ = 30 2293n = 4 25978 Nθ = 60, Nϕ = 30, Nξ = 15 8581

TABLE VRESULTS OF THE NUMERICAL EXAMPLES IN SUBSECTION VI-B.

that is the same for all systems. A finite uniformly distributednumber of % are considered: % = k ·∆%, with ∆% = 0.01 andk = 0, 1, . . . , 300.

The time (in seconds) required to compute a switching tablefor all the 3 cases examined are given in Table V. In thistable we have also reported, using the notation of Appendix B,the parameters relative to the considered discretization of theunitary semi-sphere.

VII. CONCLUSIONS

We have considered a simple class of switched piecewiseaffine autonomous linear systems with the objective of min-imizing a quadratic performance index over an infinite timehorizon. We have assumed that the switching sequence has afinite length, and that the decision variables are the switchinginstants and the sequence of operating modes.

We have presented two different approaches for solvingsuch an optimal control problem. The first approach iteratesbetween a ”master” procedure that finds an optimal switchingsequence of modes, and a ”slave” procedure that finds theoptimal switching instants. The second approach is inspiredby dynamic programming and allows one to compute a statefeedback control law, i.e., it is possible to identify the regionsof the state space where an optimal switch should occurwhenever the state trajectory enters them.

There are several ways in which this research may beextended.

Firstly, we will consider the case in which an infinite numberof switches may occur.

Secondly, we will consider the optimal control of switchedsystems whose switching sequence is determined by a con-trolled automaton whose discrete dynamics restrict the possi-ble switches from a given location to an adjacent location.

Finally, we may assume that in the automaton there are twotypes of edges. A controllable edge represents a mode switchthat can be triggered by the controller; an autonomous edgerepresents a mode switch that is triggered by the continuousstate of the system as it reaches a given threshold.

REFERENCES

[1] A. Bemporad, F. Borrelli, and M. Morari. Piecewise linear optimalcontrollers for hybrid systems. In Proc. American Contr. Conf., pages1190–1194, Chicago, IL, June 2000.

[2] A. Bemporad, F. Borrelli, and M. Morari. On the optimal control law forlinear discrete time hybrid systems. In M. Greenstreet and C. Tomlin,editors, Hybrid Systems: Computation and Control, number 2289 inLecture Notes in Computer Science, pages 105–119. Springer-Verlag,2002.

[3] A. Bemporad, L. Giovanardi, and F.D. Torrisi. Performance drivenreachability analysis for optimal scheduling and control of hybridsystems. Technical Report AUT00-15, Automatic Control Laboratory,ETH Zurich, Switzerland, September 2000.

Page 15: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

15

[4] A. Bemporad, A. Giua, and C. Seatzu. A master–slave algorithm for theoptimal control of continuous–time switched affine systems. In Proc.41th IEEE Conf. on Decision and Control, pages 1976–1981, Las Vegas,Nevada, December 2002.

[5] A. Bemporad, A. Giua, and C. Seatzu. Synthesis of state–feedbackoptimal controllers for switched linear system. In Proc. 41th IEEEConf. on Decision and Control, pages 3182–3187, Las Vegas, Nevada,December 2002.

[6] A. Bemporad and M. Morari. Control of systems integrating logic,dynamics, and constraints. Automatica, 35(3):407–427, March 1999.

[7] S.C. Bengea and R.A. DeCarlo. Conditions for the existence of asolution to a two-switched/hybrid optimal control problem. In IFACConf. on Analysis and Design of Hybrid Systems, pages 419–424, SaintMalo, France, June 2003.

[8] F. Borrelli, M. Baotic, A. Bemporad, and M. Morari. An efficientalgorithm for computing the state feedback optimal control law fordiscrete time hybrid systems. In Proc. American Contr. Conf., Denver,Colorado, 2003.

[9] M.S. Branicky, V.S. Borkar, and S.K. Mitter. A unified framework forhybrid control: model and optimal control theory. IEEE Trans. AutomaticControl, 43(1):31–45, 1998.

[10] M.S. Branicky and S.K. Mitter. Algorithms for optimal hybrid control.In Proc. 34th IEEE Conf. on Decision and Control, New Orleans, USA,December 1995.

[11] C.G. Cassandras, D.L. Pepyne, and Y. Wardi. Optimal control of aclass of hybrid systems. IEEE Trans. Automatic Control, 46(3):398–415, 2001.

[12] Dash Associates. XPRESS-MP User Guide, 2003.http://www.dashopt.com.

[13] B. De Schutter and T. van den Boom. Model predictive control for max-plus-linear systems. In Proc. American Contr. Conf., pages 4046–4050,2000.

[14] R. DeCarlo, M.S. Branicky, S. Pettersson, and B. Lennartson. Perspec-tives and results on the stability and stabilizability of hybrid systems.Proceedings of the IEEE, 88(7):1069–1082, 2000.

[15] P.J. Antsaklis (ed.). Special issue on hybrid systems: Theory andapplications. Proceedings of the IEEE, 88(7), July 2000.

[16] M. Egerstedt, Y. Wardi, and F. Delmotte. Optimal control of switchingtimes in swithced dynamical systems. In Proc. 42th IEEE Conf. onDecision and Control, pages 2138–2143, Maui, Hawaii, USA, December2003.

[17] A. Giua, C. Seatzu, and C. Van Der Mee. Optimal control of autonomouslinear systems switched with a pre–assigned finite sequence. In Proc.2001 IEEE Int. Symp. on Intelligent Control, pages 144–149, MexicoCity, Mexico, 2001.

[18] A. Giua, C. Seatzu, and C. Van Der Mee. Optimal control of switchedautonomous linear systems. In Proc. 40th IEEE Conf. on Decision andControl, pages 2472–2477, Orlando, Florida USA, 2001.

[19] K. Gokbayrak and C.G. Cassandras. A hierarchical decompositionmethod for optimal control of hybrid systems. In Proc. 38th IEEE Conf.on Decision and Control, pages 1816–1821, Phoenix, AZ, December1999.

[20] S. Hedlund and A. Rantzer. Optimal control of hybrid systems. In Proc.38th IEEE Conf. on Decision and Control, pages 3972–3976, Phoenix,AZ, December 1999.

[21] S. Hedlund and A. Rantzer. Convex dynamic programming for hybridsystems. IEEE Trans. Automatic Control, 47(9):1536–1540, September2002.

[22] ILOG, Inc. CPLEX 8.1 User Manual. Gentilly Cedex, France, 2003.[23] B. Lincoln and A. Rantzer. Optimizing linear system switching. In Proc.

40th IEEE Conf. on Decision and Control, pages 2063–2068, 2001.[24] B. Lincoln and A. Rantzer. Relaxed optimal control of piecewise linear

systems. In IFAC Conf. on Analysis and Design of Hybrid Systems,Saint Malo, France, June 2003.

[25] C.C. Pantelides, M.P. Avraam, and N. Shah. Optimization of hybriddynamic processes. In Proc. American Contr. Conf., 2000. Availableupon request from the authors.

[26] B. Piccoli. Necessary conditions for hybrid optimization. In Proc. 38thIEEE Conf. on Decision and Control, Phoenix, Arizona USA, December1999.

[27] A. Rantzer and M. Johansson. Piecewise linear quadratic optimalcontrol. IEEE Trans. Automatic Control, 45(4):629–637, April 2000.

[28] P. Riedinger, F. Kratz, C. Iung, and C. Zanne. Linear quadraticoptimization for hybrid systems. In Proc. 38th IEEE Conf. on Decisionand Control, pages 2093–2098, Phoenix, AZ, USA, December 1999.

[29] B. De Schutter and T. van den Boom. Model predictive control formax-plus-linear discrete event systems. Automatica, 37(7):1049–1056,July 2001.

[30] M.S. Shaikh and P.E. Caines. On the optimal control of hybrid systems:analysis and zonal algorithm for trajectory and schedule optimization.In Proc. 42th IEEE Conf. on Decision and Control, pages 2144–2149,Maui, USA, December 2003.

[31] M.S. Shaikh and P.E. Caines. On the optimal control of hybrid systems:optimization of switching times and combinatoric schedules. In Proc.American Contr. Conf., Denver, USA, 2003.

[32] M.S. Shaikh and P.E. Caines. On the optimal control of hybrid systems:optimization of trajectories, switching times and location schedules. In6th Int. Workshop on Hybrid Systems: Computation and Control, Prague,The Czech Republic, 2003.

[33] H.J. Sussmann. A maximum principle for hybrid optimal controlproblems. In Proc. 38th IEEE Conf. on Decision and Control, Phoenix,Arizona USA, December 1999.

[34] H.P. Williams. Model Building in Mathematical Programming. JohnWiley & Sons, Third Edition, 1993.

[35] X. Xu and P.J. Antsaklis. Optimal control of switched autonomoussystems. In Proc. 41th IEEE Conf. on Decision and Control, Las Vegas,USA, 2002.

[36] X. Xu and P.J. Antsaklis. Optimal control of switched systems via non-linear optimization based on direct differentiations of value functions.Int. J. Control, 75(16/17):1406–1426, 2002.

[37] X. Xu and P.J. Antsaklis. Quadratic optimal control problems for hybridlinear autonomous systems with state jumps. In Proc. American Contr.Conf., Denver, USA, 2003.

[38] X. Xu and P.J. Antsaklis. Results and perspectives on computationalmethods for optimal control of switched systems. In 6th Int. Workshopon Hybrid Systems: Computation and Control, Prague, The CzechRepublic, 2003.

[39] X. Xu and P.J. Antsaklis. Optimal control of switched systems basedon parameterization of the switching instants. IEEE Trans. AutomaticControl, 49(1):2–16, 2004.

[40] P. Zhang and C.G. Cassandras. An improved forward algorithm foroptimal control of a class of hybrid systems. IEEE Trans. AutomaticControl, 47(10):1735–1739, 2002.

APPENDIX A: COMPUTATION OF THE COST FUNCTIONMATRICES

In the problem formulation (3) we assumed∫ δ

0

x′(t)Qix(t)dt = x′0Qi(δ)x0 + ci(δ)x0 + αi(δ)

for any initial state x0 = x(0), where

Qi(δ) =∫ δ

0

eA′it Qi eAitdt,

ci(δ) = 2f ′i

∫ δ

0

(∫ t

0

eA′iτdτ

)Qi eAitdt,

αi(δ) = f ′i

[∫ δ

0

(∫ t

0

eA′iτdτ

)Qi

(∫ t

0

eAiτdτ

)dt

]fi

In general cases it is not easy to provide analytical expres-sions for Qi(δ), ci(δ), and αi(δ), thus numerical integration isneeded. On the contrary, under appropriate assumptions on Ai

and fi, these analytical expressions can be easily determined.As an example, let us consider the following two cases.• Assume Ai is strictly Hurwitz and fi = 0. In such a case

Qi(δ) = Zi − eA′iδZieAiδ,

ci(δ) = 0,αi(δ) = 0,

where Zi is the unique solution of the Lyapunov equationA′iZi + ZiAi = −Qi. The same computation is validwhen the eigenvalues of Ai are all unstable.

Page 16: Optimal Control of Continuous-Time Switched …...1 Optimal Control of Continuous-Time Switched Affine Systems Carla Seatzu, Daniele Corona, Alessandro Giua Dip. Ingegneria Elettrica

16

• Assume that Ai is diagonalizable. In such a case, Ai =T−1

i ΛiTi, where Λi = Diag{λ1i , . . . , λ

ni } and λj

i , j =1, . . . , n are the eigenvalues of Ai. We obtain:

Qi(δ) = T ′i

(∫ δ

0

eΛit(T−1i )′ Qi T−1

i eΛitdt

)Ti,

ci(δ) = 2f ′i T ′i

[∫ δ

0

(∫ t

0

eΛiτdτ

)(T−1

i )′ Qi ·

· T−1i eΛitdt

]Ti,

αi(δ) = f ′i T ′i

[∫ δ

0

(∫ t

0

eΛiτdτ

)(T−1

i )′ Qi ·

· T−1i

(∫ t

0eΛiτdτ

)dt

]Ti fi,

and it is straightforward to symbolically compute the integralsgiven the simple form the exponential of a diagonal matrixtakes.

APPENDIX B: SAMPLING THE ”HYPER” SEMI-SPHERE

The main computational effort in the construction of theswitching tables is the discretization of the state space. Thefirst step is to construct the relation between polar and carte-sian system in Rn. The n polar coordinates are composed of1 radius ρn and n − 1 angles θ2, . . . , θn. Given a pointx = [x1 x2 . . . xn]′, such relation is

xn = ρn sin(θn)xn−1 = ρn−1 sin(θn−1)...x3 = ρ3 sin(θ3)x2 = ρ2 sin(θ2)x1 = ρ2 cos(θ2)

where ρn = ‖x‖, ρi = ρi+1 cos(θi) for i = n − 1, . . . , 2.To describe Rn, variables must range in: ρn ∈ [0, +∞),θ2 ∈ [0, 2π), and θ3, . . . , θn ∈ [−π

2 , π2 ]. To describe the

unitary ”hyper” semi-sphere we choose ρn = 1, θ2 ∈ [0, 2π)θ3, . . . , θn−1 ∈ [−π

2 , π2 ), and θn ∈ [0, π

2 ].Note that a uniform discretization for each angle brings to

areas with high density of points (think of the grid on the earthsurface at the poles). An equally spaced grid can be obtainedwith a reduced number of points using the following criterion,that provides constant arc length.

As an example, assume n = 4. Let us call θ4 = ξ, θ3 = ϕand θ2 = ϑ.

1) Define nominal values of discretization Nϑ, Nϕ, Nξ;since ϑ ∈ [0, 2π), ϕ ∈ [−π

2 , π2 ) and ξ ∈ [0, π

2 ] wechoose Nϑ = 2Nϕ = 4Nξ proportional to the respectiverange of each variable;

2) discretize ξ uniformly, i.e., ξi = i π2Nξ

, i = 0, · · · , Nξ;3) denoted by round(·) a function that approximates

to the closest integer, for every ξi define Nϕ =round(Nϕcos(ξi)) and discretize ϕ uniformly, i.e., ϕj =−π

2 + j πNϕ

, j = 0, · · · , Nϕ − 1;4) for every ξi and ϕj define Nϑ =

round(Nϑcos(ξi)cos(ϕj)) and discretize ϑ uniformly,i.e., ϑk = k 2π

Nϑ, k = 0, · · · , Nϑ − 1.