MATLAB ode solver function is taking a very long time
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Steven Lord
on 24 Sep 2015
Try one of the stiffer solvers listed in the ODE documentation.
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations 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!