How to find steady state solution of recatti equation

5 Ansichten (letzte 30 Tage)
shahin sharafi
shahin sharafi am 16 Apr. 2022
Kommentiert: shahin sharafi am 17 Apr. 2022
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,

Akzeptierte Antwort

Torsten
Torsten am 16 Apr. 2022
If it's a Riccati equation, use "icare" or "idare".
  7 Kommentare
Torsten
Torsten am 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
shahin sharafi
shahin sharafi am 17 Apr. 2022
thank you very much, it works!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Sam Chak
Sam Chak am 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 Kommentare
shahin sharafi
shahin sharafi am 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.
shahin sharafi
shahin sharafi am 17 Apr. 2022
Thank you for your response.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Matrix Computations finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by