DOC PREVIEW
UW-Madison COMPSCI 412 - Lecture 22 Notes

This preview shows page 1-2 out of 6 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

12 7 10 cs412 introduction to numerical analysis Lecture 22 Rules for Solving IVP Instructor Professor Amos Ron 1 Yunpeng Li Pratap Ramamurthy Mark Cowlishaw Nathanael Fillmore Scribes Review Recall that last time we discussed the numerical solution of first order differential equations When solving differential equations we are looking for a function y t given an expression for the derivative y t in terms of t and y t y t f t y t Last time we showed that this problem is ill formed since there are infinitely many solutions in fact for each point a y a there is a unique solution y t In order to make this problem well formed we must also provide an initial value for y t giving us an initial value problem Problem 1 1 Initial Value Problem Given y t f t y t y a y0 find y b Last time we discussed some simple methods for solving initial value problems All of our rules follow the same general scheme 1 Partition the interval a b into N subintervals of equal length h b a N using points t0 t1 tN 2 Denote values for the function yi y ti and derivative yi y ti at each point We will compute approximations for these values Yi yi and Yi yi 3 Start with Y0 y0 Y0 f t0 Y0 then calculate each successive value Yi 1 for i 0 1 N 1 by approximating the integral of y t over ti ti 1 Yi 1 Yi Z ti 1 y t dt ti 4 Calculate Yi 1 using f and the approximate value for yi 1 Yi 1 f ti 1 Yi 1 1 We can create different rules for solving the IVP by using different approximations of the definite integral Z ti 1 y t dt ti Last time we introduced two simple methods for solving the IVP using the rectangle and midpoint rules Rule I Euler s Method Rectangle Rule For each sub interval we have yi 1 yi Z ti 1 y t dt ti Approximating this integral using the rectangle rule yields Yi 1 Yi h Yi We can then calculate Yi 1 using f ti 1 Yi 1 Yi 1 t j 1 tj Y values Y values Figure 1 Function and Derivative Values used in Euler s Method We say that this rule is single step since it only requires information about the current point ti to calculate the values for the next point ti 1 and no information about previous points is required Figure 1 shows the function and derivative values required to apply Euler s rule Rule II Modified Euler s Method Midpoint Rule In modified Euler s rule we approximate the integral using the midpoint rule However recall that the midpoint rule requires that we know the value of the function we are integrating at the midpoint of the interval To overcome this we use an interval that is twice as large 2h as shown in Figure 2 t j 1 tj t j 1 Y values Y values Figure 2 Function and Derivative Values used in Modified Euler s Method 2 yi 1 yi 1 Z ti 1 y t dt ti 1 Yi 1 Yi 1 2h Yi We calculate the derivative value at ti 1 as always Yi 1 f ti 1 Yi 1 We say that this rule is multi step since it requires knowledge of values at a past point ti 1 as well as the current point ti to calculate the values at the next point ti 1 Although modified Euler s method is substantially better than Euler s method it is not often used in practice since the error is still quite large compared to other methods Today we will study additional rules for solving the IVP some of which are not used for approximating integrals in the general case but are used for approximating integrals when solving the IVP 2 2 1 Additional Rules for Solving IVP Rule III Trapezoid Method Recall that in the trapezoid rule we approximate the integral using the line between the function values at the endpoints so to approximate Z ti 1 y t dt yi 1 yi ti t j 1 tj Y values Y values Figure 3 Function and Derivative Values used in the Trapezoid Method we use the following approximation as shown in Figure 3 Yi 1 Yi h Yi Yi 1 2 which is a value that we do not know Methods Note that this method requires us to use Yi 1 that require knowledge of the derivative at the point we are estimating are called closed methods In general to use a closed method we must first use some other method to predict the value of 3 When we use an open method to predict the derivative value Y Yi 1 i 1 and a closed method to use this value to calculate a corrected Yi we call such hybrid methods predictor corrector methods and we will discuss them later in the lecture The Trapezoid method is a single step method since it requires no knowledge of function and derivative values at previous points 2 2 Rule IV Simpson s Method Simpson s Method is a closed multi step method As in the midpoint rule we use an interval of size 2h for our approximation as shown in Figure 4 t j 1 t j 1 tj Y values Y values Figure 4 Function and Derivative Values used in Simpson s Method The approximation for the new function value Yj 1 is given by Yj 1 Yj 1 2 3 h Y Yj Yj 1 3 j 1 Rule V Milne s Method Milne s method interpolates the function that is y t using three equidistant points in the middle of the interval as shown in Figure 5 t j 3 t j 2 t j 1 tj t j 1 Y values Y values Figure 5 Function and Derivative Values used in Milne s Method Milne s method is open and multi step using an interval of size 4h The approximation for the new function value Yj 1 is given by Yj 1 Yj 3 2 4 4h 2Yj 2 Yj 1 2Yj 3 Rule VI Adams Bashforth Method The Adams Bashforth rule is an open multi step method that uses four points to interpolate the function y t being integrated as shown in Figure 6 This method seems counter intuitive since it is asymmetric and uses many points off the interval to calculate the definite integral Notes that 4 t j 3 t j 2 t j 1 tj t j 1 Y values Y values Figure 6 Function and Derivative Values used in the Adams Bashforth Method all of these values are available when we reach tj however so that the method is open In practice this rule does not suffer from many instabilities that many of the other rules share The approximation for the new function value Yj 1 in the Adams Bashforth method is given by Yj 1 Yj 2 5 h 55Yj 59Yj 1 37Yj 2 …


View Full Document

UW-Madison COMPSCI 412 - Lecture 22 Notes

Download Lecture 22 Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 22 Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 22 Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?