Question

dy dt (a) Analytically (b) Using Eulers method with h-0.5 and 0.25. (c) Using the midpoint method with h-0.5.

HW12_1 Problem 22.1. (a,b,c). Find y(2). Do the plotting in MATLAB. (which means you are coding each of these methods as well as doing the work by hand on paper). Just the coding portion of the question please.

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

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

clc%clears the screen
clear all %clears the history
format long;
f=@(t,y) y*t^2-1.1*y;
for h=[0.5,0.25]
y=[1];
t=0:h:2;
for i=2:length(t)
y(i)=y(i-1)+h*f(t(i-1),y(i-1));
end
fprintf('For h=%f, y(2)=%f\n',h,y(end));
plot(t,y);
hold on;
end
legend('h=0.5','h=0.25');

Note: Brother according to HomeworkLib's policy we are only allowed to answer first part if there are many. So, I request you to post other part as separate posts.

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
HW12_1 Problem 22.1. (a,b,c). Find y(2). Do the plotting in MATLAB. (which means you are coding...
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