You are on page 1of 7

2.7, 8.

1 Eulers Method
Diana Morris

December 3, 2010

Diana Morris (University of Virginia)

2.7, 8.1 Eulers Method

December 3, 2010

1/7

Overview of Tangent Lines

Most dierential equations cannot be solved analytically. In other words, there is no procedure for nding solutions. In this case, we can often approximate the solution using numerical methods. One such method is called Eulers method, and it uses the concept of tangent lines. Idea. Let y = f (t). The tangent line to y at the point (t0 , f (t0 )) touches the graph of y at (t0 , f (t0 )). At t-values close to t0 , the tangent line approximates the graph of y . In other words, the y -value of the tangent line is close to the y -value of the actual graph. The Application. If we have a rst order IVP, then we know the slope at one initial point on the graph. This is enough to write the tangent line at the initial point. To approximate y at a nearby t value t1 , we plug t1 into the tangent line equation to get y1 . Then y1 y (t1 ). To approximate y at a further t-value t2 , use (t1 , y1 ) as the anchor point and the slope of the original graph y at t1 to write another tangent line. Then y2 y (t2 ). Continue in this fashion.

Diana Morris (University of Virginia)

2.7, 8.1 Eulers Method

December 3, 2010

2/7

Approximation
Recall. Equation of a line: y y0 = m(t t0 ) or y = y0 + m(t t0 ).

Our Case. Consider the rst order IVP y = f (t, y ), y (t0 ) = y0 . The tangent line to the solution at (t0 , y0 ) is y = y0 + f (t0 , y0 )(t t0 ).
m

The value of y at t1 is approximately y1 = y0 + f (t0 , y0 )(t1 t0 ). The value of y at t2 > t1 is approximately y2 = y1 + f (t1 , y1 )(t2 t1 ). In general, we can approximate successive values of y at tn+1 as yn+1 = yn + f (tn , yn )(tn+1 tn ) .
Diana Morris (University of Virginia) 2.7, 8.1 Eulers Method December 3, 2010 3/7

Example

Use Eulers method to approximate values of the solution of the IVP y = 0.5 t + 2y , y (0) = 1 at t = 0.1, and t = 0.2 with h = 0.05. [The step-size h refers to the length of the increments between successive approximations.] Solution. We must approximate y at dierent t-values, each 0.05 units apart, starting at t0 = 0. So we need to approximate y at t1 = 0.05, t2 = 0.1, t3 = 0.15, and t4 = 0.2. We will call the associated y -values y1 , y2 , y3 , and y4 . The question is asking for y2 and y4 . Since y0 = 1, t0 = 0, we have y (0.05) y1 = = Repeating this procedure, y (0.1) y2 = = y1 + f (t1 , y1 )(t2 t1 ) 1.125 + (0.5 .05 + 2(1.125))(0.1 0.05) = 1.26 y0 + f (t0 , y0 )(t1 t0 ) 1 + (0.5 0 + 2(1))(.05 0) = 1.125

Diana Morris (University of Virginia)

2.7, 8.1 Eulers Method

December 3, 2010

4/7

Example (ctd.)

We continue in the same manner to compute y3 and y4 : y (0.15) y3 = = And nally, y (0.2) y4 = = y3 + f (t3 , y3 )(t4 t3 ) 1.406 + (0.5 .15 + 2(1.406))(0.2 0.15) = 1.5641 y2 + f (t2 , y2 )(t3 t2 ) 1.26 + (0.5 .1 + 2(1.26))(0.15 0.1) = 1.406

Diana Morris (University of Virginia)

2.7, 8.1 Eulers Method

December 3, 2010

5/7

Backward Eulers Method

Another method is called the Backward Eulers Method. Suppose you approximate the solution y to yn at tn and yn+1 at tn+1 . Then the slope of the tangent line connecting (tn , yn ) to (tn+1 , yn+1 ) is f (tn+1 , yn+1 ) = yn+1 yn yn+1 yn = tn+1 tn h yn+1 = yn + f (tn+1 , y(n+1) ) h .

Depending on how dicult the equation is, we can sometimes use this formula to solve for yn+1 .

Diana Morris (University of Virginia)

2.7, 8.1 Eulers Method

December 3, 2010

6/7

Example

Example. Use the Backward Euler Method with h = 0.05 to approximate the solution to y = 2y 3t, y (0) = 1 at t = 0.1. Solution. The formula is yn+1 = yn + f (tn+1 , y(n+1) ) h, hence y1 = y0 + f (t1 , y(1) ) 0.05. Since t0 = 0, y0 = 1, we have t1 = .05. Then y (0.05) y1 .9y1 y1 Approximating again, we have y (0.1) y2 .9y2 y2 = = = 1.10278 + (2(y2 ) 3(.1))(0.05) 1.10278 (0.3)(.05) 1.20864 = = = 1 + (2(y1 ) 3(0.05))(0.05) 1 (0.15)(.05) 1.10278

Diana Morris (University of Virginia)

2.7, 8.1 Eulers Method

December 3, 2010

7/7

You might also like