How to find steady state solution of recatti equation

5 views (last 30 days)
hi everyone,
I want to find solution of algebric equations as below:
-A_Star'*x-x*A-Q+x*G*x ... where x is the solution of this equation
where A_Star, A Q and G are defined as below:
N=50;
a1=1; a2=1;
tau=1;
A=zeros(N+1,N+1);
A=diag(-N/tau*ones(N+1,1)) + diag(N/tau*ones(N,1),-1);
A(1,1)=a1;
A(1,N+1)=a2;
B=zeros(N+1,1);
B(1)=1;
Q=zeros(N+1,N+1);Q(1,1)=1;
R=1;
W=zeros(N+1,N+1);
W=diag(tau/N*ones(N+1,1));
W(1,1)=1;
G=B*R*B';
A_Star=inv(W)*A'*W;
Thank you in advance for your helps,

Accepted Answer

Torsten
Torsten on 16 Apr 2022
If it's a Riccati equation, use "icare" or "idare".
  7 Comments
Torsten
Torsten on 16 Apr 2022
The following code seems to work:
N=50;
a1=1; a2=1;
tau=1;
A=zeros(N+1,N+1);
A=diag(-N/tau*ones(N+1,1)) + diag(N/tau*ones(N,1),-1);
A(1,1)=a1;
A(1,N+1)=a2;
B=zeros(N+1,1);
B(1)=1;
Q=zeros(N+1,N+1);Q(1,1)=1;
R=1;
W=zeros(N+1,N+1);
W=diag(tau/N*ones(N+1,1));
W(1,1)=1;
G=B*R*B';
A_Star=inv(W)*A'*W;
X0 = ones((N+1)^2,1);
X = fsolve(@(X)fun(X,N,A_Star,A,Q,G),X0)
X = reshape(X,N+1,N+1);
norm(-A_Star'*X-X*A-Q+X*G*X)
function res = fun(X,N,A_Star,A,Q,G)
X = reshape(X,N+1,N+1);
res = -A_Star'*X-X*A-Q+X*G*X;
res = res(:);
end

Sign in to comment.

More Answers (1)

Sam Chak
Sam Chak on 16 Apr 2022
You can find the solution for x with the Implicit algebraic Riccati equation solver:
[X, K, L] = icare(A_Star, [], Q, [], [], [], G)
For older versions of MATLAB (before R2019a), then use this:
[X, L, G] = care(A_Star, B, Q)
  2 Comments
shahin sharafi
shahin sharafi on 16 Apr 2022
Thank you, but my reccatii equation is not as same as MATLAB calculate. Please see the the equation again.
-A_Star'*x-x*A-Q+x*G*x
I want to solve this equation directly.

Sign in to comment.

Categories

Find more on Matrix Computations in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!