Question
I'm trying to solve this differential equations by using matlab. But I don't know the reason why I can't get the solutions. I've attached matlab code and few differential equation. Please find a the way to solve this problem.
second oder ode2.m x+ function, second-oder-ode2 t-0:0.001:30 initial-x = 0; initial-dxdt = 0: lt.影=ode45( @rhs, t, [initial.
닛 れな. -56 166
second oder ode2.m x+ function, second-oder-ode2 t-0:0.001:30 initial-x = 0; initial-dxdt = 0: lt.影=ode45( @rhs, t, [initial.x initial.dxdt ] ); plot(t.(:,1l): xlabel( t); ylabel(x): 申 function dxdt=rhs( t, x) dxdt-1 =x(2); dxdt-2 (-50 x(2)+61.25+((1-cos(4 pi 10 t))/2) (47380 x(1)-3-7428 x(1) 2 366*x(1)-7)): end end 오후 10.1
닛 れな. -56 166
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Matlab code

function second_order_ode2
t=0:0.001:30;
initial_x=0;
initial_dxdt=0;
[t,x]=ode45(@rhs,t,[initial_x initial_dxdt]);
plot(t,x(:,1))
xlabel('t')
ylabel('x')
function dxdt=rhs(t,x)
dxdt_1=x(2);
dxdt_2=(-50*x(2)+61.25+((1-cos(4*pi*10*t))/2).*(47380*x(1).^3-7428*x(1).^2+366*x(1)-7));
dxdt=[dxdt_1;dxdt_2];
end
end

Output

18 16 14 12 10 6 4 2 0 0.3 0.05 0.15 0.2 0.25

Warning: Failure at t=2.606178e-01. Unable to meet integration tolerances without reducing the step size below the smallest
value allowed (8.881784e-16) at time t.

This ODE is most likely encountering a singularity.that could i see at least,maybe piecewise integration will do..but finding the singularity the hard part,and Matlab has difficulty to find it

Add a comment
Know the answer?
Add Answer to:
I'm trying to solve this differential equations by using matlab. But I don't know the reason why I can't ge...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT