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
  • I'm trying to solve this problem by using matlab. But I don't know reason why I can't get the solutions. I w...

    I'm trying to solve this problem by using matlab. But I don't know reason why I can't get the solutions. I wanna get a plot of this differential equation. Please find a way how to solve this problem. May there're errors in the code. Please check it.    second-oder-ode2.m x 曱function, second-oder-ode2 t=0:0.001 :30; initial-× = 0; in i t i al-dxdt 0; lt,影=ode45( @rhs, t. [initial.x initial-dxdt ] ); plot( (:, 1) ) ; xlabel( 't); ylabel(): function dxdt=rhs( t,...

  • I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But...

    I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But I wanna get a plot of completely sinusoidal form. If I can magnify the plot and expand x-axis, maybe we can get the sinusoidal form. So help me with this problem by using matlab. Example is attached in below. One is the plot from this code and another is example. function second_order_ode2 t=[0:0.001:1]; initial_x=0; initial_dxdt=0; [t,x]=ode45(@rhs,t,[initial_x initial_dxdt]); plot(t,x(:,1)) xlabel('t') ylabel('x')...

  • I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But...

    I'm trying to solve this differential equations by using matlab and I've got a plot from the code attached. But I wanna get a plot of completely sinusoidal form. If I can magnify the plot and expand x-axis, maybe we can get the sinusoidal form. So help me with this problem by using matlab. Example is attached in below. One is the plot from this code and another is example. function second_order_ode2 t=[0:0.001:1]; initial_x=0; initial_dxdt=0; [t,x]=ode45(@rhs,t,[initial_x initial_dxdt]); plot(t,x(:,1)) xlabel('t') ylabel('x')...

  • modify this code is ready % Use ODE45 to solve Example 4.4.3, page 205, Palm 3rd...

    modify this code is ready % Use ODE45 to solve Example 4.4.3, page 205, Palm 3rd edition % Spring Mass Damper system with initial displacement function SolveODEs() clf %clear any existing plots % Time range Initial Conditions [t,y] = ode45( @deriv, [0,2], [1,0] ); % tvals yvals color and style plot( t, y(:,1), 'blue'); title('Spring Mass Damper with initial displacement'); xlabel('Time - s'); ylabel('Position - ft'); pause % hit enter to go to the next plot plot( t, y(:,2), 'blue--');...

  • Solve the following differential equation using MATLAB's ODE45 function. Assume that the all init...

    Solve the following differential equation using MATLAB's ODE45 function. Assume that the all initial conditions are zero and that the input to the system, /(t), is a unit step The output of interest is x dt dt dt To make use of the ODE45 function for this problem, the equation should be expressed in state variable form as shown below Solve the original differential equation for the highest derivative dt 2 dt Assign the following state variables dt dt Express...

  • I need the matlab codes for following question (1) (a). Solve the following second-order differential equations by a pair of first-order equations, xyʹʹ − yʹ − 8x3y3 = 0; with initial conditions y = 0...

    I need the matlab codes for following question (1) (a). Solve the following second-order differential equations by a pair of first-order equations, xyʹʹ − yʹ − 8x3y3 = 0; with initial conditions y = 0.5 and yʹ = −0.5 at x = 1. (b). Solve the problem in part (a) above using MATLAB built-in functions ode23 and ode45, within the range of 1 to 4, and compare with the exact solution of y = 1/(1 + x2) [Hint: ode23 à...

  • 4. Using inbuilt function in MATLAB, solve the differential equations: dx --t2 dt subject to the ...

    Matlab Code for these please. 4. Using inbuilt function in MATLAB, solve the differential equations: dx --t2 dt subject to the condition (01 integrated from0 tot 2. Compare the obtained numerical solution with exact solution 5. Lotka-Volterra predator prey model in the form of system of differential equations is as follows: dry dt dy dt where r denotes the number of prey, y refer to the number of predators, a defines the growth rate of prey population, B defines the...

  • write MATLAB scripts to solve differential equations. Computing 1: ELE1053 Project 3E:Solving Differential Equations Project Principle...

    write MATLAB scripts to solve differential equations. Computing 1: ELE1053 Project 3E:Solving Differential Equations Project Principle Objective: Write MATLAB scripts to solve differential equations. Implementation: MatLab is an ideal environment for solving differential equations. Differential equations are a vital tool used by engineers to model, study and make predictions about the behavior of complex systems. It not only allows you to solve complex equations and systems of equations it also allows you to easily present the solutions in graphical form....

  • PLEASE HELP SOLVE WITH MATLAB LANGUGE. Below are hints to the problem. THANKS A LOT!! 2...

    PLEASE HELP SOLVE WITH MATLAB LANGUGE. Below are hints to the problem. THANKS A LOT!! 2 Coriolis Force In a rotating frame-of-reference,the equations of motion of a particle, written in co- ordinates fixed to the frame, have additional terms due to the rotation of the frame itself Consider such a rotating frame, with its origin at the center of rotation.In these coor- dinates, the equations of motion for a point-mass subjected to forces F, and F S m, are F(0...

  • i'm workimg on a careplan and i need help. i don't know what this Roy adaption...

    i'm workimg on a careplan and i need help. i don't know what this Roy adaption model is. can someone please help me? HELENE FULD COLLEGE OF NURSING CRITERIA FOR EVALUATION OF NURSING CARE PLAN NUR 221 ASSESSMENT Pole poids Actual points d at of 1. Cabe 2. Uspor include e pay and environmental tervisection, auto plation, and person D hes 3. a t in prima including wojective and objective data history, cum DIAGNOSIS Posle points Actual points Criteria Incorporate...

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
ADVERTISEMENT