Question

Find approximate values of the solution of the given initial value problem at T=0.1, 0.2, 0.3,...

Find approximate values of the solution of the given initial value problem at T=0.1, 0.2, 0.3, and 0.4 using Euler method with h=0.1

y'= 0.5-t+2y ;   y(o)=1

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

solution:-

y' = 0.5 - t + 2y      ,    y(0)=1

(a) Find approximate values of the solution of the given initialvalue problem at t = 0.1, 0.2, 0.3, and 0.4 using the Euler methodwith h = 0.1.
%%%%%%%%%

h=0.1;

tmax=0.4;

n=tmax/h;

t(1)= 0;

y(1)=1;

tout=t(1);

yout=y(1).';

disp('ti Euler=y(i) ')

disp('~~~~~~~~~~~~~~~~~~~~~~~~')

for i=1:(n+1)

t(i+1)=t(1)+i*h;

%

k1= h*f(t(i),y(i));

y(i+1)=y(i)+ k1;

tout=[tout;t(i)];

yout=[yout,y(i).'];

fprintf ('%5.2f%17.5f\n',t(i),y(i));

end



////////////////////////////////////////////////////////////////

function yz=f(t,y)

yz= 0.5 - t + 2*y;

/////////////////////////////////////

h=0.1

ti      Euler=y(i)
~~~~~~~~~~~~~~~~~~~~~~~~
0.00         1.00000
0.10         1.25000
0.20         1.54000
0.30         1.87800
0.40         2.27360

NOTE:PLEASE RATE IT

Add a comment
Know the answer?
Add Answer to:
Find approximate values of the solution of the given initial value problem at T=0.1, 0.2, 0.3,...
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