a numerical technique for building a solution to a de or system of de’s

11
Euler’s Method A Numerical Technique for Building a Solution to a DE or system of DE’s

Upload: tyrone-harper

Post on 25-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: A Numerical Technique for Building a Solution to a DE or system of DE’s

Euler’s MethodA Numerical Technique for Building a Solution to a DE or

system of DE’s

Page 2: A Numerical Technique for Building a Solution to a DE or system of DE’s

Slope Fields This is the slope field for

.2 1 .20

dP PP

dt

We get an approx. graph for a solution by starting at an initial point and following the arrows.

Page 3: A Numerical Technique for Building a Solution to a DE or system of DE’s

Euler’s Method

Dt

We can also accomplish this by explicitly computing the values at these points.

Here’s how it works.

. . . then we project a small distance along the tangent line to compute the next point, . . .

We start with a point on our solution. . .

. . . and repeat!

. . . and a fixed small step size Dt.

Page 4: A Numerical Technique for Building a Solution to a DE or system of DE’s

Projecting Along a Little Arrow

Dt0 0( , )t y

1 1( , )t y

Dy

Page 5: A Numerical Technique for Building a Solution to a DE or system of DE’s

Projecting Along a Little Arrow

Dt

0 0( , )dy

f t ydt

0 0( , )t y

slope

1 1( , )t y

= f (t0,y0) Dt

Dy = slope Dt

Page 6: A Numerical Technique for Building a Solution to a DE or system of DE’s

Projecting Along a Little Arrow

Dt

0 0( , )dy

f t ydt

0 0( , )t y

slope

1 1( , )t y

= (t0 +Dt , y0+ Dy)

= (t0 +Dt , y0+f (t0,y0) Dt)

Page 7: A Numerical Technique for Building a Solution to a DE or system of DE’s

Projecting Along a Little Arrow

old oldslope ( , )f t y

old old( , )t y

new new( , )t y

= (told +Dt , yold+ Dy)

= (told +Dt , y0+ f (told , yold) Dt)

Page 8: A Numerical Technique for Building a Solution to a DE or system of DE’s

Summarizing Euler’s Method

and a fixed step size Dt.

an initial condition (t0,y0), A smaller step size will lead to more accuracy, but will also take more computations.

You need a differential equation of the form , ( , )dy

f t ydt=

tnew = told + Dtynew = y0+ f (told , yold) Dt

Page 9: A Numerical Technique for Building a Solution to a DE or system of DE’s

For instance, if

and (1,1) lies on the graph of y, then 1000 steps of length .01 yield the following graph of the function y.

This graph is the anti-derivative of sin(t 2); a function which has no elementary formula!

2sin( )dy

tdt=

Page 10: A Numerical Technique for Building a Solution to a DE or system of DE’s

Exercise

Start with the differential equation , the initial

condition , and a step size of Dt = 0.5.

2dyt y

dt=

( )0 0, (2,1)t y =

Compute the next two (Euler) points on the graph of thesolution function.

Page 11: A Numerical Technique for Building a Solution to a DE or system of DE’s

Exercise

Start with the differential equation , the initial

condition , and a step size of Dt = 0.5.

2dyt y

dt=

( )0 0, (2,1)t y =

0 0

1 1

2 2

( , ) (2 ,1)

( , ) (2 .5 ,1 2(.5)) (2.5 , 2)

( , ) (2.5 .5 , 2 10(.5)) (3 , 7)

t y

t y

t y

=

= + + =

= + + =