Azzera filtri
Azzera filtri

How to find steady state solution of recatti equation

2 visualizzazioni (ultimi 30 giorni)
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,

Risposta accettata

Torsten
Torsten il 16 Apr 2022
If it's a Riccati equation, use "icare" or "idare".
  7 Commenti
Torsten
Torsten il 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

Accedi per commentare.

Più risposte (1)

Sam Chak
Sam Chak il 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 Commenti
shahin sharafi
shahin sharafi il 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.

Accedi per commentare.

Categorie

Scopri di più su Matrix Computations in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by