In this section we develop a switch cost formulation that is suitable for inclusion into the convexified relaxed problem (RC) and fits into a direct multiple shooting discretization. The key issues here are maintaining differentiability and separability of the problem formulation.
We introduce the following discretized variant of the auxiliary problem (BC) with switch costs as shown in definition 2.17. Herein, a discretization on a fixed grid {ti} with m nodes,
ω(t)= qdef i∈ Ω ∀t ∈ [ti, ti+1), 0 ¶ i ¶ m − 1, (2.24) is assumed for the binary convexified control trajectory ω(·), and we remind the reader of the convenience definition ω(tm) def= qm = qm−1. The additionally introduced variable σ counts the number of changes in each component of the discretized binary control trajectory ω(·) over time. The number of switches may be constrained by an upper limit σmaxor included in the objective function using a weighting penalization factor π. We further denote by (RCS) the relaxed counterpart problem of (BCS) only which differs in
qi∈ [0, 1]nΩ
, 0¶ i ¶ m − 1. (RCS)
Definition 2.17 (Discretized Problem (BC) with Switch Costs)
The multiple shooting discretization of the binary convexified linear problem with switch costs is the following extension of problem (BC),
min s,q m X i=0 nΩ X j=1 li(ti, si, ωj) qi j+ nΩ X j=1 πjσj (BCS) s. t. 0 = nΩ X j=1 xi(ti+1; ti, si, ωj) qi j− si+1, 0¶ i ¶ m − 1, s0= x0, qi ∈ {0, 1}nΩ, 0¶ i ¶ m − 1, 1 = nΩ X j=1 qi j, 0¶ i ¶ m − 1, σj = m−1X i=0 qi+1,j− qi, j , 1¶ j ¶ nΩ, σj ¶ σj,max, 1¶ j ¶ nΩ. 4
2.5.4 Reformulations
In the following, we address several issues with the problem formulation (BCS). The defining constraint for σ is nondifferentiable with respect to q, and we present two reformulations that overcome this. Second, the behavior of (RCS) after relaxation of the binary requirement is studied. Finally, the above formulation obviously comprises a coupled constraint connecting control parameters from adjacent shooting intervals. This impairs the separability property of the NLP’s Lagrangian and we present a separable reformulation in order to maintain compu- tational efficiency.
Differentiable Reformulation
Addressing the issue of nondifferentiability, we use a reformulation introducing slack variables for the constraint defining σk, 1¶ k ¶ nΩas follows,
σk= 12 m−1 X i=0 δi, j, (2.25) δi, j¾ qi+1,j− qi, j, δi, j¾ qi, j− qi+1,j.
Here, positivity of the slacks δi, j is ensured by the two additionally introduced constraints. This moves the nondifferentiability to the active set method solving the NLP. At least one of the two constraints on the positive differences δi, jwill be active at any time.
Note that the introduction of switch costs by this formulations introduces for each of the m · nΩconvex multipliers one additional control parameter into the NLP. Linear algebra tech- niques for solution of the discretized MIOCP that are tailored to problems with many control parameters are presented in chapter 7.
After relaxation of the convex multipliers qi, j emerging from the outer convexification ap- proach, the above differential reformulation has the drawback of attracting fractional solu- tions. As an example, the relaxed optimal solution qi j = 12 for all intervals 0 ¶ i ¶ m − 1 and j = 1, 2 should be recognized as a “switching” solution, as the sum–up rounding strategy would yield a rounded control alternating between zero and one. The differences of adjacent relaxed optimal control parameters are zero however, which yields σ = 0.
Convex Reformulation
In order to address this issue, we develop a new second approach making use of a convex reformulation of the nondifferentiability. For two binary control parameters qi, j and qi+1,j adjacent in the time discretization of the control trajectory, the switch cost σi, jis given by the expression
σi, j= αdef i, j(qi, j+ qi+1,j) + βi, j(2 − qi, j− qi+1,j), αi, j+ βi, j= 1, (2.26) in which αi, jand βi, j are binary convex multipliers introduced as additional degrees of free- dom into the optimization problem. Note that the SOS1 constraint can again be used to elim- inate the multiplier βi, j,
σi, j= (2αi, j− 1)(qi, j+ qi+1,j− 1) + 1. (2.27)
Under minimization of the switch cost, this expression yields the solutions listed in table 2.1a. Figure 2.4a depicts the evaluation points and values.
For the relaxed problem (RCS), this convex reformulation ensures that fractional solutions are assigned a nonzero cost, in particular any fractional solution is more expensive than the nonswitching binary ones, and that the switching binary solutions are assigned the highest cost. Table 2.1b shows the switch costs under minimization for fractional values of the relaxed control parameters. The convexification envelope is depicted in figure 2.4b.
qi, j qi+1,j αi, j βi, j 12σi, j
0 0 1 0 0
0 1 free free 1
1 0 free free 1
1 1 0 1 0
(a) Switch costs for binary controls.
qi, j+ qi+1,j αi, j βi, j 12σi, j < 1 1 0 < 1
= 1 free free 1
> 1 0 1 < 1
(b) Switch costs for relaxed controls. Table 2.1: Binary and relaxed optimal solutions for the convex switch cost reformulation.
1 0 1 1 0 ˜ wi, j w˜i+1,j σi, j
(a) Switch costs for binary controls.
1 0 1 1 0 ˜ wi, j w˜i+1,j σi, j
(b) Switch costs for relaxed controls.
Figure 2.4: Convex reformulation of the switch cost constraint for two binary controls adjacent in the time discretization.
Numerical results obtained from this strategy look promising as detailed in chapter 9, though the connection to the MILP (2.23) yet remains to be clarified.
Separable Reformulation for Direct Multiple Shooting
Separability of the objective function and all constraint functions with respect to the discretiza- tion in time is a crucial property of the direct multiple shooting discretization. It introduces a block structure into the discretized OCP that can be exploited very efficiently as detailed in chapter 7. The only coupling between adjacent shooting intervals allowed so far has been the consistency condition imposed on the IVP solutions in the shooting nodes.
Separability of the above differential reformulation can be recovered by formally introducing an augmented vector of differential states ˆx = [x d] together with the augmented matching
condition PnΩ j=1xi(ti+1; ti, si, ωj) qi j− si+1 qi− qi+1− d =0. (2.28)
This matching condition deviates from the classical direct multiple shooting method [36, 166] in that it depends on the control parameter vector of the subsequent shooting interval. In chapter 7 we investigate structured linear algebra techniques for SQP subproblems with many control parameters that support this generalized type of matching condition. The separable
linear reformulation reads σ = 12 m−1X i=0 nΩ X j=1 δi j, δi¾ di¾ −δi, 0¶ i ¶ m − 1. (2.29)
Separability of the convex reformulation can be recovered in a similar way.
2.6 Summary
In this chapter we have been concerned with reformulations of MIOCPs that allow for the efficient numerical solution or approximation. Focus has been put on a convex reformulation of the MIOCP with respect to the binary or integer control. After relaxation, this reformula- tion allows to obtain an approximation to a solution of an MIOCP by solving only a single continuous but possibly larger OCP. This is due to the fact that the convexified OCP’s optimal solution can be approximated with arbitrary quality by a control trajectory on the boundary of the feasible set. For a discretization of this reformulated OCP, bounds on the loss of optimality and on the infeasibility of those constraints independent of the integer control can be shown. Constraints directly depending on the integer control are considered in chapter 5. Rounding schemes were presented that in the case of fractional optimal solutions of the relaxed OCP allow to reconstruct an integer feasible solution with a known bound on the loss of optimality. We have considered an MILP formulation replacing sum–up rounding in the case of upper lim- its constraining the permitted number of switches. A convexification and relaxation has been developed for this formulation that does not attract fractional solutions of the convexified relaxed OCP. It further maintains separability of the objective and constraints functions, and can thus be included in a direct multiple shooting discretization of the OCP. The presented switch cost formulations double the number of control parameters emerging out of the convex reformulation. Linear algebra techniques for the solution of the discretized OCP with many control parameters are considered in chapter 7.
We have already briefly touched nonlinear programming in the last two chapters, in which we introduced the multiple shooting discretized optimal control problem, a Nonlinear Program (NLP), and presented the outer convexification and relaxation approach that allows to com- pute approximations to local Mixed–Integer Optimal Control Problem (MIOCP) solutions by solving a reformulated and discretized but possibly much larger Optimal Control Problem (OCP). This chapter is concerned with theory and numerical methods for the solution of NLPs and equips the reader with definitions and algorithms required for the following chapters of this thesis. We present optimality conditions characterizing locally optimal solutions and in- troduce Sequential Quadratic Programming (SQP) methods for the iterative solution of NLPs. The evaluation of the matching condition constraints of the discretized optimal control prob- lem requires the solution of Initial Value Problems (IVPs). To this end, we present one step methods for non–stiff Ordinary Differential Equations (ODEs) and discuss the efficient and consistent computation of sensitivities of IVPs solutions.