odes with variable coefficients
3 次查看(过去 30 天)
显示 更早的评论
i am solving system of linear ode with time varying (gaussian )coefficients using standard ode45 approach but i am not getting desired results ,do i need to make some changes to accomodate time variartion of coefficients ? below i copy pasted from my m file along with command
% function dy=tarak(t,y)
g0=.1;
t0=200;
s=90;
g=g0*exp(-((t-t0)/s).^2);%time varying gaussian coefficient "g"
G=sqrt(10);
dy=zeros(5,1);
dy(1)=-2*2*y(1)+1i*G*conj(y(3))+1i*g*conj(y(4))-1i*G*y(3)-1i*conj(g)*y(4);
dy(2)=2*y(1)+1i*G*y(3)-1i*G*conj(y(3));
dy(3)=-2*y(3)+1i*G*y(2)+1i*g*conj(y(5))-1i*G*y(1);
dy(4)=-2*y(4)+1i*G*y(5)+1i*g*(1-y(1)-y(2))-1i*g*y(1);
dy(5)=1i*G*y(4)-1i*g*conj(y(3));
Command [T,Y] = ode45(@tarak,[0 ,500],[0 0 0 0 0]);
Thanks for your time
0 个评论
采纳的回答
更多回答(1 个)
Torsten
2015-3-18
Formally, everything looks fine. Of course we don't know if your underlying equations are correct.
Are you sure ODE45 can handle complex-valued ODEs ?
Best wishes
Torsten.
3 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!