Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Section 2.

7 Euler's Method

Related to the idea of

approximate slope linearization



y=f(x )

:÷÷E
linear

*
approximate
value
by
along
the
tangent
line .
① Sketch Solis
y '=y2
x2
Chi)
-

Through
ya)=1 ( Iit) ② Approximate
what YG)
is

"

:¥÷
÷
Ii
I
.
7- 1. I
Use Euler's Method
sx= I
B.✗=L
2

SHE

••-=•

→\• (2,375)

1.5 ↳ (2,
-

)
23
we start at a point
Euler 's Method Linearization ( Xo, Yo ) y(Xo)=Yo
:

# Y-Yo=m(✗-×#
equation MCX Got Xo ) 8-
linear
approximations
Y
-

[
the
line toy along
through
)
I tangent line .

Ho ,Yo
with SHM
starting slope
step size
value
y
I
"
'

is
y
m

precisely
'
evaluated
y
at (1-0,40)
Use !

x-ramey-rauee.at?-a .n*
linear approx

y'=y•_ ¥_•?→•
ycttyotmcx xD

|Y"
Goat
-

find +
Tx
an

approx
yy
! Kayo)
toys) :

step size : 1=S×

( Iit ) 1 y' =P P=§


-

y= 1+0111=1

( 2,1) 2 1

YG)I1
?⃝
y Yotmsx
__

|ycD_ F:÷:÷¥÷÷÷÷
x2
(3%1)
y '=y2 ←
:
-

:
slope
with
step size :& 1
z
↳ no

linear
point ×vatue_ yvakx_ y'_ newy_ approx

Irl )
g. (3.1--1+1-210)=1
?
( 1 -1
y '=y -5=1-1--0

(3-2,1) 1.5=22 1
y'=P (?)?
- -1.25
y(2) -1+(-1%5)'s
(2) •
)
375 2 0.375 ✓ I

Y (2)
=/
-1.22£
=
• 375 .
|ycD=Ñ-
x2
Step size
y=Yotm( ✗ -
Xo )
y '=y
'

II
-

Y'atlxoiso)

point xvatue grated y'_ newy_


:P F- 0
( 1,1 ) y( 1.253=1+0 (Dx)
'
1 1 -

y =/ +0144 )
? =/
( 1.25.1) 1.25 1
Y' =P -11.251
-0.5625
=
Y( 1. 5)
=

=
1+(-0.562%4)
• 859375

( 1. 5,9859) 1.5 0.859375


'
:( 8593757-11.58 y( 1.75)=
y
. •
.

= -
1.5115 859375 •


.

?
+ C- 1.5115
1. 75 0,4815 y
'
-
(0.48157-11.75) y( 1.75)
-50.481g
= -2.8307

2 2 y (2) = 0-4815-+1-2.8307 )¥
Use Euler's Method


Know Ito )
y
-
Euler 's Method
fee = felt y
-
,
) what is
yctn) ?
NY ← This slope
y, - - - -
-

gives

-¥÷"§÷÷T
to solution .

know Ho) yo
y
-
-

Yo
- -

unknown

to
W.IE?sega9nwTgEnHhrottmgidd
line with slope f- Lto , yo )
t,

① To approximate y Lt ) .
move
along tangent line
of
tangent line at ( to Yo )
eqn .

at t ,
y
(y yo )
-
= fltoryo ) ( t to
-

) is

Ylti )
Y got f- Ito yo ) ( t to)
-
-
=
,
I
so #=yotftytt)

^
Now we are at (ti ,
Yi )
"" " " different " *

"÷µ,,
at Lt , , Yi)
\

s-lt.is )
.

Remember there are


direction field slopes
If It at
in t
point
every plane
y
-
.

Move along this new tangent line .


to get
approximation For
ylta )
Yi
+ flt , , y , ) ( ta to )
ya
-
=

-
At
Continue this process until final t value is reached .
?⃝
?⃝
yo )
( to ,

Yo f- (to ,yo)dt tistotst


Yi
+
=
,

Ya
=
Y ,
+ flt , , g.) It , ta=t ,
+ It

f- (ta )St
Y3= Yat ya , ,
.
. .
.

Loops ! Pseudocode .

define It
, Yo ,
to -

Loop over K R = 1 ,
- - -

YK-itfltt-nyr-DIttr-tk.it
,

Yk=

[
It

loop .
Matlab Example deltat = 0.25
;
1
Pseudocode
0.5

dettat =
_ 0.25
on

b- =
to : deltat : T ; establish b-
array .

( size It )) ; establish
y zeros
y array
=

yen
=
-

first
I
value
Y nwmd (g) ; values
n =
number of
y .

not
b- =L
necessarily
[
for i = 1 : n -
I

f- =
-ti2 ; Put in formula .

Yl =

y
+
Etat
0 end .

plotlt.ge#hold-Z
[ transpose Lt)
,
transpose (g) ]

I. to

You might also like