MATLAB ode solver function is taking a very long time
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!