Question
Please show MATLAB code for how to gain solution.
10.1 Consider the following first-order ODE: from x -0 to 2.1 with (0) 2 (a) Solve with Eulers explicit method using h 0.7. (b) Solve with the modified Euler method using h - 0.7. r Runge-Kutta method using h 0.7. The analytical solution of the ODE is24. In each part, calculate the eror between the true solution and the numerical solution at the points where the numerical solution is determined
0 0
Add a comment Improve this question Transcribed image text
Answer #1

a):MATLABCODE:

octave: 1> clear all; h-0.7 x 0:h:2.1; y-zeros(length(x), 1): y(0)-2: for i:1:length(x) f-x (i-0) -x(i-0)*y(i-0)/2; end plot(

OUTPUT:

2 1.45 0.5- CD CD 0.5 1.5 2.5

b)MATLABCODE:

octave: 1> clear all; h-0.7; x 0:h:2.1; y-zeros(length(x), 1): y(0)-2: for i-1:length(x) f-x (i-0) -x(i-0)*y(i-0)/2; y(i) y(i

OUTPUT:

0.8 0.6 0.4 0.2- CD CD 0.5 1.5 2 2.5

Add a comment
Know the answer?
Add Answer to:
Please show MATLAB code for how to gain solution. 10.1 Consider the following first-order ODE: from...
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