• No results found

A Simple and Fast Coordinate-Descent Augmented-Lagrangian Solver for Model Predictive Control

N/A
N/A
Protected

Academic year: 2021

Share "A Simple and Fast Coordinate-Descent Augmented-Lagrangian Solver for Model Predictive Control"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

A Simple and Fast Coordinate-Descent Augmented-Lagrangian Solver for Model Predictive Control

Liang Wu1, Alberto Bemporad1

Abstract— This paper proposes a novel Coordinate-Descent Augmented-Lagrangian (CDAL) solver for linear, possibly parameter-varying, model predictive control problems. At each iteration, an augmented Lagrangian (AL) subproblem is solved by coordinate descent (CD), whose computation cost depends linearly on the prediction horizon and quadratically on the state and input dimensions. CDAL is simple to implement and does not require constructing explicitly the matrices of the quadratic programming problem to solve. To favor convergence speed, CDAL employs a reverse cyclic rule for the CD method, the accelerated Nesterov’s scheme for updating the dual variables, and a simple diagonal preconditioner. We show that CDAL competes with other state-of-the-art first-order methods, both in case of unstable linear time-invariant and prediction models linearized at runtime. All numerical results are obtained from a very compact, library-free, C implementation of the proposed CDAL solver.

Index Terms— Augmented Lagrangian method, coordinate descent method, model predictive control

I. INTRODUCTION

Model predictive control (MPC) has been widely used for decades to control multivariable systems subject to input and output constraints [1]. Apart from small-scale linear time- invariant (LTI) MPC problems whose explicit MPC control law can be obtained [2], deploying an MPC controller in an electronic control unit requires an embedded Quadratic Programming (QP) solver. In the past decades, the MPC community has made tremendous research efforts to develop embedded QP algorithms [3], based on interior-point meth- ods [4], [5], active-set algorithms [6], [7], gradient projection methods [8], the alternating direction method of multiplier (ADMM) [9], [10], and other techniques [11]–[14].

A demanding requirement for industrial MPC applications is code simplicity, especially in safety-critical applications in which the code must be verified and validated and is easy to maintain. In this respect, compared to interior-point and active-set methods that may require linear algebra operations, first-order methods like gradient projection and ADMM are quite appealing, due to their very simple embedded implementation. Most of the proposed approaches, however, require that the matrices of the QP problem are constructed explicitly (for instance by condensing the MPC problem through the elimination of equality constraints) in order to be consumed by the solver, typically for preconditioning, to estimate the Lipschitz constant of the cost gradient, matrix factorizations, and during solver iterations. While this may not be an issue for LTI-MPC problems, in which the QP

The authors are with the IMT School for Advanced Studies Lucca, Italy, {liang.wu,alberto.bemporad}@imtlucca.it

problem construction and other operations on the problem matrices can be done off-line, for linear parameter-varying (LPV) MPC problems, or for LTI problems in which the cost function and/or constraint matrices change at run time, constructing the QP problem explicitly online increases the complexity of the embedded code. To avoid such a QP con- struction phase, in [15] the authors proposed a construction- free solver for linear MPC based on an active-set method, whose implementation however requires more complex op- erations than those involved in first-order algorithms.

A. Contribution

This paper describes a novel construction-free MPC solver for both LTI and LPV MPC problems that is very simple to code and computationally efficient. The solver is based on combining coordinate descent (CD) and augmented La- grangian (AL) methods.

Coordinate descent has received extensive attention in recent years due to its application to machine learning [16]–

[18] and other applications [19]. Random and accelerated variants of the CD method were proposed in [20]–[23]. In this paper, we will exploit the special structure arising from linear MPC formulations when applying CD.

In [24]–[26], the authors also use AL to solve linear MPC problems with input and state constraints using the fast gradient method [27] to solve the associated subproblems.

The Lipschitz constant of the cost gradient and convexity parameters [24] are needed to achieve convergence, and computing them requires in turn the Hessian matrix of the subproblem and hence constructing the QP problem. As the Hessian matrix of the AL subproblem is close to a block diagonal matrix, this suggests the use of the CD method to solve such a QP subproblem, due to the fact that CD does not require any problem-related parameter. Moreover, only small matrices are involved in running the CD method, namely the matrices of the linear prediction model and the weight matrices. As a result, the proposed CDAL algorithm does not require the QP construction phase and is extremely simple to implement. In addition, each update of the optimization vector has a computation cost per iteration that is quadratic with the state and input dimensions and linear with the prediction horizon, which makes the proposed algorithm attractive for long prediction horizons.

To improve the convergence speed of CDAL, three tech- niques are proposed in this paper: a reverse cyclic rule for CD, Nesterov’s acceleration [27], and preconditioning.

While the use of a reverse cyclic rule in CD still preserves convergence, when the MPC problem is solved by warm-

arXiv:2109.10205v1 [math.OC] 21 Sep 2021

(2)

starting it from the shifted previous optimal solution, the gap between the initial guess and the new optimal solution is mainly caused by the last block of variables, and computing the last block at the beginning tends to reduce the overall number of required iterations to converge, as we will verify in the numerical experiments reported in this paper. Since the general AL method has O(1/k) convergence rate [28], we employ Nesterov’s acceleration scheme for updating the dual vector to improve computation speed, although the accelerated scheme does not reach the expected O(1/k2) convergence rate due to the limit imposed on the number of iterations of the inner CD loop. To further reduce the outer loop iterations, this paper proposed a heuristic preconditioner that simply scales the state variables.

The structure of the paper is as follows. Section II formu- lates the MPC problem we want to solve. In Section III, we present the augmented Lagrangian and coordinate descent methods we use to formulate the solver, together with the reverse cyclic rule, Nesterov’s acceleration scheme, and preconditioner. In Section IV, two numerical benchmark examples are presented, namely the ill-conditioned AFTI- 16 linear MPC example, and the continuously stirred tank reactor (CSTR) MPC example, in which the nonlinear dy- namics is linearized at each controller execution. Finally, we draw conclusions in Section V.

B. Notation

H  0 (H  0) denotes positive definiteness (semi- definiteness) of a square matrix H, H0 (or z0) denotes the transpose of matrix H (or vector z), Hi,j denotes the ith row and the jth column element of matrix H, Hi,·, H·,j denote the ith row vector, and jth column vector of matrix H, respectively. For a vector z, kzk2 denotes the Euclidean norm of z, z6=i the subvector obtained from z by eliminating its ith component zi.

II. MODELPREDICITIVECONTROL

Consider the following MPC formulation for tracking problems

min

T −1

X

t=0

kWy(yt+1− rt+1)k22+

Wu ut+1− urt+1

2 2

+ kW∆u∆utk22 s.t. xt+1= Axt+ But−1+ B∆ut

yt= Cxt

ut= ut−1+ ∆ut

xmin≤ xt≤ xmax, t = 1, . . . , T umin≤ ut≤ umax, t = 0, . . . , T − 1

∆umin≤ ∆ut≤ ∆umax, t = 0, . . . , T − 1 (1) in which rtand urt are the output and input set-points, xt∈ Rnx the state vector, ut∈ Rnu the input vector, ∆ut= ut− ut−1the vector of input increments, and yt∈ Rny the output vector. We assume that Wy = Wy0  0, Wu = Wu0  0, W∆u= W∆u0  0. The formulation (1) could be extended to include time-varying bounds on x and u along the prediction

horizon, linear equality constraints or box constraints on the terminal state xT for guaranteed closed-loop convergence, as well as affine prediction models. To simplify the notation, in the sequel we consider the following reformulation of (1)

min

T

X

t=1

ˆ

x0t( ˆC0W ˆˆC)ˆxt− ˆx0t( ˆC0W ˆˆrt) + ˆu0t−1W∆ut−1

s.t. xˆt+1= ˆAxt+ ˆB ˆut ˆ

xmin≤ ˆxt≤ ˆxmax, t = 1, . . . , T ˆ

umin≤ ˆut≤ ˆumax, t = 0, . . . , T − 1 (2) where ˆxj = xj

uj−1, ˆuj = ∆uj, ˆA = [A B0 I] ∈ Rn×n, ˆB = [BI] ∈ Rn×p, ˆC = [C 00 I], ˆW =hW

y 0 0 Wu

i

, ˆrj =hrj urj

i . The vector z of variables to optimize is

z = ˆ

u000101 . . . uˆ0T −10T 0

∈ RT (nx+nu) The inequality constraints on state and input variables, whose number is 2N (nx+ nu), are

z ≤ z ≤ ¯z ⇔

 xˆmin≤ ˆxt≤ ˆxmax, ∀t = 1, . . . , T ˆ

umin≤ ˆut≤ ˆumax, ∀t = 0, . . . , T − 1 At each sample step, the MPC problem (1) can be recast as the following quadratic program (QP)

min 1

2z0Hz + h0z s.t. z≤ z ≤ ¯z

Gz = g (3)

where H = H0  0, H ∈ Rnz×nz, nz = T (nx+ nu), h ∈ Rnz, G ∈ RT nx×nz, and g ∈ RT nx are defined as

H =

R 0 . . . 0 0 0 Q . . . 0 0 ... ... . .. ... ... 0 0 . . . R 0 0 0 . . . 0 Q

 ,

R = W∆u

Q = Cˆ0W ˆˆC

G =

Bˆ −I 0 0 . . . 0 0 0

0 Aˆ Bˆ −I . . . 0 0 0 ... ... ... ... . .. ... ... ... 0 0 0 0 . . . Aˆ Bˆ −I

h =

 Cˆ0W ˆˆr Cˆ0W ˆˆr

... Cˆ0W ˆˆr

 , g =

−Aˆxk

0 ... 0

Clearly matrix G is full row rank. Note that A, B, C, Wy, Wu, W∆u and the upper and lower bounds on x, u, and ∆u in (1) may change at each controller execution.

III. ALGORITHM

A. Augmented Lagrangian Method

We solve the convex quadratic programming problem (3) by applying the augmented Lagrangian method. The bound- constrained Lagrangian function L : Z × Rnz → R is given by

L(z, λ) =1

2z0Hz + z0h + λ0(Gz − g)

(3)

where Z = {z ≤ z ≤ ¯z} and λ ∈ RT nx is the vector of Lagrange multipliers associated with the equality constraints in (3). The dual problem of (3) is

max

λ∈RT nxd(λ) (4)

where d(λ) = minz∈ZL(z, λ). Assuming that Slater’s con- straint qualification holds, the optimal solution of the primal problem (3) and of its dual (4) coincide. However, d(λ) is not differentiable in general [29], so that any subgradient method for solving (4) would have a slow convergence rate. Under the AL framework, the augmented Lagrangian function

Lρ(z, λ) = 1

2z0Hz + z0h + λ0(Gz − g) +ρ

