A Legendre TechniqueforSolving Time-varying Linear Quadratic Optimal Control Problems by MOHSEN
RAZZAGHI
and GAMAL
ELNAGAR
Department of Mathematics and Statistics, Mississippi State, MS 39762, U.S.A.
Mississippi
State University,
ABSTRACT : A methodjtir the optimal control of linear time-varying systems with a quadratic cost jitnctional is proposed. The state and control variables are expanded in the shified Legendre series, and an algorithm is provided for approximating the system dynamics, boundary conditions and peyformance index. The necessary condition of optimality is then derived as a system of linear algebraic equations. Numerical examples are included to demonstrate the validitiy and applicability of the technique.
I. Introduction
Recently, orthogonal functions have received considerable attention in dealing with various problems of dynamic systems. The main characteristic of this technique is reducing these problems to solving systems of algebraic equations, thus greatly simplifying the problem solution. Typical examples are the Laguerre polynomials (l), shifted Chebyshev polynomials (2) shifted Legendre polynomials, (3, 4), and Fourier series (5). Among these orthogonal functions, the shifted Legendre is computationally more effective (4). This is due to : (i) the defining domain is finite ; (ii) the operational matrix of integration is tridiagonal; (iii) the weight function of orthogonality is unity; (iv) the convergence rate is rapid. The optimal control of a linear system with a quadratic performance index has been of considerable concern and is well covered in many textbooks (6, 7). The approach is a variational method which usually requires the solution of a twopoint boundary value problem whose exact solution (except in very special cases) is difficult to obtain. In contrast to variational methods, trajectory parameterization techniques approximate the control and/or state vectors by functions with unknown coefficients, and hence convert an optimal control problem into a mathematical programming problem. In 1968, Vlassenbroeck and Van Dooren (8) expanded the state and control variables in Chebyshev series to solve optimal control problems. Later Yen and Naguraka (9) proposed a Fourier-based approach for solving linear quadratic
The FranklinInstitute 001&0032r93 $6.00+0.00
453
optimal control problems by expanding the state vector only. Their approach is to approximate each of the state variables by the sum of a third-order polynomial and a finite term Fourier-type series. The present paper is based upon the expansion of each state variable in the shifted Legendre polynomial with unknown coefficients. These coefficients are determined in such a way that the necessary conditions for extremization are imposed. Illustrative examples are given to demonstrate the applicability of the proposed method.
It. Properties
of Shifted Legendre Polynomiats
The Legendre
polynomials
which are orthogonal
in the interval
[ - 1, 1] are (LO)
(1) with
L,(x) = 1,
(24
L,(x)
(2b)
= x.
In order to use these polynomials on the interval [0, h], we use shifted Legendre polynomials P,(t) by introducing the change of variables x = 2(t/h) - 1 in (1) and (2a, b). The orthogonal property is given by
s Ii
0
Pt(W’,(O df =
A function,f(t), which is absolutely integrable in terms of a shifted Legendre series as
(3)
within 0 < t < h may be expressed
(4) where (4a) If Eq. (4) is truncated
up to its first r terms, then I_ I .f(f> = ,pw = .f”fYo
(5)
where
f’=
Mb?.f~>.~‘~.Lll>
p’(t) = [p”(t)% P, tq,. 454
(6)
, p, I(f)l
(7) Journal
ol’thc FrankIm lnsutute Pergamon Pm\ Ltd
Time-vurying 2.1. D$erentiation We assume that the derivative
Linear Quadratic
off(t)
Optimal Control Problems
in Eq. (4) may be described
by
.i‘(t) = F .&P,(t).
(8)
,=O
The relationship between the coefficients& the following recurrence formula : i.e. P,(t) =
using
ltr>l.
2~~l~[pi+l(tl-pi
Using (9), Eq. (8) can be written
=
in (4) andg, in (8) will be obtained
as
_si-L
_ -!k_ 2(2i+3)
(10)
1
j;(t).
Thus. we obtain h[(2i+ 3)g,_, - (2i-
l)g,+ ,] -2(2i-
1)(2i+ 3)f; = 0,
2.2. Product of shifted Legendre polynomials The product of two shifted Legendre polynomials mated by (11)
i = 1,2, . .
(11)
P,(t) and pi(t) can be approxi-
I- I Pi(t)P,(t)
= C
YijtlPnCt).
(12)
?I=0
By using the orthogonality be computed from
property
(3), the shifted Legendre
P, (t)J’, (tV’,(t) dt.
coefficients
ylln may
(13)
Let
s h
9 rp
=
f’t(t)P;(W’n(t) dt.
(14)
0
Then (12) becomes P,(t)P,(t)
=
e$Jy,=o g,,,P,(t).
(15)
455
M. Razzaghi
and G. Elnapr
III. Problem Statement Consider
the following
linear system -i-(t) = A(Qx(t) +B(t)u(t)
with known and control dimensions. u(t) and the minimizing
(16)
initial condition x(0) = xc,, where x(t) and u(t) are n x 1 and q x 1 state vectors, respectively, and A(t) and B(t) are matrices of appropriate It is assumed that y1= q. The problem is to find the optimal control corresponding state trajectory x(t), 0 G t d h, satisfying Eq. (16) while the quadratic cost functional J = fx’(h)Sx(h)
+ ;
’ [x’(t)Q(t)x(t) s0
+u’(t)R(t)u(t)]
dt
(17)
where T denotes transposition, S, Q(t) and R(t) are matrices of appropriate dimensions, S and Q(t) are symmetric positive semi-definite matrices and R(r) is a symmetric positive definite matrix.
IV. The Performance
Index Approximation
By expanding each state vector and each control vector in shifted Legendre series of order r, we determine the following approximate solutions, i.e. for N=O,l,...,n-1 I-
xN(t)=
I
c aNiPitt)
(18)
IO I
I-
UN(t)
1
=
bN~~i(t)
(19)
I=0
where (aN”,aN,, Let
CI =
. . . , aNcr- ,,) and (hNO, bNI, . . , b,,,
(a,,a,,
. ,a,-
ho ;
,)’ =
a(),
(a(,- I)0
a(,-
. . .
I)1
bo,
(boo
/3 = (b,, b,, . . , b,_ ,)~r =
,J are unknown.
.
‘.
. . .
aocr-I)lT Q,,-
I)+
hoc,
,jo
b,,- I),
.
(20)
”
(21)
I)lT dT
;
i (bcp
>
b,,- ,)(r- d’-
and
P(t)
= [;
Note that CI,p and p(t) are matrices 456
.f.
,::,,).
(22)
of order nr x 1, nr x 1 and y1x nr, respectively. Journal of the Franklin lnstitutc Pergamon Press Ltd
Time-varying Linear Quadratic Optimal Control Problems Then using Eqs (18) and (19) the state and control
vector can be expressed
as
x(t) = c x,P,(t) = P(t)a i= 0 I- I u(t) = c u,Pt(t) = P(t)/3 i=o
(23)
(24)
where X; =
Lao,,
ali,
a(,-
. . . ,
(254
~jil~,
u, = [bo,,b,,, . . ,b,n- ~1~. We now show that the performance unknown a and p. Let
(25b)
index J can be expressed
as a function
of the
J = J, +Jz where J, is the cost associated
(26)
with the terminal
state
J, = :xT(h)Sx(h) and J, is the cost associated J2 =; substituting
(27a)
with the trajectory h [xT(t)Q(t)x(t)+uT(t)R(t)u(t)] s0
G’7b)
(23) and (24) in (26) we get
J = ~aT~T(h)S&z)a+
$CX’
p’(t)Q(t)P(t)dt
1 + cx
ip’
Equation
dt
(28) can be computed
h
P’(t)P(t)
1
dt p.
(28)
by writing J as
more efficiently
J = ;aT[PT(h)P(h) 0 S]a+ :CX’ [S
PT(t)R(t)p(t)
1
@ Q(t) dt c(
0
+
:p’
P’(t)P(t)
1
0 R(t) dt /I. (29)
In Eq. (29), @ denotes the Kronecker product (12). If R(t) and Q(t) are functions of time then J2 in (29) can be evaluated numerically. For time invariant, J2 can be calculated as J> = $‘@I
@ Q)a+$‘(D
@ R)/l
(30)
where Vol. 330. No. 3. pp. 453463. Prmted ,n Great Fmtam
1993
457
M. Razzaghi
and G. Elmagav
I) V. Approximation
of the Time-varying
(31)
System
The time varying coefficient matrices A(r) and B(t) and the product functions A(t)x(t) and B(t)u(t) can be expanded into shifted Legendre series, as in (11) I-
I
A(t) = 1 A;P,(O
(32)
/= 0 rm I B(r) = 1 &P;(f) ,=O r- I A(f)x(t) = 1 Y,P,(r) ,=U B(t)u(t) where A, and B, are n x n constant
(33)
(34)
= y ZjP,(Z) i= 0
matrices
(35)
and (36)
(37) By expanding the derivative of each of the IZstate vectors in Eq. (16) by shifted Legendre series, we get r-2 .&=,;OC,\P,(~), N=O,l,..., n-l. (38) Using (34) and (35) for each N, the right-hand side of Eq. (16) has the form r-1 ,z, (4’h’i+z,V,)P,(0 which is a polynomial of degree Y- 1, while the left-hand degree v-2. By equating the coefficients of same-order nomials, we obtain XV,+ Z.V, = Equations
,) - (2ii=
side is a polynomial of shifted Legendre poly-
i=O,l,...,r-2 (40)
i>r-1
(1 l), (18) and (40) give the following
P I_ I = h[(2i+3)C,+
4.58
C,, 0
(39)
l)C,,,+
1,2,...,v-1
relationship
,,I -2(2i-
1)(2i+ 3)~,~, = 0, (41)
Time-varying
E
Linear Quadratic Optimal Control Problems
, = (2i+3)C,~,+,,-(2i-l)C,,,,+,,
= 0,
for
i>
r,
(424
with C,Y(F I) = CA+) = 0.
(42b)
Using Eq. (1 S), the initial condition x(0) = x,,, can be replaced I_ I r- I F,= ~aNIP,(0)= c (-l)‘~,~,=x,~(O), N=O,l,..., i= 0 r-0
VI. The Shifted Legendve Coeflcients
fop x(t)
by n-l.
(43)
and u(t)
The optimal control problem has been reduced to a parameter optimization problem which can be stated as follows : find !Xand p so that J(cc, /I) is minimal, or maximal subject to the constraints in Eqs (41)-(43). The method proposed by Lagrange is applied by appending the constraints to the performance index by means of Lagrange multipliers. Let L(G P) = J(a, B) + i
V’, (2, P)
(44)
j=O
where 2 = (I.,, 3., , . , A,) represents necessary conditions for stationarity dL p=o, au,
the unknown are given by
;;
=O,
,r-1
equations
multipliers,
then the
(454
.i= O,l, >r.
F, = 0,
Hence the determining
i=O,l,
I
Lagrange
(45b)
are : .r-
1
(46)
(47) F, = 0,
VII. Illustrative
j = 0, I,
, r.
(48)
0 d t < 1
(49a)
Examples
Example
1 Consider the linear system dx dt
= -x(t)+u(t),
x(0) = 1
(49b)
with the cost functional Voi
330, ho. 3. pjc 453463.
Prmtrd
in Grcdt Br~tan
1993
459
M. Razzaghi and G. Elnagar
s I
(50)
(x'(t)+u'(t))dt.
0
The problem is to find the optimal control u(t) which minimizes (50) subject to the constraints of Eq. (49a,b). This example was considered by (8); our method differs from their approach and thus the example could be used as a basis for comparison. We first determine analytically the shifted Legendre polynomial approximation of order r = 4, the unknown coefficients c( = (a,, a,, a*, a3) and /I = (ho, b,, b?, b3) must satisfy the constraints F. = 5(b,-a,)-(b,-a,)-lOa,
= 0,
F, = 7(b,-a,)-3(b,-a,)-42a2 F2 = 9(b2 -a?)
- 9Oa, = 0,
F, = ll(b3-a3) F4 = ao--a,
Using (30) we obtain
= 0,
= 0,
+a2-a,-1
the following
= 0.
approximation
(51)
for J (52)
Equations (46)-(48) obtained, i.e.
give 13 equations
from which the following
x(t) = i: a,p,(t)
solution
can be
(53)
1=0
where a0 = 0.5519245319,
a, = -0.3475908004
a1 = 0.0878156045,
a3 = -0.0113349248
and hip,(t)
u(t) = i
(54)
I=0
where
The numerical
ho = -0.1661059340,
b, = 0.1867706106
b, = -0.0264287206,
b3 = 0.0060899038.
values for A,, i = 0, 1,. . . ,4 are i., = 0.0332180436, i2 = 0.0042511041,
i, = -0.0088833204, A, = -0.0022743721,
A4 = -0.3858632112, 460
Journal
of the FrankIm Institute Pergamon Press Ltd
Time-varying Linear Quadratic Optimal Control Problems
and J = 0.19290921. Since the convexity conditions are satisfied (S), the shifted Legendre approximation offers at least a local minimum. A comparison between the shifted Legendre approximation with r = 4 and the exact solution for J shows that an agreement of seven decimal figures is obtained. Higher-order approximations have been computed on a Sun Spare Station using Mathematics. In Table 1 a comparison is made between the values of J using the present method and the method in (8) together with the exact solution. Note that the number of terms in the Chebyshev approximation series is (m + 1) which is equal to the number of terms in the shifted Legendre series approximation (r), hence m = r - 1. Example 2 Consider the linear time-varying i(t)
system 0 < t < 1
= tx(t)+u(t),
x(0) = 1
(55a) (55b)
with the cost functional J = ;
’(x’(t)
+u’(t))
dt.
s0
The problem is to find the optimal control u(t) which minimizes Eq. (56) subject to the constraints of (55a,b).-The optimal control u(t) is given by (5) u(t) = -w(t)x(t) where w(t) is the solution
(57)
of the Riccati equation G(t) = -2tw+w2-
1,
w(1) = 0.
(58)
By using the method in Section V, the Riccati equation is solved. Table II gives the computational results for m = 4, m = 6 and m = 9 together with the numerical solution of w(t). The result is quite satisfactory even form = 4. TABLE I
Shifted Legendre
Chebyshev
m
(Present)
(Vlassenbroeck and Van Dooren)
3 5 9
0.19290921 0.1929092980 0.192909298 1
0.192931 0.1929094 0.192909298 1
Exact solution Vol. 330, No. 3, pp. 453463, Prmted in Great Britain
for J: 0.192909298 1
1993
461
M. Razzaghi
and G. Elnugar TABLE II
Comparison
of shifted Legendre series solution and solution of Riccati equation
t 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
m=4
m=6
m=9
0.9719 0.9507 0.9089 0.8434 0.7532 0.6401 0.5097 0.3711 0.2345 0.1090 0.0093
0.9687 0.95 14 0.9107 0.8442 0.7524 0.6386 0.5087 0.3712 0.2354 0.1095 0.0000
0.9688 0.9517 0.9109 0.8444 0.7525 0.6387 0.5088 0.3713 0.2354 0.1095 0.0000
Numerical 0.9689 0.9518 0.9109 0.8444 0.7526 0.6387 0.5088 0.3713 0.2354 0.1095 0.0000
VIII. Conclusions The aim of the present work is the determination of the optimal control and state vectors by a direct method of solution based upon shifted Legendre series expansions. The method is based upon reducing a linear quadratic optimization problem to a set of linear equations. The unity of the weight function of orthogonality for shifted Legendre series and the simplicity of the approximated performance index are merits that make the approach very attractive. Moreover, only a small number of shifted Legendre series is needed to obtain a very satisfactory solution. The given numerical examples supports this claim.
References (1) P. R. Clement, “Laguerre functions in signal analysis and parameter identification”, J. Franklin Inst., Vol. 313, pp. 85-95, 1982. (2) M. Razzaghi and M. Razzaghi, “Solution of linear two-point boundary problems and optimal control of time varying systems by shifted Chebyshev approximation”, J. Franklin Inst., Vol. 327, pp. 85595, 1990. (3) D. H. Shih and F. C. Kung, “The shifted Legendre approach to non-linear system analysis and identification”, ht. J. Control, Vol. 42, pp. 1399-1410, 1985. (4) J. H. Chou, “Application of Legendre series to the optimal control of integrodifferential equations”, In?. J. Control, Vol. 45, pp. 269-277, 1987. (5) M. Razzaghi, “Optimal control of linear time varying systems via Fourier series”, J. Optimization Theory Appl., Vol. 65, pp. 375-384, 1990. (6) M. Athans and P. L. Falb, “Optimal Control : An Introduction to the Theory and its Applications”, McGraw-Hill, New York, 1966. (7) A. P. Sage and C. C. White, “Optimal Systems Control”, Prentice-Hall, Englewood Cliffs, NJ, 1977. (8) J. Vlassenbroeck and R. Van Dooren, “A Chebyshev technique for solving nonlinear optimal control problems”, IEEE Trans. Autom. Control, Vol. 33, pp. 3333340, 1988. Journal
462
of the Frankhn lnst~tute Pergemon Press Lid
Time-varying
Linear Quadratic
Optimal Control Prohlems
(9) V. Yen and M. Naguraka, “Linear quadratic optimal control via Fourier-based parameterization”, Trans. ASME, Vol. 113, pp. 206215, 1991.
state
(10) C. Canuto, M. Y. Hussaini, A. Quarteroni and T. A. Zang, “Spectral Methods in Fluid Dynamics”, Springer Verlag, New York, 1988. (11) C. Hwang and M. Y. Chen. “Analysis of optimal control of time-varying linear systems via shifted Legendre polynomials”, ht. J. Control, Vol. 4, pp. 1317-1330, 1985. (12) P. Lancaster, “Theory of Matrices”, Academic Press, New York, 1969. Received : 10 September Accepted : 17 November
Vol. 330, No. 3, pp. 453463, Prmted m Great Britain
1992 1992
I993
463