Computer Assignment 1, Math
222, Fall 2002
Euler and Improved Euler Methods
You may use whatever language or software you
wish to complete this assignment, but it is strongly recommended that you use
MATLAB. If you need assistance with MATLAB, there are two TAs, George Gaines
and Yuriy Mileyko who can help you. They are available in Room 48 of the
Student Mall (under the parking deck) four afternoons per week as follows:
Monday 3-5 pm (Gaines); Tuesday 2:30-4:30 pm (Mileyko); Thursday 2-4 pm
(Mileyko); Friday 2-4 pm (Gaines). These hours are also posted on the door of
Room 48 and will be posted on the Department website shortly.
(a) Find the exact solution y
= y(t) of the IVP
(1-t)dy/dt = y 2, y(0) = y0, y0 ³0.
(b) Write programs to implement the Euler and Improved
Euler methods to obtain approximate numerical solutions.yn
and Yn ,
respectively, of the IVP in (a) for t ³ 0. Your program should save
tn, y(tn), yn, Yn
and the approximation errors en = ½yn - y(tn)
½ and En = ½ Yn - y(tn)
½.
(c) Produce graphs like figures 6.1.6 and 6.2.9 in the
textbook for each of the two methods for the t variable
("time") steps h = 1/N with N = 10 and N
= 100 for t ³ 0 for each of the initial
conditions (i) y0 = 0; (ii) y0 = 0.1; and (iii) y0
= 1.0. There should be altogether twelve graphs.
(d) Graph the errors en and En
versus tn for the approximation errors for each of the cases
considered in (c). You should produce a graph with two labeled error curves for
each method and each case. Do your graphs behave badly in any regions? Explain
why the bad behavior, if any, is to be expected or not.
Computer Assignment #2 in PDF file below.