# L14 - Fall 2003 Math 308/501502 Numerical Methods 1.4...

This preview shows pages 1–2. Sign up to view the full content.

Fall 2003 Math 308/501–502 Numerical Methods 1.4 Euler’s Method Fri, 24/Oct c 2003, Art Belmonte Summary Geometrical idea Euler’s method numerically approximates the solution of y 0 = f ( t , y ), y ( a ) = y 0 by following tangent lines at discrete points. Think of tangent line segments that form the background of a dfield7 plot. Figures in Section 1.4 are illustrative in this regard. The numerical algorithm Let [ a , b ] be the interval over which an approximation to the solution is desired. (Thus t = a and t = b are the initial and final values of the independent variable, respectively.) Partition this interval into N subintervals each of length h = ( b - a )/ N , called the step size . Let t 0 = a and define t k + 1 = t k + h , for k = 0 , 1 , . . . , N - 1 . Notice that t N = b and the other t k so-defined are the interior endpoints of the subintervals. These collectively are the discrete values of the independent variable. The initial value of the dependent variable is given by the initial condition, y ( a ) = y ( t 0 ) = y 0 . The other discrete dependent variable values are computed iteratively as follows. for k = 0 to N - 1 t k + 1 = t k + h y k + 1 = y k + h f ( t k , y k ) Euler’s method is a single-step numerical solver since it depends only on data obtained from the preceding step. It is a fixed-step solver since the lengths of the subintervals of [ a , b ] are all equal. The error in the approximation In general, as the step size decreases, so does the error in the approximation. This error consists of two parts, round-off error and truncation error . MATLAB does floating point computations in double precision, so round-off error is usually not an issue. The truncation error results from the fact that we are following the tangent line at a given point in the plane rather than a solution curve itself. Moreover, there is a truncation error at each step of the iteration as well as a propagated truncation error due to errors from previous steps. The truncation error at each step is proportional to h 2 . However, due to propagated truncation error (which can grow exponentially over time), the maximum total error of the approximation at t = b satisfies the following error bound. maximum error M L e L ( b - a ) - 1 h Here L = max ( t , y ) R f y and M = 1 2 max ( t , y ) R f t + f f y where R is a rectangle containing the solution curve. The fact that h occurs to the first power in the error bound is the reason that we say that Euler’s method is a first-order method. Systems Euler’s method carries over directly to systems of first-order equations. We simply write the algorithm in terms of vectors. Let u 0 = f ( t , u ), u ( t 0 ) = u 0 where u = [ u 1 , u 2 , . . . , u n ] T is an n -dimensional column vector. With the t k defined as above, we have for k = 0 to N - 1 t k + 1 = t k + h u k + 1 = u k + h f ( t k , u k ) Hand Examples We’ll do one problem by hand. Numerical methods are best done with a computer, so make sure you study the MATLAB examples below carefully!

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern