~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to man/control/ricc.cat

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
RICC             Scilab Group             Scilab Function              RICC
2
 
NAME
3
 
   ricc - Riccati equation 
4
 
  
5
 
CALLING SEQUENCE
6
 
 [X]=ricc(A,B,C,"cont")
7
 
 [X]=ricc(F,G,H,"disc")
8
 
PARAMETERS
9
 
 A,B,C      : real matrices of appropriate dimensions
10
 
            
11
 
 F,G,H      : real matrices of appropriate dimensions
12
 
            
13
 
 X          : real matrix
14
 
            
15
 
 "cont","disc"'
16
 
             : imposed string (flag for continuous or discrete)
17
 
            
18
 
DESCRIPTION
19
 
   Riccati solver.
20
 
  
21
 
   Continuous time:
22
 
  
23
 
   X=ricc(A,B,C,'cont')
24
 
   gives a solution to the continuous time ARE
25
 
  
26
 
   A'*X+X*A-X*B*X+C=0 .
27
 
   B and C are assumed to be nonnegative definite. (A,G) is assumed to be
28
 
  stabilizable with G*G' a full rank factorization of B.
29
 
  
30
 
   (A,H) is assumed to be detectable with H*H' a full rank factorization of
31
 
  C. 
32
 
  
33
 
   Discrete time:
34
 
  
35
 
   X=ricc(F,G,H,'disc')
36
 
   gives a solution  to the discrete time ARE 
37
 
  
38
 
   X=F'*X*F-F'*X*G1*((G2+G1'*X*G1)^-1)*G1'*X*F+H
39
 
   F is assumed invertible and   G = G1*inv(G2)*G1'.
40
 
  
41
 
   One  assumes  (F,G1) stabilizable and (C,F) detectable with C'*C full
42
 
  rank factorization of H. Use preferably ric_desc.
43
 
  
44
 
EXAMPLE
45
 
 //Standard formulas to compute Riccati solutions
46
 
 A=rand(3,3);B=rand(3,2);C=rand(3,3);C=C*C';R=rand(2,2);R=R*R'+eye();
47
 
 B=B*inv(R)*B';
48
 
 X=ricc(A,B,C,'cont');
49
 
 norm(A'*X+X*A-X*B*X+C,1)
50
 
 H=[A -B;-C -A'];
51
 
 [T,d]=gschur(eye(H),H,'cont');T=T(:,1:d);
52
 
 X1=T(4:6,:)/T(1:3,:);
53
 
 norm(X1-X,1)
54
 
 [T,d]=schur(H,'cont');T=T(:,1:d);
55
 
 X2=T(4:6,:)/T(1:3,:);
56
 
 norm(X2-X,1)
57
 
 //       Discrete time case
58
 
 F=A;B=rand(3,2);G1=B;G2=R;G=G1/G2*G1';H=C;
59
 
 X=ricc(F,G,H,'disc');
60
 
 norm(F'*X*F-(F'*X*G1/(G2+G1'*X*G1))*(G1'*X*F)+H-X)
61
 
 H1=[eye(3,3) G;zeros(3,3) F'];
62
 
 H2=[F zeros(3,3);-H eye(3,3)];
63
 
 [T,d]=gschur(H2,H1,'disc');T=T(:,1:d);X1=T(4:6,:)/T(1:3,:);
64
 
 norm(X1-X,1)
65
 
 Fi=inv(F);
66
 
 Hami=[Fi Fi*G;H*Fi F'+H*Fi*G];
67
 
 [T,d]=schur(Hami,'d');T=T(:,1:d);
68
 
 Fit=inv(F');
69
 
 Ham=[F+G*Fit*H -G*Fit;-Fit*H Fit];
70
 
 [T,d]=schur(Ham,'d');T=T(:,1:d);X2=T(4:6,:)/T(1:3,:);
71
 
 norm(X2-X,1)
72
 
SEE ALSO
73
 
   riccati, ric_desc, schur, gschur  
74