How to find steady state solution of recatti equation

2 visualizaciones (últimos 30 días)
shahin sharafi
shahin sharafi el 16 de Abr. de 2022
Comentada: shahin sharafi el 17 de Abr. de 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,

Respuesta aceptada

Torsten
Torsten el 16 de Abr. de 2022
If it's a Riccati equation, use "icare" or "idare".
  7 comentarios
Torsten
Torsten el 16 de Abr. de 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 el 17 de Abr. de 2022
thank you very much, it works!

Iniciar sesión para comentar.

Más respuestas (1)

Sam Chak
Sam Chak el 16 de Abr. de 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 comentarios
shahin sharafi
shahin sharafi el 16 de Abr. de 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 el 17 de Abr. de 2022
Thank you for your response.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Computations en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by