Question

Numerical Analysis: Make a matlab code that computes the Modified Euler's method for a given function...

Numerical Analysis:

Make a matlab code that computes the Modified Euler's method for a given function y' =  t + y from 0 < t < 4 (inclusive) with h=0.5 and with initial condition y(0) = 0.
Please make output display in tabular form and not in a plot, that doesn't help show the actual values.

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

MATLAB CODE

clc;
a=0;
b=4;
h=0.5;
N=(b-a)/h;
t=[a:h:b];
y(1)=0;
for i=1:N
y(i+1)=y(i)+h*(t(i)+y(i));
y(i+1)=y(i)+h/2*(t(i)+y(i)+t(i+1)+y(i+1));
end
t
y

ANSWERS

t =

0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000


y =

0 0.1250 0.6406 1.7910 3.9729 7.8310 14.4128 25.4208 43.6213

Add a comment
Know the answer?
Add Answer to:
Numerical Analysis: Make a matlab code that computes the Modified Euler's method for a given function...
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