Abstract
Gradient-based algorithms are efficient to compute numerical solutions of optimal control problems for hybrid systems (OCPHS), and the key point is how to get the sensitivity analysis of the optimal control problems. In this paper, optimality condition-based sensitivity analysis of optimal control for hybrid systems with mode invariants and control constraints is addressed under a priori fixed mode transition order. The decision variables are the mode transition instant sequence and admissible continuous control functions. After equivalent transformation of the original problem, the derivatives of the objective functional with respect to control variables are established based on optimal necessary conditions. By using the obtained derivatives, a control vector parametrization method is implemented to obtain the numerical solution to the OCPHS. Examples are given to illustrate the results.
1. Introduction
In many fields of applications, such as powertrain systems of automobiles and multistage chemical processes, dynamics of the systems involve a sequence of distinct modes with fixed mode transition order, forming a hybrid system characterized by the coexistence and interaction of discrete and continuous dynamics (the mode is commonly denoted by a discrete state of the systems in hybrid systems literature). To achieve some overall optimal performance for the systems, the duration and the admissible continuous control function of each mode must be determined as a whole [1–3]; thus, it necessitates the use of theories and techniques for the analysis and synthesis of hybrid dynamical systems. With the growing importance of hybrid models, various classes of hybrid systems for analysis, design, and optimization have been addressed by research communities in recent years. For more discussions on various literature results, the reader is referred to [4–8], and the references therein.
The existed results on OCPHS can be divided into the following two categories. One is about the optimal control theory on OCPHS. The theory inherits conventional optimal control theory and can be regarded as the extension of conventional optimal control theory [3, 9–14]. When control can take any value, Xu and Antsaklis [3] and Hwang et al. [9] addressed the variational method for hybrid systems. Sussmann [10], Shaikh and Caines [11], and Dmitruk and Kaganovich [12] established the Maximum Principle for hybrid systems with control constraints. Branicky et al. [14] and Bensoussan and Menaldi [13] provided the dynamic programming principle for general hybrid systems.
The other results focus on how to compute optimal control for OCPHS, which can be carried out by using a wide variety of methods (see [3, 6, 11, 15–20] and the references therein). Given a prespecified order of mode transitions, Xu and Antsaklis [3] obtained the optimal continuous control and optimal switching instants based on parameterization of the switching instant for switching hybrid systems with free control. Under a fixed switching sequence of modes, Attia et al. [19] considered an optimization problem for a class of impulsive hybrid systems where continuous control function is not involved. When switching hybrid systems with control constraints are considered, Shaikh and Caines [11] proposed two algorithms for obtaining the optimal control. As far as switching hybrid systems without external continuous control function are concerned, Egerstedt et al. [6] and Johnson and Murphey [18] derived the gradients and second-order derivatives of the cost functional, respectively, and used them to design an associated algorithm to get the mode transition instants. Based on the hybrid Maximum Principle, Taringoo and Caines [20] provided gradient geodesic and Newton geodesic algorithms for the optimization of autonomous hybrid systems, and convergence analysis for the algorithms was also provided. From the view of dynamic programming, Seatzu et al. [16] provided an optimal state feedback control law to switched piecewise affine autonomous systems. Generally, these algorithms pose the hierarchy [17, 21, 22], and the basic module of the hierarchical algorithms is how to get optimal continuous control and optimal mode transition instants, though the main challenge of OCPHS is how to get the optimal mode transition order. The basic module of the hierarchical algorithms is commonly gradient based due to that gradient information can provide a better searching direction and hence reduce computation burden and help the gradient-based algorithms converge quickly, which motivates us to pay attention to the sensitivity analysis of optimal control for hybrid systems.
Although the derivative of cost functional with respect to switching instants has been discussed in the aforementioned literature [3, 6, 18], the derivative of cost functional with respect to control function is not involved. When hybrid systems are considered, due to the coexistence and interaction of discrete and continuous dynamics, the derivative of cost functional w.r.t control functions is nontrivial and is not directly formulated by as conventional optimal control indicates, where is the Hamiltonian function. The derivative will be a function of the derivatives of continuous states w.r.t control functions at the instants of subsequent modes. In this paper, the derivatives of cost functional w.r.t control functions are established analytically, which can facilitate the design of associated gradient-based algorithms.
Motivated by the work of Vassiliadis et al. [1, 2] and Jennings et al. [23], in this paper, optimal control problem of hybrid systems (OCPHS) with mode invariants which describe the conditions that continuous states have to satisfy at this mode are considered. Based on optimal necessary conditions, the derivatives of the objective functional w.r.t control variables, that is, the mode transition instant sequence and admissible continuous control functions, are derived analytically. As a result, a control vector parametrization method is implemented to obtain the numerical solution to optimal control of the hybrid systems with the obtained derivatives. The sensitivity analysis in Vassiliadis et al. [1, 2] is similar to the work, in which the sensitivity of states w.r.t control parameters is directly obtained from the state equations and the sensitivity of objective functional with respect to control parameters is not involved. In contrast, this paper derives the derivatives of cost functional w.r.t control variables based on the optimality conditions and gives the explicitly expression of the derivatives. Therefore, the main contributions of this paper are listed as follows. (a) Optimality conditions-based sensitivity analysis of optimal control for hybrid systems with mode invariants are given explicitly, and (b) following the given derivatives, a control vector parameterization method is designed to obtain the numerical solution. Compared with the existing results on the OCPHS with fixed mode transition order, the settings in this paper cover not only the control constraints, but also the continuous states constraints, which makes the results here more general.
The paper is organized as follows. In the next section, the hybrid system with mode invariants and its optimal control problem are formulated. In Section 3, the equivalent problem and associated optimal conditions are analyzed. The derivatives of the objective functional w.r.t control variables are established in Section 4, and a control vector parametrization approach is also proposed in this section. Some numerical examples are presented in Section 5, and Section 6 contains conclusions.
Terminology and Notation
denotes the set of positive integers. and denote the set of real numbers and nonnegative real numbers, respectively. denotes the transpose of a vector (or a matrix) . denotes the family of continuous functions from to with up to order derivatives. denotes the Euclidean norm.
2. Hybrid Systems and Its Optimal Control Problem
2.1. Hybrid Systems
Engineered systems, such as chemical engineering systems and powertrain systems of automobiles, always undergo multiple modes which are represented by a discrete state taking values from set and pose hybrid characters. The evolution of discrete state is determined by mode transition sequence. A mode transition sequence schedules the sequence of active modes and is a sequence of pairs of , which can be defined by where and are referred to as mode transition instants and mode transition order, respectively. A pair of indicates that at instant , the hybrid system transits from mode to mode . During the time interval , mode is active and unchanged.
The mode transition order of the considered hybrid dynamical systems is known a priori. Without loss of generality, it is supposed that the mode transition order is over the finite horizon , , . Moreover, according to each distinct mode, the continuous states are restricted in a specified range which is referred to as mode invariants. Here, the mode invariants are formulated by a set of inequalities. Thus, for each mode and its active horizon , the dynamics of the considered systems can be formulated by where , is a piecewise continuous function, , is the mode transition instant when a particular mode transition occurs, , , and are , and dimensional vectors for , respectively. . To make the hybrid systems formulated by (2.1) well defined, the following assumption is needed.
Assumption 2.1. For any , , and such that a uniform Lipschitz condition holds, that is, there exists such that where .
Remark 2.2. indicates mode invariant for mode , which describes the conditions that the continuous states have to satisfy at this mode and can be referred to as the path constraints of the continuous states in Vassiliadis et al. [1, 2].
Remark 2.3. can be referred to as mode transition conditions which describe the conditions on the continuous states under which a particular mode transition takes place. When mode is active over , then, at , meets an -dimensional smooth manifold and mode transition from to occurs. The mode transition conditions implicitly define the mode 's active horizon . To prevent Zeno behavior from occurrence, is assumed. Physically, the mode transition conditions are always the boundary of closure of the mode invariant .
Remark 2.4. is the outcome of the mode transition and describes the effect that the transition will have on the continuous states. It can be viewed as junction conditions in Vassiliadis et al. [1, 2]. It is assumed that , , .
Remark 2.5. Basically, for general hybrid systems, the evaluation of should be formulated by a function of impulsive control or a graph, which generates mode transition sequence, as formulated in Song and Li [24] and Cassandras and Lygeros [8]. However, the order of the mode transition is known a prior here thus, the evaluation of is determined only by the transition instants , and the evaluation function of is omitted here.
Besides Assumption 2.1, to make the considered systems to be well defined, there are some additional assumptions on mode invariants and mode transition conditions should be imposed. Here, it is supposed that the mode invariants and mode transition conditions meet the requirements as in Taringoo and Caines [20].
2.2. Optimal Control Problem for Hybrid Systems
Let be a running cost function, be a discrete state transition cost function, and be a terminal cost function, , , , respectively. The optimal control problem for the hybrid systems (2.1) is stated as follows.
Optimal Problem A
Consider a hybrid system formulated by (2.1), given a fixed time interval and a prespecified mode transition order , find a continuous control in each mode and mode transition instants , such that the corresponding continuous state trajectory departs from a given initial state and meets an -dimensional smooth manifold , , at and the cost functional
is minimized.
Remark 2.6. As it is well known, when and are unknown points in some fixed interval , this problem can be transformed to one with fixed time essentially by introducing an additional state variable.
There are fruitful strategies about how to compute OCPHS (see [15] and the references therein), and the basic idea is briefly reviewed as follows for completeness.
Obtaining the optimal control for hybrid systems is very difficult due to the interactions between the continuous states and discrete states which produce a mode transition sequence that increases the feasibility range of the decision variables. One algorithm framework for dealing with this complexity is the decomposition method as follows: where means that is given.
According to this framework, the master problem is how to get the optimum of the inner functional, that is, minimize given . The key point of finding the optimal solution of is how to get the sensitivity of the objective with respect to control variables, which provides a better direction for searching and hence reduces computational burden and help associated algorithms converge quickly and accelerate the primary problem convergence eventually.
In next section, the derivatives of cost functional with respect to control variables are established analytically based on optimality condition, which can facilitate the design of associated gradient-based algorithms.
3. Equivalent Problem and Its Optimal Conditions
When control vector parametrization methods are implemented to obtain numerical solution to the OCPHS, updating the parameters of control profiles should be at the same time point when iterative procedure is running. However, the fact is that the mode active horizon for mode is varying during the procedure running, so a fixed horizon should be introduced, which will guarantee the updating of parameters of control profiles is at the same time point. For this purpose, let be a time independent variable, and can be formulated by
In addition, to deal with mode invariants constraints , slack algebraic variable is introduced for each mode , such that . For , denote , , , and let , , and .
According to the above definition, the Optimal Problem A can be transcribed into an equivalent Optimal Problem B as follows:
Optimal Problem B
Given a fixed interval , find continuous inputs , and , such that the corresponding continuous state trajectory departs from a given initial state and meets an -dimensional smooth manifold at , and the cost functional
is minimized, subject to
where
and is a large positive constant.
According to Theorems 2 and 3 in Dmitruk and Kaganovich [12], when is big enough Optimal Problem B is equivalent to Optimal Problem A.
Remark 3.1. The penalty function term, say, , cannot always guarantee the state satisfies the mode invariant conditions. However, the method works well in practice; moreover, the mode transition order is fixed in this paper which reduces the negative effect of the penalty function method for OCPHS.
For , , let , and define Hamiltonian function by and according to Sussmann [10], Shaikh and Caines [11], and Dmitruk and Kaganovich [12], the following Theorem 3.2 holds.
Theorem 3.2. In order that and are optimal for Optimal Problem B, it is necessary that there exist vector functions , , such that the following conditions hold:(a)for almost any , the following state equations hold: (b)for almost any , the following costate equations hold: (c)for a.e. , (d)minimality condition: for all , (e)transversality conditions for , where , are Lagrangian multipliers. Based on Theorem 3.2, the sensitivity analysis is established in the next section for Optimal Problem B.
4. Sensitivity Analysis and Parametrization Method
For finding numerical solution to the OCPHS effectively, based on Theorem 3.2, the derivatives of the objective functional with respect to the control , , and the mode transition instant are established in this section, and by using the obtained derivatives associated parametrization method is proposed.
4.1. Sensitivity Analysis
Lemma 4.1. The derivatives of , w.r.t and are given, respectively, as follows for , where
Note that is a functional vector of , and the expression is used, where the notation is the functional derivatives which describe the response of the functional to an infinitesimal change in the function at each point.
Proof. The proof of (4.1) is only going to be shown for easily reading. The proof for (4.2) can be found in Appendix.
When , and are independent of , and obviously holds. In the case of , is a function of which gives rise to .
Case i. (). In this case, is a function of and , and we have
Note that in (4.4), is produced by the perturbation of , and is produced by the perturbation of with respect to . Obviously, for ,
The solution to is given by
Equation (4.6) is a linear system about . Define the state transition matrix by
according to (4.6), and we have
Thus,
At transition instants , since , so
which implies
According to (4.9), and we have
Case ii. (). When , the following holds:
Then,
Substituting the term in (4.14) by (4.10), we obtain
Theorem 4.2. The derivatives of the objective functional w.r.t , and are given, respectively, as follows:
Before proving Theorem 4.2, Lemma 4.3 is firstly given as follows.
Lemma 4.3. For ,
Proof. For any , we have
Since the following holds by Theorem 3.2,
then
Obviously, when , we have
Now we prove Theorem 4.2. We are only going to show for easily reading. The proofs for and can be found in Appendix.
Proof. can be formulated as
Since is independent of for , then can be obtained by
Substituting (4.17), (4.21), and (4.22) into (4.24), we have
Due to Theorem 3.2 and (4.10), can be formulated by
Note that when second-order derivatives are needed, there is no difficulty to obtain the second-order derivatives following the above procedure.
4.2. Parametrization Method
To obtain the numerical solution to optimal control for hybrid systems, continuous control profiles are parameterized on each mode active horizon in this section. Then the numerical solution to optimal controls can be computed based on the obtained sensitivity analysis results. The basic idea behind the proposed method using finite parameterizations of the controls is to transcribe the original infinite dimensional problem, that is, -problem, into a finite dimensional nonlinear programming problem, that is, -problem [25]. Here, the parametrization method that the control profiles are approximated by a family of Lagrange form polynomials is implemented.
Partition each horizon into elements as where are referred to as collocation points, . Let denote the value of at , . Thus, the control variable is represented approximately by a Lagrange interpolation profile for , where . is also parameterized by where is the value of at the collocation points , .
As a result, based on the obtained derivatives, the numerical solution of and to optimal control for the hybrid systems can be solved simultaneously and efficiently by adopting gradient-based algorithms as described in Xu and Antsaklis [3] and Egerstedt et al. [6]. Note that the derivatives are functions of costate as formulated in Theorem 4.2. When control polynomial profiles are implemented, a multipoint boundary value problem about state and costate expressed by (3.6), (3.7), and (3.10) will be solved, which produces the derivatives.
Although the Lagrange interpolation profiles may cause the state or/and control trajectories violate their constraints, this parameterizations method has been proved useful in practice. Moreover, there are some techniques to decrease the defect [1, 2].
Remark 4.4. Control variable can be approximated by several piecewise Lagrange interpolation profiles by further partitioning the element . More detail of the parameterizations methods can be found in Vassiliadis et al. [1, 2], Kameswaran and Biegler [26], and the references therein. Only one Lagrange interpolation profile is used here to show the process of the proposed method.
5. Some Examples
To illustrate the effectiveness of the developed method, two examples with different situations are presented in the following. Numerical examples are conducted on an ThinkPad X61 2.10-GHz PC with 2G of RAM. The program is implemented using MatLab 7. The order of Lagrange polynomials in the examples is 3.
Example 5.1. The prototype of this example comes from Vassiliadis et al. [1]. The hybrid system consists of two batch reactors as shown in Figure 1. The first reactor denoted by mode 1 is fitted with a heating coil which can be used to manipulate the reactor temperature over time and is initially loaded with 0.1 of an aqueous solution of component of concentration 2000 mol/m3. This reacts to form components according to the consecutive reaction scheme . After completion of the first reaction, an amount of dilute aqueous solution of component of concentration 600 mol/m3 is added instantaneously to the products of the first reactor, and the mixture is loaded into the second reactor denoted by mode 2 where the reaction takes place under isothermal conditions at a fixed temperature. The decision variables are the temperature of the mode 1, and the durations of the two mode over the horizon . The dynamics of the hybrid systems can be described by
Mode 1:
Mode 2:
with . The system transits once at from mode 1 to 2 with . The OCPHS is to find an optimal mode transition instant and an optimal input , , to maximize the cost functional
with must be satisfied.
By using the proposed method, the optimal mode transition instant is and the corresponding optimal cost is . The corresponding continuous control and state trajectories are shown in Figure 2. In Vassiliadis et al. [1], the transition instants and the optimal cost are , , respectively, which are solved by software package DAEOPT.
Example 5.2. Example 5.2 comes from Xu and Antsaklis [3] and is also reconsidered by Hwang et al. [9]. Different from the example in the two references, the control constraint is imposed. The example can be referred to as autonomous switching hybrid systems with mode invariants. Consider the hybrid system consisting of
Mode 1:
Mode 2:
with . Assume that , and the system transits once at from Mode 1 to 2 when the state trajectories intersect the linear manifold defined by . Mode 1 is active with its mode invariant and Mode 2 is active with its mode invariant . The OCPHS is to find an optimal mode transition instant and an optimal input such that the cost functional
is minimized.
By using the method developed here, the optimal mode transition instant is and the corresponding optimal cost is . The corresponding continuous control and state trajectories are shown in Figure 3. In Xu and Antsaklis [3], the transition instants and the optimal cost are , , respectively. The bad performance results from that the optimal control is approximated by polynomial.
6. Conclusions
The optimal control problem for hybrid systems (OCPHS) with mode invariants and control constraints is addressed under a priori fixed mode transition order. By introducing new independent variables and auxiliary algebraic variables, the original OCPHS is transformed into an equivalent optimal control problem, and the optimality conditions for the OCPHS is stated. Based on the optimality conditions, the derivatives of the objective functional w.r.t control variables, that is, mode transition instant sequence and admissible continuous control functions, are established analytically. As a result, a control vector parametrization method is implemented to obtain the numerical solution by using gradient-based algorithms with the obtained derivatives. Compared with the existing results on the OCPHS with fixed mode transition order, the settings cover not only the control constraints but also the continuous states constraints, which makes the obtained results more general. Note that when no information about the mode transition sequence is known a priori, the discrete model methods formulated in Bemporad and Morari [27], Barton et al. [15], and Song et al. [28] seem appropriate. In addition, when uncertainties are considered in the systems, the reader is referred to Hu et al. [29] and the references therein.
Appendix
For any , let be given and let be arbitrary but fixed. Define a perturbation of as where is arbitrarily small such that . For the time being, assume that the other controls, , be given and fixed. For brevity, let and denote the state trajectories corresponding to and , respectively. Similarly, let and denote the costate trajectories corresponding to and , respectively, which are the solutions of the costate equations
Proof of (4.2) in Lemma 4.1. When , obviously in these cases is independent of , that is, , which leads to
Case i (). Since
with , thus we have
where is the state transition matrix defined in Section 3. Based on the definition of functional derivative, there exists
Case (ii) (). In this case,
which gives rise to
At mode transition instant , holds, which results in
Substituting (A.9) into (A.8), we obtain
According to the definition of functional derivative, we have
This completes the proof.
Before proving the in Theorem 4.2, Lemma A.1 is firstly given as follows.
Lemma A.1. For any ,
Proof. Note that
Since the following holds by Theorem 3.2:
therefore,
Obviously, when , we have
Proof of in Theorem 4.2. can be rewritten by
Applying a -operation to (A.17) leads to
Due to Theorem 3.2 and (A.9), can be reformulated by
Then according to the definition of functional derivative, we have
Obviously, the functional derivative of with respect to can be directly given by
This completes the proof.
Acknowledgments
The authors would like to express their sincere thanks to Professor Michael Fu at the University of Maryland (College Park) for suggestions on this work. This work was supported by the NSF under grant 60974023 of China, the State Key Development Program for Basic Research of China (2012CB720503), and the Fundamental Research Funds for the Central Universities.