Euler’s Method

15
Euler’s Method Section 6.6

description

Euler’s Method. Section 6.6. Suppose we are given a differential equation and initial condition:. Then we can approximate the solution to the differential equation by its linearization (which is “close enough” in a short interval about x ). 0. The basis of Euler’s method is to “string - PowerPoint PPT Presentation

Transcript of Euler’s Method

Page 1: Euler’s Method

Euler’s Method

Section 6.6

Page 2: Euler’s Method

Suppose we are given a differential equation and initial condition:

,dy f x ydx

0 0y x y

Then we can approximate the solution to the differential equationby its linearization (which is “close enough” in a short intervalabout x ).0 0 0 0L x y x y x x x

0 0 0 0,y x f x y x x

y y x

0x

(solution curve)

L x

0y 0 0,x y

The basis of Euler’smethod is to “string

together” manylinearizations to

approximate a curve.

Page 3: Euler’s Method

y y x

0x

0y 0 0,x y

1 0x x dx

Now, let’s specify a new valuefor the independent variable:

1 1 0 0 0,y L x y f x y dx If dx is small, then we have a new linearization:

1 1,x y x

1 1,x L x

1 0x x dx dx

0 0,x yFrom the point , which lies exactly on the solution curve,we have obtained the point , which lies very close to thepoint on the solution curve.

1 1,x y 1 1,x y x

Page 4: Euler’s Method

1 1,f x ySecond Step: We use the point and the slopeof the solution curve through .

1 1,x y 1 1,x y

2 1 1 1,y y f x y dx

2 1x x dx 1 1,x y

Setting , we use the linearization of the solutioncurve through to calculate

2 2,x yThis gives us the next approximation to values along thesolution curve . y y x

Continue the pattern to find the third approximation:

3 2 2 2,y y f x y dx

Let’s see this process graphically…

Page 5: Euler’s Method

Three steps in the Euler approximation to the solution of theinitial value problem ,y f x y 0 0y x y,

True solution curve

y y x

Euler approximation

3 3,x y 2 2,x y

1 1,x y

0 0,x y

Error

dx dx dx0x 1x 2x 3x

Page 6: Euler’s Method

Using Euler’s MethodFind the first three approximations using Euler’smethod for the initial value problem

1 2 3, ,y y y

0 1y 1y y starting at with 0.1dx 0 0x

We have:

1 0 0.1x x dx 0 1y 0 0x

2 0 2 0.2x x dx

3 0 3 0.3x x dx

Page 7: Euler’s Method

Using Euler’s MethodFind the first three approximations using Euler’smethod for the initial value problem

1 2 3, ,y y y

0 1y 1y y starting at with 0.1dx 0 0x

First Approximation

1 0 0 0,y y f x y dx

0 01y y dx

1 1 1 0.1 1.2

Page 8: Euler’s Method

Using Euler’s MethodFind the first three approximations using Euler’smethod for the initial value problem

1 2 3, ,y y y

0 1y 1y y starting at with 0.1dx 0 0x

Second Approximation

2 1 1 1,y y f x y dx

1 11y y dx

1.2 1 1.2 0.1 1.42

Page 9: Euler’s Method

Using Euler’s MethodFind the first three approximations using Euler’smethod for the initial value problem

1 2 3, ,y y y

0 1y 1y y starting at with 0.1dx 0 0x

Third Approximation

3 2 2 2,y y f x y dx

2 21y y dx

1.42 1 1.42 0.1 1.662

Page 10: Euler’s Method

Using Euler’s MethodUse Euler’s method to solve the given initial value problem onthe interval starting at with .Compare the approximations to the values of the exactsolution.

0 2y y x y

0 1x 0 0x 0.1dx

Let me show you a new calculator program!!!

Page 11: Euler’s Method

x y (Euler) y (exact) Error

0 2y y x y 1 xf x x e

0 –2 –2 00.1 –1.8000 –1.8048 0.00480.2 –1.6100 –1.6187 0.00870.3 –1.4290 –1.4408 0.01180.4 –1.2561 –1.2703 0.01420.5 –1.0905 –1.1065 0.01600.6 –0.9314 –0.9488 0.01740.7 –0.7783 –0.7966 0.01830.8 –0.6305 –0.6493 0.01890.9 –0.4874 –0.5066 0.01911.0 –0.3487 –0.3679 0.0192

Page 12: Euler’s Method

Other Practice ProblemsUse differentiation and substitution to show that the givenfunction is the exact solution of the given initial value problem.

0 2y y x y 1 xf x x e

y x y x f x 1 xx x e

1 xe

1 xd dy f x x edx dx

1 xe

Initial Condition: 00 0 1f e 2

The same!

The same!

Page 13: Euler’s Method

Other Practice ProblemsUse analytic methods to find the exact solution of the given initialvalue problem.

1 ,dy x ydx

2 0y

1dy xdxy

21ln 12

y x C

2 21

x Cy e

2 21

x Cy e

2 2 1C xy e e 2 2 1xy Ae

Page 14: Euler’s Method

Other Practice ProblemsUse analytic methods to find the exact solution of the given initialvalue problem.

1 ,dy x ydx

2 0y

2 2 1xy Ae Initial Condition:

22 20 1Ae 20 1Ae

2A e

Solution:22 2 1xy e e

or 2 2 21

xy e

Page 15: Euler’s Method

Other Practice ProblemsUse analytic methods to find the exact solution of the given initialvalue problem.

2 1 2 ,dy y xdx

1 1y

2 1 2y dy x dx 1 2y x x C

2

1yx x C

Initial Condition: Solution:

2

111 1 C

1C

2

11

yx x