how can i solve matrix riccati differential equation?

5 views (last 30 days)
to solve matrix Riccati differential i am using the piece of code from mathswork support, which is as follows
function dXdt = mRiccati(t, X, A, B, Q)
X = reshape(X, size(A)); %Convert from "n^2"-by-1 to "n"-by-"n"
dXdt = A.'*X + X*A - X*B*B.'*X + Q; %Determine derivative
dXdt = dXdt(:); %Convert from "n"-by-"n" to "n^2"-by-1
[T X] = ode45(@(t,X)mRiccati(t, X, A, B, Q), [0 10], X0)
this code works well with dimension of A = 2x2. but gives error in builtin RESHAPE function when i change dimension of A(i.e A = 3x3, B=3x1, Q=3x3)
  2 Comments
Torsten
Torsten on 1 Jul 2015
Please include the settings for X0,A,B and Q before the call to ode45.
Best wishes
Torsten.
Ana Navarro
Ana Navarro on 14 Jul 2017
Why the negative sign in the Riccati differential equation is being ignored? Shouldn't be dXdt= - A.'X - X*A + X*B*B.'*X - Q ?

Sign in to comment.

Answers (0)

Categories

Find more on Matrix Computations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!