how can i solve matrix riccati differential equation?

-dXdt = - X*B*R^(-1)*B'*X + Q

11 Comments

If R is symmetric positive definite,
R^(-1) = A*A'.
Then
-dXdt = - X*(B*A)*(B*A)'*X + Q
and you can use
https://de.mathworks.com/matlabcentral/answers/94722-how-can-i-solve-the-matrix-riccati-differential-equation-within-matlab
Best wishes
Torsten.
i used this function
function dXdt = mRiccati(t,X,A,B,R,Q)
X = reshape(X, size(A)); %Convert from "n^2"-by-1 to "n"-by-"n"
dXdt = A.'*X + X.*A - X*B.*inv(R).*B'.*X + Q; %Determine derivative
dXdt = dXdt(:); %Convert from "n"-by-"n" to "n^2"-by-1
my programm is :
% diff equat
R=0.1*eye(3,3);
Q=eye(3,3);
B=1/2.*[0,0.3604,-0.4397;-0.3604,0,0.2226;0.4397,-0.2226,0]+0.8224*eye(3,3);
X0 = [1; 1; 1; 1;1;1];
[T X] = ode45(@(t,X)mRiccati(t,X,A,B,R,Q), [0 10], X0)
it returns this message error:
I don't see that you define A somewhere.
And X0 must by 9x1, not 6x1.
yes it works :
% diff equat
A=[0,0,0;0,0,0;0,0,0];
R=0.1*eye(3,3);
Q=eye(3,3);
B=1/2.*[0,0.3604,-0.4397;-0.3604,0,0.2226;0.4397,-0.2226,0]+0.8224*eye(3,3);
X0 = [1; 1; 1; 1;1;1;1;1;1];
[T X] = ode45(@(t,X)mRiccati(t,X,A,B,R,Q), [0 10], X0)
the result :
thank you, how do you know that x0 is 9x1 ?
A is 3x3, and X has the same dimension as A.
ODE45 expects X to be in vector form, thus of length 3x3=9.
thank you Torsten it's very helpfull
There are quite a few errors in the line where you calculate dXdt. This is the correct formula:
dXdt = A.'*X + X*A - X*B*inv(R)*B.'*X + Q; %Determine derivative
Best wishes
Torsten.
i thought x is a matrix so i changed the product () with this (.) i got this figure
</matlabcentral/answers/uploaded_files/110185/2018-03-26_162259.png> thank you Torsten ,I'm trying to simulate equations that i found it in a research article and all what i do is executing programs and compare the result with figures of the article 8).

Sign in to comment.

Answers (0)

Categories

Asked:

on 25 Mar 2018

Commented:

on 26 Mar 2018

Community Treasure Hunt

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

Start Hunting!