15
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

Embed Size (px)

Citation preview

Page 1: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

Euler’s Method

Section 6.6

Page 2: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

Suppose we are given a differential equation and initial condition:

,dyf x y

dx 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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

x y (Euler) y (exact) Error

0 2y y x y 1 xf x x e

0 –2 –2 0

0.1 –1.8000 –1.8048 0.0048

0.2 –1.6100 –1.6187 0.0087

0.3 –1.4290 –1.4408 0.0118

0.4 –1.2561 –1.2703 0.0142

0.5 –1.0905 –1.1065 0.0160

0.6 –0.9314 –0.9488 0.0174

0.7 –0.7783 –0.7966 0.0183

0.8 –0.6305 –0.6493 0.0189

0.9 –0.4874 –0.5066 0.0191

1.0 –0.3487 –0.3679 0.0192

Page 12: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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 e

dx dx 1 xe

Initial Condition: 00 0 1f e 2

The same!

The same!

Page 13: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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

1 ,dy

x ydx

2 0y

1

dyxdx

y

21

ln 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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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: Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization

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

1y

x x C

Initial Condition: Solution:

2

11

1 1 C

1C

2

1

1y

x x