MATLAB ode solver function is taking a very long time

조회 수: 1 (최근 30일)
prakash kumar
prakash kumar 2015년 9월 23일
답변: Steven Lord 2015년 9월 24일
I want to solve a differential equation . for this I am using ode23 solver. my differential equation function is given below.
%%%%%%
function dydt = pkodeB2(t,y)
global m b Ad f
uddot=-Ad*(2*pi*f)^2*cos(2*pi*f*t);
ydot=y(2);
yddot=-(y(1).*b(1)+ y(2).*b(2)+y(1).^2.*y(2).*b(3)+ y(2).^3.*b(4)+y(1).^5.*b(5)+ y(1).^1.*y(2).^4.*b(6)+m*uddot)./(m);
dydt=[ydot;yddot];
told=t;
%%%%%%
y0=2/sqrt((-(b(3)/b(2))-3*(b(1)*b(4))/(m*b(2))));
ydot0=0;
ystart=[y0 ydot0];
tspan=0:0.005:20;
[t,y] =ode23(@pkodeB2,tspan,ystart);
where m= 70.9; Ad=0.03; f=1;and
b= [2868.808, -696.923, 4800983.798, 90741.008, -40781322891.737, 90262286.352]
when I run the code Matlab shows busy and it does not generate any value in one hour or more.
I want to know how I proceed to solve the above differential equation

답변 (1개)

Steven Lord
Steven Lord 2015년 9월 24일
Try one of the stiffer solvers listed in the ODE documentation.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by