a technique for expanding the matrix riccati equation

10
Comput. & Elect. Engng, Vol. 3, pp. 193-202. Pergamon Press 1976. Printed in Great Britain A TECHNIQUE FOR EXPANDING THE MATRIX RICCATI EQUATION C. F. CHEN and L. S. SmEH University ofHouston, Houston, TX 77004U.S.A. (Received 8 July 1975) 1. INTRODUCTION It is well known[I-4] that optimizing the linear plant Y~ = Ax + Bu (1) for a quadratic performance index lff j = 2 (~rq~ + ~ r~/)dt (2) where Q and R are symmetric matrices, we obtain the following optimal control law: u*(t) = - g-'B ~(t) (3) where ~(t) is the vector related to x(t) by A -C in which C = BR-~B r , . = = subject to the boundary conditions: (o) = 4o (5) ~(®)=0 (6) Solving (4) and then substituting the result into (3), the optimal control will be found. An alternative consideration is to use the following linear transformation: dp = Px. (7) Substituting (7) into (4), we arrive at = PBR-'B rp _ (PA + A Tip) _ (~ (8) which is called the matrix Riccati Equation. Solving for P and then substituting it into (3)-(7), we will obtain the same control law, of course. 2. DIFFICULTIES IN OBTAINING SOLUTIONS In solving (8) if the dimension of the equation is high, to expand it into a set of simultaneous differential equations is by no means an easy task. Considering the difficulties involved in it, many pioneers use (4) directly. MacFarlane[5] and Potter[6] use the eigenvector solution, while Vaughan [7] offers a negative exponential solution. Fath [8] establishes a procedure which involves a particular decoupling matrix, etc. 193

Upload: cf-chen

Post on 25-Aug-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A technique for expanding the matrix Riccati equation

Comput. & Elect. Engng, Vol. 3, pp. 193-202. Pergamon Press 1976. Printed in Great Britain

A T E C H N I Q U E FOR E X P A N D I N G THE MATRIX RICCATI E Q U A T I O N

C. F. CHEN and L. S. SmEH

University of Houston, Houston, TX 77004 U.S.A.

(Received 8 July 1975)

1. INTRODUCTION It is well known[I-4] that optimizing the linear plant

Y~ = A x + B u (1)

for a quadratic performance index

lff j = 2 (~rq~ + ~ r~/ )d t (2)

where Q and R are symmetric matrices, we obtain the following optimal control law:

u*(t) = - g- 'B ~ ( t ) (3)

where ~(t) is the vector related to x(t) by

A - C

in which C = B R - ~ B r , . = = subject to the boundary conditions:

(o) = 4o (5)

~(®)=0 (6)

Solving (4) and then substituting the result into (3), the optimal control will be found. An alternative consideration is to use the following linear transformation:

dp = Px. (7)

Substituting (7) into (4), we arrive at

= P B R - ' B r p _ ( P A + A Tip) _ (~ (8)

which is called the matrix Riccati Equation. Solving for P and then substituting it into (3)-(7), we will obtain the same control law, of course.

2. DIFFICULTIES IN OBTAINING SOLUTIONS

In solving (8) if the dimension of the equation is high, to expand it into a set of simultaneous differential equations is by no means an easy task. Considering the difficulties involved in it, many pioneers use (4) directly. MacFarlane[5] and Potter[6] use the eigenvector solution, while Vaughan [7] offers a negative exponential solution. Fath [8] establishes a procedure which involves a particular decoupling matrix, etc.

193

Page 2: A technique for expanding the matrix Riccati equation

194 c.F. CHEN and L. S. SH1EH

The technique established in this paper is to obtain a set of simultaneous component equations of (8) by a digital computer with the original symbols preserved.

3. STATEMENT OF THE EXPANSION PROBLEM

In the matrix Riccati Equation (8), the matrices ~ , ~, Q and ~_ are constant matrices; dimensionally they are n × n, n × m, n × n and m × m matrices respectively; .P is an n × n matrix. Also, P, Q and ~ are symmetrical matrices.

Let us regroup eqn (8) first,

p = ( P B R - , B T p ) _ ( p 3 + ~ T p ) . (8a)

Because B and R are given, we simplify (8a) again

/~ = ( P C P ) - ( P A + A r p ) _ (8b)

where

C = BR-IB r (9)

as we defined before. C is still an n x n symmetrical matrix. "Then arrange the elements of P into a vector p" such that

/~ = [P11, Pl2, P13 . . . . Pl , , P22, P23 . . . . P~-I.,, Pn,] r

Also, organize another vector /~ to express the quadratic elements

zt p = [PI1PII, PIIPI2 . . . . P I lP I . . . . P I I P , m , PI2P12,

P I2P I3 . . . . . P lzP l . . . . . P I2P . . . . . . . P (n -1 ) .

p(._,).,p(~ , . p ~ . , p . . p . . ] r .

For matrix ~, we arrange it into a vector such that

= [Q,,, Q,2, Q , . . . . . Q,,, Q2:, Q23 . . . . Q(,-l),, Q,, ]T.

It is desired to change the matrix Ricatti Equation (8b) into the following set of simultaneous component differential equations

(lO)

The problem is to find 11 and a. The dimension of t h e v e c t o r ~ or f i is n(n + 1)/2 and that of/~ is [n(n + 1)(n z + n + 2)/8] • a. is

an [n(n + 1)/2] x [n(n + 1)/2] square matrix while ~ is a rectangular matrix with dimensions

n ( n + l ) n ( n + l ) ( n 2 + n + 2 ) ~ X 2 8

4. SIMPLE EXAMPLE FOR THE EXPANSION

To illustrate the notations in (10), we give a simple example as follows: We rewrite (8)

= PCP - (PA + A rp ) _ Q. (8a)

Page 3: A technique for expanding the matrix Riccati equation

A technique for expanding the matrix Riccati Equation

Consider that the order of the equation is two. The equation becomes

195

[P,, P,21=[P,, P,qrc,, c,q[P,, p,q Pn P22J kPn P22J kCn C=JLP,2 P22J

_lIP,, P,21[A,, A,,I+[A,, A~,I[P,, P,21~_[Q,, [LP,2 P n J t A 2 , A22J LA,2 A22JLP,2 P=JJ LOn

Q'~I Q=J"

(.)

Expanding (11), and arranging it into component equations, we have

[ PI~ FC,I 2C,2 0 C22 0 O" " P , ,P , , I P..,21= l 0 C,, C12 C21 C22 0 P,,P,2I P22J Lo o o C . 2C12 C22 P.P221

Pt2Pl2 I PI2P22 [

_P22P22 [

[2A. 2A21 - /A,2 A |1+ A22

Lo 2A,2

o l [i'"l [Q"l A2, / /P ,Q - / o , q . 2A22J, LP22J, LO2d

(12)

In this example

L0[C" 2C,2 0 C22 0 °° 1 9=10 C,, C,2 C2, C22

0 0 C . 2Ct2 C2 (13)

and

r2A, 2A2, 0 1 = | A n A,+A22 A21 /

LO 2A ~2 2A22J (14)

The example is the simplest problem of its kind because the dimension is two. Even so, we can see the complication of its .1) and its q. When the dimension increases to a higher order, to find the .0 and a matrices is extrehaely difficult.

This paper attempts to establish two sets of rules for writing fl and a.: Of course, they must constitute a computer oriented procedure.

5. RULES FOR FINDING a

In eqn (10), we defined q as an n(n + 1)/2 square marx. This matrix coincides with the Liaptmov function matrix. In a previous paper[10], an algorithm was developed for expanding the Liapunov matrix. After slight modification, that algorithm can be directly used for finding q.

We use (K, L) and (/, J) as the row and column subscripted indices respectively. The following formula should be followed when forming the a matrix directly from the A matrix.

(1) if K= I, L # J, --, A(L, J) if K # L L = L --,A (K, I)

(2) i f K ~ L L # J ,

f K=J, L # I ~ A ( L , I) K#J, L = I ~A(K, J) K # J , L # I ~ 0

(3) ifK = I , L = J K = J, L = I ~ A ( K , I ) K S K, L ~ I---~ A ( K , I ) + A(L , J )

Page 4: A technique for expanding the matrix Riccati equation

196 c.F. CHEN and L. S. SINE.

(4) After the first three steps have been considered if I = J all elements at row I should be multiplied by 2.

If the A is a 3 x 3 matrix following the rules shown above, we will have a as follows:

K - L

1 - 1 1 - 2 1 - 3 2 - 2 2 - 3 3 - 3

I - J 1 - 1 2A.- 2A2, 2A31 0 0 0 1 - 2 A12 Al, + A22 A~2 A2, A~, 0 1-3 A13 A23 A~, + A . 0 A2, A31 2 - 2 0 2A,2 0 2A22 2A32 0 2 - 3 0 A,: Al2 A23 A22+ A33 A32 3 - 3 0 0 2A,3 0 2A_,~ 2A,~

where A0 are defined by

FA,, A12 A,31 =[A2, A22 A~, i

A LA,, A32 A33J"

Here the subscripted index K - L and I - J are the comparing indices. Each element in the table can be directly written by inspection. For Example, if we want to find the element Z

K - L I - J Z = ?

w e examine (1) If K =I, L # J, then Z = A ( L , J ) (2) if K # I, L # J, and K # J, L # I, then Z = 0.

6. RULES FOR FINDING II =

Matrix 1) can be found in a similar way; however, because ~ is a much higher dimension vector, the 'rules for finding .fl are lengthier than those for finding a.

Examine (10) again; we only consider the first term of the right:hand side this time. For convenience and clarity, we write the elements of /~ horizontally and still write :

vertically. Namely, the arrangement is as follows

P.PH PimPle P I I P t 3 . . . . .

Pt2 Pl3

Then we write the subscripts symbolically

P ( K , L ) P ( M , N ) [~(I, J) Y = ?

The value of Y is found by two steps. (1) Organize a subindices matrix

Page 5: A technique for expanding the matrix Riccati equation

A technique for expanding the matrix Riccati Equation

first by following the rules indicated below:

(i) if I= K, Then a = L

I=L, a = K

I = M b = N

I = N b = M

if J = K , Then c = L

J = L c = K

J = M d = N

J = N d = M

197

(ii) if I # K , I # L Then a = 0

I # M, I # L b = 0

if J# K, J# L, c = 0

J#M , J # N , d=0.

The element Y is found by

Y = C(a, d)+ C(b, c)

subject to the following two conditions: (i) if a, b, c or d equal to zero, the corresponding C term is equal to zero. (ii) i f K = M , L = N

Then y = C(a, d)+ C(b, c)

2

How to use these rules can be illustrated by the following 3 × 3 example.

(X -LXM-N)

P,,P,, P.Pn P.P,, P.P= P,,P~ P . P . PnP. PnP. PaPn PnP~ PoP. P,~P,, P.Pn P,~P~ P,sP. PaP= P ~ n PnP3, P~P~ P~P. P,3P.

P . C. 2Cn 2C. Ca 2Cn C.

P . C. Cn C. C,: C,, Cn C. Cn C.

P,, C,, Cu C,, C.~ C~ C~ C,, Cn C. l-J

Jsn C. 2C. 2C. Cn 2C. C.

Pn C. C. C. Cn C. Cn Cn Cn C.

P,, C. 2Cn 2C. C. 2C~ C,,

7. COMPUTER PROGRAM

Based on the rules for finding the component equations, a computer program has been written.

The part of the expansion of the PA + A Tp matrix is written as a subroutine called SUBROUTINE PA.

The part of the expansion of PCP is written as a subroutine called SUBROUTINE PRP. The main program is to use the Runge Kutta four step formula to carry out of the evaluation

of P. Of course,the negative time increment is used. When the steady state values of the components of P. vector have been reached, we use only those values to substitute into eqn (3) and (7). The optimal gains are obtained.

Page 6: A technique for expanding the matrix Riccati equation

198 C.F. CHEN and L. S. SHIEH

The details of preparing the input cards can be summarized as follows

N--dimension of x M--dimension of R

NM--points of solutions of Runge Kutta Program TN--starting time

DELT--time increment (negative values should be used)

Then the following cards are the row elements of matrices A, B, Q, R. The last card is for PIN which means the initial values of the Runge Kutta Program,'or ' the t~nal values of ~b@).

z

8. ILLUSTRATIVE EXAMPLES

For the given plant

and for the quadratic performance index

J = ~ f o ~(xr[20 02 ]x+ur (~ )u ) dt

the input data cards read

N = 2, M = 1, N N = 100, TN = 0, DELT = -0.05.

The P matrix is found from the computer output

P=I I] When the order of the plant is higher, we can see the advantages of using the program. The following example will demonstrate the point.

A plant is given as follows

O 0 0 1 0 A = o o l S =

0 0 0 0 0 0

Following Fuller [11], we formulate the plant matrices A and B as shown. As far as the state feedback design problems are concerned, the example form is a very general one. Then we

assigned the constants of Q and R as follows:

10 0 0 0 0 0 0.1 0 0 0

0 = 0 0.0l 0 0 : 0 0 0.001 0

0 0 0 0.0001

R = I PIN = null matrix 5 x 5.

The input card should be punched as follows

N = 5, M = 1, N N = 200, TN = 0, DELT = - 0.05.

Page 7: A technique for expanding the matrix Riccati equation

A technique for expanding the matrix Riccati Equation 199

The result obtained is:

3.219 5.152 5.128 3.185 0.996 1 11.592 13.482 9.338 3.218

P = 17.597 13.463 5.176 11.497 5.168 |

[_ (Symmetry) 3.209 .]

CONCLUSIONS

A new technique for expanding the matrix Riccati equation is established: From the given equation of the problem, groups of rules are formulated and based on these rules a computer program is written. It makes various well known numerical methods directly applicable to the problem.

REFERENCES I. K. E. Kalman, Contribution to the theory of optimal control. Bol. Soc. Math. Mexicana 5, 102-119 0960). 2. M. Athans and P. L. Falb, Optimal Control, pp. 756-793. McGraw-Hill, New York 0966). 3. A. P. Sage, Optimum Systems Control, pp. 244-254. Prentice Hall, New Jersey (1968). 4. L. S. Pontryagin, V. G. Doltyanskii, R. V. Gankrelidze and E. F. Mishchenko, The Mathematical Theory of Optimal

Processes. Interscience, New York (1962). 5. A. G. J. MacFarlane, An eigenvector solution to the optimal linear regulator problem. J. Electron. Control 14 (6), 643-654

(June 1963). 6. J. E. Potter, Matrix quadratic solution, SIAM J. Appl. Math. 14 (3), 496-501 (May 1966). 7. D. R. Vaughan, A negative exponential solution for the linear optimal regulator problems. Peprint of JACC, 717-725

(June 1968). 8. A. F. Fath, Computational aspects of the linear optimal regulator problem. Preprint of JACC, 44-49 (Aug. 1969). 9. F.T. Man, The Davidon method of solution of the algebraic matrix Riccati Equation, Int..I. Control 10 (6), 713-719 (Dec.

1~9). 10. C. F. Chert and L. S. Shieh, A note on expanding PA + A rp = _ Q, IEEE Trans. Aurora. Control AC-13 (1), 122-123

(Feb. 1968). i I. A.T. Fuller, In-the-large stability of relay and saturating systems with linear controllers. Int. J. Control 10 (4) (Oct. 1969). 12. C. F. Chen and I. J. Haas, Elements of Control Systems Analysis. Prentice Hall, Englewood Cliffs, N.J. (1968).

2PIN[IO, IO),PP2(551,D(IO,IO),E(IO,IO) I000 READ(5,500I N,M, NN,TN,OELT 500 FORMAT(315,2FIO.3)

WRITE(6,600) N,M,NN,TN,DELT 600 FORMAT(4HN...,13,6Ft M...,13,TH NN...,13,?H

19H DELT...,FI6.6) WRITE {6,610)

610 FORMAT(//22HA...N~N SYSTEM MATRIX/} DO 10 I=I ,N READ{5~510) (A( I ,J) ,J=I ,N)

i0 WRITE(6,631) {A{ I ,J) ,J=I ,N) 510 FORMAT(4F20.6)

WRITE(6,611) 611FORHAT( / / 21HB. . .N~H INPUT MATRIX/)

DO I I I=I ,N READ(5,SIO) (B( I ,J I ,J=I ,M)

11 WRITE(6,631) (8(I,JItJ=lTM) WRITE(6,612)

612 FORHAT(//25HQ...N~N SYMMETRIC MATRIX/) DO L2 I : I , N R'EADtSySIO) {O|I ,J) ,J=I tN)

12 .WRITE(6,631) (Q(I ,J),J=I,N) WRITE(6,613}

613 FORMAT(//ZSHR...M*M SYMMETRIC MATRIX/) DO I3 I=I,M READ(5,SIO) (R(I,J)~J=I,M)

13 WRITE(6,631) (R{I,J)~J=I,M} WRITE(6,614)

614 FORMAT(//35HPIN...N*N INITIAL SYMMETRIC MATRIX/) DO 14 l : l , N READ(5,510I (PIN(I ,J) ,J=I,N)

14 WRITE(6,631) |PIN(I ,J) ,J=l tN)

SOLUTION TO RICCATI EQUATIONS P(DOT)=-P~A-A(TRANSPOSE)*P-C+PeB*R(INVERSEI*B{TRANSPOSE),p N*N DIMENSION OF A OR Q OR P OR PIN MATRIX N*M DIMENSION OF B MATRIXs M*M DIMENSION OF R MATRIX NN... NO. OF PLOT POINTS. TN... STARTING TIME

MAIN PROGRAM BEGINS HERE DIMENSION PN(55),PI55),QQ(55,5),PDOT(55),A(LO, LO),B(10,IO)~

IR(IO,IO),QIIO,lO),PP(55),C|IO,IO)~PPI(55),QQQ(55),RR(LOtIO)s

TN...,FI6.6~

Page 8: A technique for expanding the matrix Riccati equation

200 C. F. CHEN and L. S. SHIEH

NR=N* {N÷ i ) 12 LL=O DO 20 K=I,N DO 20 J=K,N LL=LL+I PN(LL }=PIN(K, J )

20 QQQILL)=Q(K,J) IF: (M.GT.I) GO TO 21 R I I , 1 } = I . / R { I , I ) GO TO 22

21 CALL INVER ( R p M , R R , 0 , D E T ) 22 CALL N A L T P ( N , ~ B j M t RIC)

DO [ 5 0 K=I,~N DO 150 J=l,.4

1.50 E(J,K)=~3(K,J) CALL NALTP(N, M,C,N~. E, D} NNP=O DO 30 I = [ , N R

30 PD01"{ I)=O. W R I T E ( 6 , G 3 0 )

630 FQR;4AT{ /gX, IHT~ 12X, 2HP I ~ f I X , 2HP2, I I X , 2 H P 3 , l l X ~ 2HP4, I IX ,ZHPS, i IX , 1 2 H P 6 , 1 1 X p 2 H P 7 ) WRITE{6,631 ) TN,{PN(1), I=I,NR)

631 FOR~'.!AT ( 1X, 9E 13.5 ) I L=I

T:TN DO 40 K : I , N R

40 P(K)=PN(K} GO TO I 01

tO0 DO 50 K=I,NR 50 Q Q ( K , L ) = O E L T * P D O T ( K )

T=TN+DELT /2 . DO 60 K : I , N R

60 P( K }=PN(K J+QQ|K~ L } / 2 . L=2 GO TO I01

200 DO 70 K=I,NR 70 QQ (K, L) =OELTC, PDOT (K)

T=TN+DELT/2. DO 80 K = I , N R

80 P( KJ =PN(K }+QQ(K , L ) / 2 . L=3 GO TO I O l

300 DO 90 K=I,NR 90 QCIK, L}=DELT~PDOTIK)

T=TN~-DELT DO 110 K=I,NR

I10 PIK)=PN(K}÷QQ(K,L}

L=4 GO TO 101

400 DQ 120 K=It. NR 120 QQ (K~ L )=DELI~'PDOT( K )

GO TO 7 101 CONTINUE

CALL PA {N,A,NR, PtPPI) KL=O JJ=O MN=O DO [ 3 0 K T = I , N DO 130 L 7 = K 7 , N KL=KL+I LN=L7 DO 131 M?=KT,N DO 131 N7=LNJN MN=~MN+I JJ=JJ+l IF [NT.EQ.N} LN=M7+I

131 PP(JJ)=PIKL)*P(MN} 130 Y,N =KL

CALL PRP(N,D,NR, PP, PP2) DO 160 K=I,NR

160 PDOT (K) = PP2 (K)-PPI { K)-QOQ(K) GO TO (100:.200,300,400),L

"/ TN=TN+DELT DO 170 K=I,NR

170 P N ( K . ) = P N ( K ) 4 { 1 . / 6 . )~{QQ(K,I)+Z.*QQ{K,Z)'F2-Y"QQ{K,3 I+~O[K,4)) WRITE(6,631) TN, (PN(K),K=IpNR} NNP=NNP+I IF (NNP.GT .NN) GO TO IgOO GO TO I END

SUBROUTINE INVER [ A , N , B , M , D E T I DIMENSION A ( I O , I O } , C I I 0 , 1 0 ) , I P V O T C I O } , I N D E × [ I O , 2 ) , P I V O T ( I O ) EQUIVALENCE (IROWIJ~OW)j(ICOL,JCOL)

57 D E T = I . DO 17 J = I , N

Page 9: A technique for expanding the matrix Riccati equation

A technique for expanding the matrix Riccati Equation

17 IPVOT(J)=O DO 135 I = I , N T=O. DO 9 J=I,N IF(IPVOT(J)-I} 13,9,13

13 DO 23 K=I,N I F t I P V O T ( K ) - I ) 43,23,81

43 IF (ABS[TI-ABS[A(J,K)}) 83,23,23 83 IROW=J

ICOL=K T=A(J,K)

23 CONTINUE 9 CONTINUE

IPVOT(ICOL)=IPVOT{ICOL}+I IF(IRO~-ICOL) 73 ,109 ,73

73 DET=-DET DO 12 L=I,N T=A(IROV,LI AIIROW,L)=A{ICGL,L)

12 A[ICOLtL) =T IF{M} 109,109,33

33 DO 2 L=I,M T=B[.IRDWtL) B(IROWtL)=B[ICOL,L)

2 B(ICBL,L)=T 109 INDEX(I,II=IROW

INDEX(I,21=ICDL PIVOT(I}=A[ICOL,ICDL) DET=DET*PIVOT(1) A(ICOL,ICOL)=I. DO 205 L = I , N

205 A ( I C O L , L ) = A ( I C O L , L ) / P I V O T ( I ) IF(MI 3~7,347,66

66 DO 52 L=I,M 52 8(ICOL,L)=B(ICOL,L)/PIVOT(1)

347 DO 134 LI=I,N IF [LI-ICOL) 21 ,134 ,21

21 T=A(LI,ICOL) A[LI,ICOL)=O. DO 89 L=I,N

8g A(LI,L)=A(LI,L)-A(I-COL,L)*T IF(M) 134,134,18

18 DO 58 L=I,M b8 B(LI,L)=B(LI,L|-D(ICCL,L}*T

134 CONTINUE 135 CONTINUE 222 DO 3 I=I,N

L=N-I+I IF(INDEX(L,I)-INDEX(L,2)) 19,3,19

19 JROW=INDEX(L,1) JCOL=INDEX(L,2} DO 54g K=I~N T=A(K,JRO~) A(K,JROW}=A(K,JCOL) A(K,JCOL)=T

549 CONTINUE 3 CONTINUE

81 RETURN END

201

SUBROUTINE PA(NTA,NI,X,PPI) DIMENSION A(IO,IO)tX(55),PPI(55),P{I ,55} M=I KK=O DO 10 I=ItN OO 10 J: I ,N KK=KK+I LM=O DO 20 K=I,N DO 20 L=K,N LM=LM*I IF (K.EQ.I.AND.L.NE.j) GO TO 21 IF (K.NE.I.AND.L.EQ.J) GO TO 22 IF (K.NE.!.ANO.L.NE~J.AND. K.EQ.J.AND.L.NE.I) GO TO 23 IF [K.NE.I.AND.L.NE.J.ANO°K.NE.J.AND.L.EQ.I) GO TO 24 IF (K.NE.I.AND.L.NE.J.AND.K.NE.J.ANO.L.NE.I) GO TO 25 IF (K.EQ.I.AND.L.EQ.J.AND.K.EQ.J.ANO.L.EQ.I} GO TO 26 IF (K.EQ.I.AND.L.EQ.J.AND.K.NE°J.AND.L.NE.I} GO TO 27

2 1 P ( M , L M } = A ( L , J } IF (I.EQ.J) P(M, LM)=2.*P[M,LM) GO TO 20

22 P(M,LM)=A(Ktl) IF (I.EQ.J) P(M,LM}=2.*P(M,LM) GO TO 20

23 P(M,LM)=A(L,I) IF (I.EQ.J) P(M,LM)=2.*PIM, LM} GO TO 20

24 P(M,LMI=A(K,J)

Page 10: A technique for expanding the matrix Riccati equation

202 C. F. CHEN and L. S. SHIEH

IF ( I . E Q . J ) P{M,LM)=2.~P(M,LM) GO TO 20

25 P[M,LM)=O. GO TO 20

26 P { M , L M ) = A ( K , ] ) IF (I.EQ.J) P { M , L ~ } = 2 . ~ P { M , LM) GO TO 20

27 P[M,LN)=A(K,I)+A(L,J) IF [I.EQ.J) P(M,LM)=2.~PIM,LM)

20 CONTINUE S=O. DO 31 JJ=I,NI

3 1 S = P ( M , J J ) ~ X ( J J ) + S PPI(KK)=S

I0 CONTINUE RETURN END

41 40 31 30

51

21 20

SUSROUTtNE PRP(NN,PBRBP,NR,PP,PP2) DI~:ENSION H( I , 770),KN(Z,2),PDRBP(lO,IO),PP(55),PP2155; NC=NN~(NN41)~[NN~82+NN+2)/8 II=l KK=O JJ=O DO 20 I = I , N N 00 21 J= I tNN KK=KK+I DO 30 K : I , N N DO 31 L=K,NN LN=L DO 40 M=K,NN DO 41 N=LN,NN J J = J J + l IF (I.EQ.K) KN(I,I}=L IF { I . E Q . L ) K N { I , 1 ) = K IF ( IoEO.t4) K N ( I , 2 ) = N IF ( IoEQ.N) KN(1 ,2 )=M IF ( J . E Q . K } K N ( 2 , I ) = L IF (J .EQoL) K N { Z , I ) = K IF [ J . E Q . H ) KN(2 ,2 )=N IF (J .EQ.NJ KN(2 ,2 }=N IF ( I . N E . K . A N D ° I . N E . L ) K N ( I , I ) : O IF [ I .NE .M.AND. I . N E . N ) K N ( 1 , 2 } : O IF ( J ° N E . K . A N O . J . N E . L ) KN[2 ,1 )=O IF [ j . N E . M . A N D ° J . N E . N ) KN(2 ,2 )=O I F { ( K N [ I , I ) . E Q . O . O R . K N ( 2 , 2 ) . E Q ° O ) . A N D . K N ( 1 , 2 ) . N E . O . A N D . K N ( 2 , 1 ) . N E

10) H [ I I , J J ) = P B R B P { K N ( 1 , Z ) , K N ( 2 , 1 ) ) I F ( ( K N [ I , 2 ) . E Q . O ° O R . K N ( 2 , I ) . E Q . O ) . A N D . K N ( I , 1 ) . N E . O . A N D ° K N ( Z , 2 ) . N E

i0} H[]~,JJ}~PBRBP~KN~I,~}~KN:2,Z}} IF((KN[I,I}.EQ.O.OR.KN(2,2) oEQ.0}.AND.[KN[I,Z}.EQ.O.OR.KN{2,1}o

IEQoOI) H(II,JJ}=O. IF (KN(L,1).NE.O.AND.KN[Z,Z}oNE.O.AND.KN{1,2).NE.O.AND.KN(2,1).

INE.O) H ( I I , J J I = P S R B P ( K N ( I , I ) , K N [ 2 , 2 ) ) + P 6 R B P ( K N ( 1 , 2 ] , K N [ 2 , I ) ) IF [KoEQ.MoAND.L.EQ.N) H[II,JJ)=H{II,JJ)/2° IF {N.EQ°NN] LN=M÷I CONTINUE CONTINUE CONTINUE CONTINUE JJ=0 S=O. DO 51LL=I,NC S=H{II,LL}~PP(LL)+S PP2(KK}=S CONTINUE CONTINUE RETURN END

i0

SUBROUTINE MALTP[N,M,A,L,G,C) DIMENSION A(L0,10),B[10,10),C(10,10| DO I0 I=I,N DO I0 J=l,t S=0- 00 I0 K=I,M S=S+A{I,K)~{K,J) C[I,J]=S RETURN