solve a complex differential Riccati equation numerically

I want to solve a complex differential Riccati equation numerically. I used ODE45 and ODE15s but The solution has unstable oscillation.
How can I solve a differential Riccati equation with complex values?
For example:
d/dt y(t)=((-1+(0.5*cost)) (y(t)^2) )+1

7 个评论

d/dt y(t)=((-1+(0.5*cost)) (y(t)^2) )+1
WHere is cos(t) ?
out = [(-a12*(y(1)^2))+(-(a11-a22)*y(1))+a21];
It is a part of biger code.
In the main code matrix ''A'' is calculated and send it to riccati m.file to be solved.
Matrix ''A'' is :
A=[a11=0 a12=-1+0.5*cos(t);
a21=1 a22=0]
I have attached a simplified mfile.
Even though the initial value () makes the riccati equation zero at t=0, the solution is unstable for t>0. !!

请先登录,再进行评论。

 采纳的回答

It is my code for ODE:
y0=[-1i*sqrt(2)];
tspan = [t_curr-h t_curr];
M = [1];
%%% A=[0 -1+0.5*cos(t);
%%% 1 0]
par = [A(1,1);A(1,2);A(2,1);A(2,2)];
options = odeset('Mass',M,'RelTol',1e-6,'AbsTol',[1e-6]);
[T_LL,LL] = ode45(@tabe,tspan,y0,options,par);
%%%%%%%%%%%
function out = tabe(t,y,parameters)
a11=parameters(1);
a12=parameters(2);
a21=parameters(3);
a22=parameters(4);
out = [(-a12*(y(1)^2))+(-(a11-a22)*y(1))+a21];
end
%%%%%%%%%%%%%%%%%%%%%%%%%
It is the answer of ODE45:
answer.png

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Matrix Computations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by