2kGz − gk2 (5) is used instead, where the parameter ρ > 0 is a penalty parameter. The corresponding augmented dual problem is defined as:

max

λ∈Rmdρ(λ) (6)

where dρ(λ) = minz∈ZLρ(z, λ). The dual problem (4) and the augmented dual problem (6) share the same optimal solution [30], and most important dρ(λ) is concave and differentiable, with gradient [29], [31]

∇dρ(λ) = Gz(λ) − g

where z(λ) denotes the optimal solution of the inner prob- lem minz∈ZLρ(z, λ) for a given λ. Moreover, the gradient mapping ∇dρ : Rm → Rm is Lipschitz continuous, with Lipschitz constant Ld = ρ−1. The AL algorithm can be expressed as follows [30]

zk+1 = argmin

z∈Z

Lρ(z, λk) (7a) λk+1 = λk+ ρ(Gzk+1− g) (7b)

which involves the minimization step of the primal vector z and the update step of the dual vector λ. As shown in [30], the convergence of AL can be assured for a large range of values of ρ. Obviously, the larger the penalty parameter, the faster the AL algorithm will be, but the condition number of the Hessian matrix of subproblem (7a) will be larger, which in general makes (7a) more difficult to solve. The convergence rate of the AL algorithm (7) is O(1/k) accord- ing to [28] and thus the parameter ρ tends to trade off the convergence rates to optimality and to feasibility. To improve the speed of the AL method, [28] proposed an accelerated AL algorithm whose iteration-complexity is O(1/k2) for linearly constrained convex programs by using Nesterov’s acceleration technique. The accelerated AL algorithm is summarized in Algorithm 1.

Algorithm 1 Accelerated augmented Lagrangian method [28]

Input: Initial guess z0 ∈ Z and λ−1 = λ0; maximum number Nout of iterations.

1. Set α−1, α0← 1; ˆλ1← λ0; 2. for k = 1, 2, · · · , Nout do

2.1. zk ← argminz∈ZLρ(z, ˆλk);

2.2. λk ← ˆλk+ ρ(Gzk− g);

2.3. if kλk− ˆλkk22≤ , stop;

2.4. αk12(q

α4k−1+ 4α2k−1− α2k−1);

2.5. β ← ααk

k−1 − αk;

2.6. ˆλk+1← λk+ β(λk− λk−1);

3. end.

For box-constrained QP deriving from (1), the correspond- ing subproblem (7a) in the AL method is

zk+1= arg min

z F (z; λk) s.t. z ≤ z ≤ ¯z

(8)

where

F (z; λk) = 1

2z0HAz + (hkA)0z

hkA = 1ρh + G0λk− G0g, and HA = 1ρH + G0G has the block-sparse structure

HA=

φ1 φ2 0 0 0 . . . 0 0 0

φ02 φ3 φ4 φ5 0 . . . 0 0 0 0 φ04 φ1 φ2 0 . . . 0 0 0 0 φ05 φ02 φ3 φ4 . . . 0 0 0 ... ... ... ... ... . .. ... ... ... 0 0 0 0 0 . . . φ3 φ4 φ5

0 0 0 0 0 . . . φ04 φ1 φ2

0 0 0 0 0 . . . φ05 φ02 φ6

where

φ1= 1ρR + B0B, φ2= −B0 φ3= 1ρQ + (I + A0A) , φ4= A0B φ5= −A0, φ6= 1ρQ + I Since G is full rank, matrix HA 0.

For solving the strongly convex QP (8), the fast gradient projection method was used in [24], [26]. Inspired by the fact that the Gauss-Seidel method in solving block tridiagonal linear systems is efficient [32], in this paper we propose the use of the cyclic CD method to make full use of block sparsity and avoid the explicit construction of matrix HA. Note that in the gradient projection method or fast gradient projection method [26], the Lipschitz constant parameter deriving from matrix HAneeds to be calculated or estimated to ensure convergence. Therefore, for linear MPC problems that change at runtime such methods would be less preferable than cyclic CD. In this paper, by making full use of the structure of the subproblem, we will implement a cyclic CD method that requires less computations, as we will detail in the next section.

(4)

B. Coordinate Descent Method

The idea of the CD method is to minimize the objective function along only one coordinate direction at each iteration, while keeping the other coordinates fixed [33], [34]. In [35], [36], the authors showed that the CD method is convergent in convex differentiable minimization problems, and the rate of convergence is at least linear. We first give a brief introduc- tion of the CD method to solve (8). Under the assumption that the set of optimal solutions is nonempty and that the objective function F is convex, continuously differentiable, and strictly convex with respect to each coordinate, the CD method proceeds iteratively for k = 0, 1, . . . , as follows:

choose ik ∈ {1, 2, . . . , nz} (9a) zik+1

k = argmin

zik∈Z

F (zik, z6=ik

k; λk) (9b)

where with a slight abuse of notation we denote by F (zik, zk6=i

k; λk) the value F (z; λk) when z6=ik = zk6=i

k is fixed. The convergence of the iterations in (9) for k → ∞ depends on the rule used to choose the coordinate index ik. In [36], the authors show that the almost cyclic rule and Gauss-Southwell rule guarantee convergence. Here we use the almost cyclic rule, that provides convergence according to the following lemma:

Lemma 1 ( [36]): Let zk

be the sequence of coordinate-descent iterates (9), where every coordinate index is iterated upon at least once on every N successive iterations, N ≥ nz. The sequence zk converges at least linearly to the optimal solution z of problem (8).

In this paper we will use the reverse cyclic rule ik= nz− (k mod nz)

to exploit the fact that the shifted previous optimal so- lution is used as warm start, a rule that clearly satisfies the assumptions for convergence. The implementation of one pass through all nz coordinates using reverse cyclic CD is reported in Procedure 2. For given M ∈ Rns×ns, d ∈ Rns, the operator CCD[s,¯s]{M, d} used in Procedure 2 represents one pass iteration of the reverse cyclic CD method through all nscoordinates sns, . . . , s1for the following box- constrained QP

min

s∈[s,¯s]

1

2s0M s + s0d (10) that is to execute the following nsiterations

for i = ns, . . . , 1 si←h

siM1

i,i(Mi,·s + di)is¯i

si

end

(11)

where [si]ss¯i

i is the projection operator [si]ss¯i

i=

¯

si if si≥ ¯si

si if si< si< ¯si

si if si≤ si

(12) An efficient way of evaluating Step 3.2 (and also Step 2) of Procedure 2 is reported in Procedure 3. Note that Procedure 2 requires O(T (n2x+ n2u)) arithmetic operations.

Procedure 2 One full pass of reverse cyclic coordinate descent on all block variables

Input: Λ = {λ1, . . . , λT}, ˆU = {ˆu0, · · · , ˆuT −1}, ˆX = {ˆx0, ˆx1, · · · , ˆxT}; MPC settings A, B, Q, R, ˆumin, ˆumax, ˆ

xmin, ˆxmax; Algorithm setting ρ.

1. ˆxT ← CCD

ˆ

xT∈[ˆxminxmax]{1ρQ + I, −λT− AˆxT −1− B ˆuT −1};

2. ˆuT −1← CCD

ˆ

uT −1∈[ˆuminumax]{ρ1R + B0B, B0T+ AˆxT −1− ˆ

xT)};

3. for t = T − 1, T − 2, . . . , 1 do 3.1. ˆxt ← CCD

ˆ

xt∈[ˆxminxmax]

{1ρQ + I + A0A, −(λt+ Aˆxt−1+ B ˆut−1) + A0t+1+ B ˆut− ˆxt+1)};

3.2. ˆut−1← CCD

ˆ

ut−1∈[ˆuminumax]{ρ1R + B0B, B0t+ Aˆxt−1− ˆ

xt)};

4. end.

Output: ˆU , ˆX.

Procedure 3 One pass of reverse cyclic coordinate descent for Step 3.2 of Procedure 2

Input: λt, ˆut, ˆxt; MPC settings A, B, R, ˆumin, ˆumax; Algorithm setting ρ.

1. Vt← λt+ Aˆxt−1+ B ˆut−1− ˆxt; 2. for i = nu, . . . , 1 do

2.1. s ← 1ρRi,·t−1+ (B·,i)0Vt; 2.2. θ ←h

ˆ

ut−1,i1 s ρRii+(B0B)ii

iuˆmax,i

ˆ umin,i

; 2.3. ∆ ← θ − ˆut−1,i;

2.4. ˆut−1,i← θ;

2.5. Vt← Vt+ ∆B·,i; 3. end.

Output: ˆut−1.

C. Preconditioning

Preconditioning is a common heuristic for improving the computational performance of first-order methods. The op- timal design of preconditioners has been studied for several decades, but such computation is often more complex than the original problem and may become prohibitive if it must be executed at run time. Diagonal scaling is a heuristic preconditioning that is very simple and often beneficial. In this paper, we propose to make the change of state variables x = Ex, where E is a diagonal matrix whose ith entry is¯

Ei,i=q

Qi,i+ A0·,iA·,i (13) and replace the prediction model xk+1= Axk+ Buk by

¯

xk+1= ¯A¯xk+ ¯Buk

where ¯A = EAE−1 and ¯B = EB. The weight matrix Q and constraints [xmin, xmax] are scaled accordingly by setting Q = E¯ −1QE−1 and ¯xmin= E−1xmin, ¯xmax= E−1xmax.

(5)

D. CDAL algorithm

The overall solution method described in the previous section is summarized in Algorithm 4, that we call CDAL.

The CDAL algorithm combines CD with the AL method, making use of the reverse cyclic rule for CD and Nesterov’s acceleration scheme and preconditioning for AL, that we have specialized for the MPC formulation (2). The AL (outer) iterations are executed for maximum Nout iterations, the CD (inner) iterations for at most Nin iterations. The tolerances out and in are used to stop the outer and inner iterations, respectively. The C-code implementation of Algorithm 4 is library-free and consists of about 150 lines of code, which is tested in MATLAB R2020a C-Mex Interface.

Algorithm 4 Accelerated reverse cyclic CDAL algorithm for linear (or linearized) MPC

Input: primal/dual warm-start U0 = {ˆu0, ˆu1, · · · , ˆuT −1}, X0 = {ˆx0, ˆx1, · · · , ˆxT}, Λ−1 = Λ0 = {λ1, λ2, · · · , λT}; MPC settings {A, B, C, Wy, Wu ,W∆u, ∆umin,

∆umax, umin, umax, xmin, xmax}; Algorithm settings {ρ, Nout, Ninout, in}

1. α−1, α0← 1; ˆΛ1← Λ0; 2. for k = 1, 2, · · · , Nout do

2.1. ˆU ← Uk−1, ˆX ← Xk−1; 2.2. for kin= 1, 2, · · · , Nin do

2.2.1. Update ˆU , ˆX by Procedure 2 with Λ = Λk−1; 2.2.2. if k ˆU − Uk−1k22≤ in and k ˆX − Xk−1k22≤ in

break the loop;

2.3. Uk← ˆU ; Xk ← ˆX;

2.4. for t = 1, . . . , T do

2.4.1. λkt = ˆλkt + Aˆxt−1+ B ˆut−1− ˆxt; 2.5. if kΛk− ˆΛkk22≤ out stop;

2.6. αk12(q

α4k−1+ 4α2k−1− α2k−1);

2.7. β ← ααk

k−1 − αk;

2.8. ˆΛk+1← Λk+ β(Λk− Λk−1);

3. end.

Output: U, X, Λ

IV. NUMERICALEXAMPLES

In this section we test the CDAL solver on two benchmark examples used in the Model Predictive Control Toolbox for MATLAB [37]: an ill-conditioned AFTI-16 control problem [38], [39] based on LTI-MPC, and MPC of a nonlinear CSTR [40] using LPV-MPC based on linearizing the model at each sample step. The reported simulation results were obtained on a MacBook Pro with 2.7 GHz 4-core Intel Core i7 and 16GB RAM.

A. AFTI-16 Benchmark Example

The open-loop unstable linearized AFTI-16 aircraft model reported in [38], [39] is





















˙ x =

−0.0151 −60.5651 0 −32.174

−0.0001 −1.3411 0.9929 0

0.00018 43.2541 −0.86939 0

0 0 1 0

x

+

−2.516 −13.136

−0.1689 −0.2514

−17.251 −1.5766

0 0

u

y =h 0 1 0 0

0 0 0 1

i x

The model is sampled using zero-order hold every 0.05 s.

The input constraints are |ui| ≤ 25, i = 1, 2, the output constraints are −0.5 ≤ y1≤ 0.5 and −100 ≤ y2≤ 100. The control goal is to make the pitch angle y2 track a reference signal r2. In designing the MPC controller we take Wy = diag([10,10]), Wu = 0, W∆u = diag([0.1, 0.1]), and the prediction horizon is T = 5.

To investigate the effects of the three critical techniques (reverse cyclic rule, acceleration, and preconditioning) that we have introduced to improve the efficiency of the CDAL algorithm, we performed closed-loop simulations on eight schemes with fixed ρ = 1: 0-CDAL, the basic scheme, without acceleration and reverse cyclic rule; R-CDAL, the scheme with the Reverse cyclic rule; A-CDAL, the Ac- celerated scheme; AR-CDAL, the Accelerated scheme with the Reverse cyclic rule, and their respective schemes with preconditioner, namely P-CDAL, P-R-CDAL, P-A-CDAL, and finally CDAL that includes all the proposed techniques.

The stopping criteria are defined by in = 10−6, out = 10−4, and Nout, Ninare set to the large enough value 5000 in order to guarantee good-quality solutions. The closed-loop performance of these eight schemes are almost indistinguish- able and are reported in Figure 1. It can be seen that the pitch angle correctly tracks the reference signal from 0 to 10 and then back to 0 and satisfies both the input and output constraints.

The computational load associated with the above schemes is listed in Table I, in which the last column represents the closed-loop performance. In this paper, the closed- loop performance is denoted by the average value of the MPC cost during the whole close-loop runtime, namely

1 T

PT −1

t=0 kWy(yt+1− rt+1)k22 +

Wu ut+1− urt+1

2 2 + kW∆u∆utk22. Since each execution time step will require different inner iterations and outer iterations to offer the required tolerances, the “avg” and “max” means the av- erage and maximum iterations (or CPU time) computed over the entire closed-loop execution. It can be seen that the maximum and average number of inner-loop iterations of R-CDAL are smaller than that of CDAL (especially the maximum number), while their outer-loop iterations are almost the same, which shows that the reverse cyclic rule provides a significant improvement. Although A-CDAL has fewer outer-loop iterations, it has more inner-loop iterations than CDAL on average. It therefore does not result in a

(6)

0 20 40 60 80 100 120 140 160 180 200 0

5 10

y2

0 20 40 60 80 100 120 140 160 180 200

-0.5 0 0.5

y1

0 20 40 60 80 100 120 140 160 180 200

-20 0 20

u1

0 20 40 60 80 100 120 140 160 180 200

time -20

0 20

u2

Fig. 1: Linear AFTI-16 closed-loop performance

significant reduction in total computation time. We can see that AR-CDAL achieves fewer iterations both in the inner loop and outer loop and has better average and worst-case computation performance. It can also be seen from Table I that preconditioning significantly reduces the number of outer-loop iterations.

TABLE I: Computational performance of different schemes

method inner iters outer iters time (ms) cost

avg max avg max avg max

0-CDAL 75 2616 338 2103 6.4 72.4 42.301

R-CDAL 8 33 340 2102 5.4 67.8 42.574

A-CDAL 144 2616 38 174 5.0 44.9 42.548

AR-CDAL 58 165 38 177 3.7 39.5 42.670

P-CDAL 282 2597 32 170 2.6 16.2 42.534

P-R-CDAL 27 67 32 170 1.2 15.8 42.525

P-A-CDAL 303 2597 10 50 2.3 12.4 42.575

CDAL 63 267 10 50 1.0 11.6 42.561

Next, we investigate the effect on computation efficiency of parameter ρ, that we expect to tend to trade off feasibility versus optimality. In particular, we expect larger values of ρ to favor feasibility, i.e., provide more inner-loop iterations and less outer-loop iterations, and vice versa. The compu- tational performance results obtained by performing closed- loop simulations using the final CDAL algorithm for different values of ρ between 0.01 and 1 are listed in Table II, along with the results obtained by using the OSQP solver [10], that we used to compare CDAL with a state-of-the-art first-order method for QP. The tolerances used in OSQP are set to 10−6 to provide comparable closed-loop performance.

Table II confirms that, as ρ decreases, the number of inner- loop iterations gets smaller while the number of outer-loop iterations gets larger. When the parameter value is between 0.01 and 0.1, the CDAL algorithm has very similar compu- tational burden, that is lighter than that of OSQP. Regarding this latter solver, we split between QP problem construction time (including the required matrix factorizations) and pure

solution time. Note that in this case the controller is LTI- MPC, and hence the MPC problem construction and matrix factorizations required by OSQP can be performed offline.

On the other hand, in case of LPV-MPC problems the total computation time would be spent online and the embedded code would also include routines for problem construction and matrix factorization functions. Instead, CDAL does not require any construction nor factorizations, thus making the solver very lean and fast also in a time-varying MPC setting, as investigated next.

TABLE II: Computational load of CDAL with different values of ρ and comparison with OSQP

ρ inner iters outer iters time (ms) cost

avg max avg max avg max

1 63 267 10 50 1.0 11.6 42.561

0.5 46 206 12 60 0.9 8.4 42.590

0.2 31 123 16 89 0.7 5.1 42.612

0.1 24 108 18 95 0.6 4.7 42.619

0.05 18 73 20 85 0.5 4.2 42.618

0.01 7 44 29 144 0.5 4.4 42.620

OSQP - - 530 6950 0.6 10.1* 42.627

1.5 13.8***

*: pure solution time, without including matrix factorization

**: total time (MPC construction + solution)

B. Nonlinear CSTR Example

To illustrate the performance of CDAL when the lin- ear MPC formulation (1) changes at runtime we consider the control of the CSTR system [40], described by the continuous-time nonlinear model

dCA

dt = CA,i− CA− k0e−EaRT CA dT

dt = Ti+ 0.3Tc− 1.3T + 11.92k0e−EaRT CA

y = CA

(14)

where CA is the concentration of reagent A, T is the temperature of the reactor, CA,i is the inlet feed stream concentration, which is assumed to have the constant value 10.0 kgmol/m3. The process disturbance comes from the inlet feed stream temperature Ti, which has slow fluctuations represented by Ti = 298.15 + 5 sin(0.05t) K. The manip- ulated variable is the coolant temperature Tc. The constants k0= 34930800 and EaR = −5963.6 (in MKS units).

The initial state of the reactor is at a low conversion rate, with CA = 8.57 kgmol/m3, T = 311 K. The control objective is to adjust the reactor state to a high reaction rate with CA= 2 kgmol/m3, which is a quite large condition. The MPC controller manipulates the coolant temperature Tc to track a concentration reference as well as reject the measured disturbance Ti. Due to its nonlinearity, the model in (14) is linearized online at each sampling step:

dx

dt ≈ f (xt, ut−1, p)+∂f

∂x x

t,ut−1,p

(x−xt)+∂f

∂u x

t,ut−1,p

(u−ut−1) where f (x, u, p) is the mapping defined in (14) for x = [CA T ]0, u = Tc, p = [CA,i Ti]0. By setting Ac =

∂f

∂x

x

t,ut−1,p

, Bc = ∂f∂u x

t,ut−1,p

, ec = f (xt, ut−1, p) −

(7)

0 20 40 60 80 100 120 140 160 180 200 time

0 2 4 6 8 10

Concentration

CA reference

0 20 40 60 80 100 120 140 160 180 200

time 280

300 320 340 360 380

Temperature

T Tc Ti

Fig. 2: Nonlinear CSTR closed-loop performance

Atxt− Btut−1, we get the following linearized continuous- time model

d

dtx = Acx + Bcu + ec

We use the forward Euler method with sampling time Ts= 0.5 minutes to obtain the following discrete-time model

xt+1= Adxt+ Bdut+ ed

where Ad = I + TsAc, Bd = TsBc, ed = Tsec. Although held constant over the prediction horizon, clearly matrices Ad, Bd and the offset term ed change at runtime, which makes the controller an LPV-MPC. Regarding the perfor- mance index, we choose weights Wy = 1, Wu = 0, W∆u = 0.1. The physical limitation of the coolant jacket is that its rate of change ∆Tc is subject to the constraint [−1, 1] K when considering the sampling time Ts = 0.5 minutes. The prediction horizon is T = 10 steps.

We compare again CDAL and OSQP in the LPV-MPC setting described above. CDAL is run with in = 10−6,

out = 10−4, ρ = 0.01, and Nout = Nin = 5000, which is a large number that we chose to optimize closed-loop performance at best. The tolerances used in OSQP are set to 10−6 to provide comparable closed-loop performance. The closed-loop simulation results of CDAL and OSQP almost coincide and are plotted in Figure 2, from which it can be seen that CA tracks the reference signal well, and the fluctuation of Ti is effectively suppressed.

The computational load and closed-loop performance as- sociated with CDAL and OSQP are reporeted in Table III.

It is apparent that CDAL leads to a slightly smaller cost and that, more important, a shorter execution time (both in the average and worst-case) than OSQP, due to the need of constructing the QP problem and factorizing the resulting matrices to use the latter method.

TABLE III: Computational performance of CDAL and OSQP solver

method inner iters outer iters time (ms) cost

avg max avg max avg max

CDAL 19 50 12 19 0.4 0.8 0.02202

OSQP - - 49 49 0.2 0.4* 0.02219

1.5 13.8***

*: solution time

**: MPC construction time + solution time

V. CONCLUSION

This paper has proposed a cyclic coordinate-descent method in the augmented Lagrangian method framework for solving linear (possibly parameter-varying) MPC problems.

We showed that the method is quite efficient and competing with other existing methods, thanks to the use of a reverse cyclic rule, Nesterov’s acceleration, and a simple heuristic preconditioner. Besides being easy to code, compared to many QP solution methods proposed in the literature CDAL avoids constructing the QP problem and factorizing the resulting matrices, which makes it particularly appealing for LPV-MPC problems. Future research will be devoted to extend the method to handle nonlinear MPC problems by solving a sequence of linearized MPC problem within each sampling period.

REFERENCES

[1] S. J. Qin and T. A. Badgwell, “A survey of industrial model predictive control technology,” Control engineering practice, vol. 11, no. 7, pp.

733–764, 2003.

[2] A. Bemporad, M. Morari, V. Dua, and E. N. Pistikopoulos, “The ex- plicit linear quadratic regulator for constrained systems,” Automatica, vol. 38, no. 1, pp. 3–20, 2002.

[3] D. Kouzoupis, G. Frison, A. Zanelli, and M. Diehl, “Recent advances in quadratic programming algorithms for nonlinear model predictive control,” Vietnam Journal of Mathematics, vol. 46, no. 4, pp. 863–882, 2018.

[4] Y. Wang and S. Boyd, “Fast model predictive control using online op- timization,” IEEE Transactions on control systems technology, vol. 18, no. 2, pp. 267–278, 2009.

[5] S. Wright, “Efficient convex optimization for linear MPC,” in Hand- book of Model Predictive Control. Springer, 2019, pp. 287–303.

[6] H. J. Ferreau, H. G. Bock, and M. Diehl, “An online active set strategy to overcome the limitations of explicit MPC,” International Journal of Robust and Nonlinear Control: IFAC-Affiliated Journal, vol. 18, no. 8, pp. 816–830, 2008.

[7] A. Bemporad, “A quadratic programming algorithm based on nonneg- ative least squares with applications to embedded model predictive control,” IEEE Transactions on Automatic Control, vol. 61, no. 4, pp.

1111–1116, 2016.

[8] P. Patrinos and A. Bemporad, “An accelerated dual gradient-projection algorithm for embedded linear model predictive control,” IEEE Trans- actions on Automatic Control, vol. 59, no. 1, pp. 18–33, 2013.

[9] S. Boyd, N. Parikh, and E. Chu, Distributed optimization and statisti- cal learning via the alternating direction method of multipliers. Now Publishers Inc, 2011.

[10] B. Stellato, G. Banjac, P. Goulart, A. Bemporad, and S. Boyd,

“OSQP: An operator splitting solver for quadratic programs,” Math- ematical Programming Computation, vol. 12, pp. 637–672, 2020, http://arxiv.org/abs/1711.08013, Code avaliable at https://github.com/

oxfordcontrol/osqp. Awarded best paper of the journal for year 2020.

[11] W. Li and J. Swetits, “A new algorithm for solving strictly convex quadratic programs,” SIAM Journal on Optimization, vol. 7, no. 3, pp.

595–619, 1997.

(8)

[12] B. Hermans, A. Themelis, and P. Patrinos, “QPALM: a newton-type proximal augmented lagrangian method for quadratic programs,” in 2019 IEEE 58th Conference on Decision and Control (CDC), 2019, pp. 4325–4330.

[13] A. Bemporad, “A numerically stable solver for positive semi-definite quadratic programs based on nonnegative least squares,” IEEE Trans- actions on Automatic Control, vol. 63, no. 2, pp. 525–531, 2018.

[14] N. Saraf and A. Bemporad, “A bounded-variable least-squares solver based on stable QR updates,” IEEE Transactions on Automatic Con- trol, vol. 65, no. 3, pp. 1242–1247, 2020.

[15] ——, “An efficient non-condensed approach for linear and nonlinear model predictive control with bounded variables,” arXiv e-prints, pp.

arXiv–1908, 2019.

[16] C.-J. Hsieh, K.-W. Chang, C.-J. Lin, S. S. Keerthi, and S. Sundararajan,

“A dual coordinate descent method for large-scale linear SVM,” in Proceedings of the 25th international conference on Machine learning, 2008, pp. 408–415.

[17] K.-W. Chang, C.-J. Hsieh, and C.-J. Lin, “Coordinate Descent Method for Large-scale L2-loss Linear Support Vector Machines.” Journal of Machine Learning Research, vol. 9, no. 7, 2008.

[18] P. Richt´arik and M. Tak´aˇc, “Distributed coordinate descent method for learning with big data,” The Journal of Machine Learning Research, vol. 17, no. 1, pp. 2657–2681, 2016.

[19] Y. Xu and W. Yin, “A block coordinate descent method for regularized multiconvex optimization with applications to nonnegative tensor factorization and completion,” SIAM Journal on imaging sciences, vol. 6, no. 3, pp. 1758–1789, 2013.

