Question

I need to solve this using Matlab please type comments in the script so I understand thank you.

Solve the following problem with the fourth-order RK method: 25.4 dy dxdx where y(0) 4 and y(0)-0. Solve fromx-0 to 5 with h

  1. Create a table (similar to what we do in class) with all the parameters that you have to calculate for every step in the solution. Include y and dy/dx in the same plot with points from your table joined by straight lines (and clearly indicate which line correspond to what). You may use the MATLAB function you created above.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Matlab Code:

clc;clear;
x = 0:0.5:5;% defining x

init = [4; 0];% initial conditions

[x,y] = ode45(@f,x,init);% command to solve

plot(y);%plotting results

function e = f(x,y)

e = zeros(2,1);
e(1) = y(2);%first derivative
e(2) = -8*y(1)-0.6*y(2);%second derivative
  
end

Add a comment
Know the answer?
Add Answer to:
I need to solve this using Matlab please type comments in the script so I understand thank you. Create a table (similar to what we do in class) with all the parameters that you have to calculate fo...
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
ADVERTISEMENT