[20] Y. Nesterov, “Efficiency of coordinate descent methods on huge-scale optimization problems,” SIAM Journal on Optimization, vol. 22, no. 2, pp. 341–362, 2012.

[21] Y. T. Lee and A. Sidford, “Efficient accelerated coordinate descent methods and faster algorithms for solving linear systems,” in 2013 IEEE 54th Annual Symposium on Foundations of Computer Science.

IEEE, 2013, pp. 147–156.

[22] Z. Allen-Zhu, Z. Qu, P. Richt´arik, and Y. Yuan, “Even faster acceler- ated coordinate descent using non-uniform sampling,” in International Conference on Machine Learning. PMLR, 2016, pp. 1110–1119.

[23] D. Leventhal and A. S. Lewis, “Randomized methods for linear constraints: convergence rates and conditioning,” Mathematics of Op- erations Research, vol. 35, no. 3, pp. 641–654, 2010.

[24] S. Richter, C. N. Jones, and M. Morari, “Computational complexity certification for real-time MPC with input constraints based on the fast gradient method,” IEEE Transactions on Automatic Control, vol. 57, no. 6, pp. 1391–1403, 2011.

[25] V. Nedelcu, I. Necoara, and Q. Tran-Dinh, “Computational complex- ity of inexact gradient augmented Lagrangian methods: application to constrained MPC,” SIAM Journal on Control and Optimization, vol. 52, no. 5, pp. 3109–3134, 2014.

[26] M. K¨ogel and R. Findeisen, “Fast predictive control of linear systems combining Nesterov’s gradient method and the method of multipliers,”

in 2011 50th IEEE Conference on Decision and Control and European Control Conference. IEEE, 2011, pp. 501–506.

[27] Y. Nesterov, “A method of solving a convex programming prob- lem with convergence rate O(1/k2),” Soviet Mathematics Doklady, vol. 27, no. 2, pp. 372–376, 1983.

[28] B. He and X. Yuan, “On the acceleration of augmented Lagrangian method for linearly constrained optimization,” Optimization online, vol. 3, 2010.

[29] D. P. Bertsekas, “Nonlinear programming,” Journal of the Operational Research Society, vol. 48, no. 3, pp. 334–334, 1997.

[30] ——, Constrained optimization and Lagrange multiplier methods.

Academic press, 2014.

[31] Y. Nesterov, “Smooth minimization of non-smooth functions,” Math- ematical programming, vol. 103, no. 1, pp. 127–152, 2005.

[32] P. Amodio and F. Mazzia, “A parallel Gauss–Seidel method for block tridiagonal linear systems,” SIAM Journal on Scientific Computing, vol. 16, no. 6, pp. 1451–1461, 1995.

[33] D. G. Luenberger, “Linear and nonlinear programming Addison- Wesley,” Reading, MA, 1984.

[34] J. M. Ortega and W. C. Rheinboldt, Iterative solution of nonlinear equations in several variables. SIAM, 2000.

[35] Z.-Q. Luo and P. Tseng, “On the convergence of a matrix splitting algorithm for the symmetric monotone linear complementarity prob- lem,” SIAM Journal on Control and Optimization, vol. 29, no. 5, pp.

1037–1060, 1991.

[36] ——, “On the convergence of the coordinate descent method for convex differentiable minimization,” Journal of Optimization Theory and Applications, vol. 72, no. 1, pp. 7–35, 1992.

[37] A. Bemporad, M. Morari, and N. L. Ricker, “Model predictive control toolbox,” User’s Guide, Version, vol. 2, 2004.

[38] P. Kapasouris, M. Athans, and G. Stein, “Design of feedback control systems for stable plants with saturating actuators,” in Proc. 27th IEEE Conf. on Decision and Control, Austin, Texas, U.S.A., 1988, pp. 469–

479.

[39] A. Bemporad, A. Casavola, and E. Mosca, “Nonlinear control of constrained linear systems via predictive reference management,”

IEEE transactions on Automatic Control, vol. 42, no. 3, pp. 340–349, 1997.

[40] D. E. Seborg, D. A. Mellichamp, T. F. Edgar, and F. J. Doyle III, Process dynamics and control. John Wiley & Sons, 2010.

References

Related documents

O estudo possibilitou o grupamento dos elementos menores em duas classes de acordo com o comportamento geoquímico: Classe I - Elementos de mobilidade moderada-alta, caracterizando

Based on the experience of training the Australia dollar versus U.S dollar currency exchange rate data by using different network structures and different algorithms, we chose

(H1): As public isolation from economic decision making increases, working class voter participation will decrease. (H2) : As trade openness increases, working class

INSTITUTION NATIONAL 
 LIBER INTERNATIONAL OPEN SCIENCE OUTCOME OPEN SCIENCE OUTCOME DEVELOPMENT OF INDICATORS DORA 
 (San Francisco Declaration on Research

The corrosion resistance of the mild steel decreased in test solutions with seawater taken from sites in Muara Baru, Suramadu and Tol Mandara after up to 1 month of

this study has extended the knowledge of CPD specifically for Australian rural accountants by primarily exploring satisfaction levels relating to CPD provided and delivered by a local

Attached is the project paper titled “A STUDY ON PUBLIC ACCEPTANCE TOWARDS THE IMPLEMENTATION OF GST IN MALACCA” to fulfill the requirement needed by the

While many around the world have heard about the death, burial, and resurrection of Jesus and that He shed His blood on the cross to forgive us of our sins and by repenting of