0% found this document useful (0 votes)
48 views15 pages

MH4700 Notes

Euler's method is a numerical analysis technique used to approximate solutions to differential equations. It works as follows: 1. Discretize the time interval into mesh points with a step size h. 2. Approximate the solution Y(tn) at each mesh point as Yn, using the explicit formula Yn+1 = Yn + h*f(tn, Yn). 3. The error in each step is on the order of h due to truncation in the Taylor expansion. After n steps, the total accumulated error is on the order of nh.

Uploaded by

mbingyan001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views15 pages

MH4700 Notes

Euler's method is a numerical analysis technique used to approximate solutions to differential equations. It works as follows: 1. Discretize the time interval into mesh points with a step size h. 2. Approximate the solution Y(tn) at each mesh point as Yn, using the explicit formula Yn+1 = Yn + h*f(tn, Yn). 3. The error in each step is on the order of h due to truncation in the Taylor expansion. After n steps, the total accumulated error is on the order of nh.

Uploaded by

mbingyan001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

One-Step Method .

· Euler's Method [Taylor's Method of order 1 ,


Forward

1). Definition :

Mesh points :

ti =

atih Vi = 0 1, 2 , N in the interval [a b]


need
, . . ., ,

Because InLtn+a)
v
no
Step Size :

hi =

Fits-t:
always >0 ! know
to
[Explicit Mtd]
.

Let Yuctn) be an approximation for Yctn) Sit .

YuCtn+a) Yuctn) +hofctn


=

, YnLtnil
with Exact solution :

Yctn)

Differential equation with Euler's Method Y(tu) fath ynctnl) f(tn yn)
: =

=
. ,

2) Psedocode :

3) Error Analysis :

Since Yctn+h) By Taylor Expansion


Yctn+1) =

<
=Yctn) + h Y(tn)
.
+bY"(3n) for 3nECtn ,
tn+)

Hence Y(tn) =
-Yctn) + och) , Y"(3n) truncation error .

Y
Note that fith YnCtrl)=,

Thus the error for fith Ynctnl) Differential equation with Euler Method Och)
=

For Euler's Approximation :

Yutz= Ynth fcth Yn) ·

=
Yn+Och
i e
. . Zochy for each step of approximation .

After n
steps ,
the
accumulating error :
n .

och") :

nh och)
-
:
(tn-to) och)
·

① Therefore ,
the total error
:

Och) .

i e . . Ycth)-Yactull = B h .

for some BEIR depending on th .


② .
General bound for the error :

Let k =

max1 41 ,
M-
maxlY" its
Since Yatate) Yctn) +h Yctn) =

. + Y" (3n) for some 3nt (tn ,


tn+1)

y(tn+1) =

yctn) h yctn) +by"(3n)


+
·

for some Ent (tn , tnta)

3n)
So ente =

enth Sty entEh2Y"3n) .

Intel Itn) 21 +
h k) + Ihi
-

Thus , Itz1 1901 11thk) + IhiM

lea = (e) (1thk) + IhM


i e.
=(80)(1thk) + (1 + (1 + h() I hiM
:
11thk) ] IhiM
-

lea Hol Ith"


+21thk)"+
+ .

...

UK
e 1 V + r2+
+

...
+ rut =
I
Therefore ,
Ienl 10/21thk" + A thM .

eirc (1tr)"
Note that ,
inequality ,

lenl = (e) 21thks" +


1
.
EhM
k

i e
. .

-
Itol(1+(n-tolk)"+ EK- 1
. thM
Yo Y
marly
=
=
to =

P .

=>
lenk .
In

③ Asymptotic
.
Error
Analysis :

en= Yn-Yn= h Dn+Och2 ·

With DCt) s .
t . D'Ct) g(t) D(t)
=
- +

EY"Ct) ,
Dito) =

/y Yet
Y)
g(t)
=

=
)

This is to get a better approximation :

(By Richardson's Extrapolation)

Yctn) YnCEn) h. Dctn)+Och


-
=

Yctn) Yeuctn) 2h DCtn) + Och'


-
·
=

=>

YCEn) -

[2YnCtn) -yenctn)] =
Och
·
The backward Euler's Method & The Trapezoidal Method

1) .
Definition :
Recall Forward Euler Approximation fith Ynctnl)
,
=

Anyctn)
Backward At-h)
Approximation
:

Y(t) - h

sit .
fit ,
Yet) = AYCt-h)
Because its should be known . i e
. . Yct) = YCt-h) +
hofct Yctx) ,

X
[Implicit Mrd] i e
. . Yctit1) ~Y(ti) th fctits Ycti+1)) ·

, , Yo= Yo

<Same as Forward] With Error Analysis :

Mn-Ynl=Ochs ,
/Yit1 -

Yitzl= Och

2)
Absolutely Stable Method :

After n
steps ?
(1) .
Definition
:

Y'It xYt) =

,
X 0 lim
Yn im Yuctn)= mytotuh)
= =

0 h
- n
I
-

If Y fit =
,
y)8 .

(2) .

Examples :

⑦ Forward .
Euler's Method NOT
absolutely stable

Proof :

Yitz Yith fiti yi)


= ·

,
=

Yi+hXY : =
(1thX) Yi , Yo= 1 .

Hence ,
yn= (thX) Yn-1 =

AthX)Yn-z =
. ..
=
(1t hX)"

If mn= Em Ithx)" 0
=

Then 11thN1< 1 ) - 1s1thX < 1 Th .

i e .
.
-2hx<0
Since X so ,
then och >
This shows
ImYhtu) 0 is NOT for all h
=

So .
Forward Euler Method is NOT absolutely stable .

② .
Backward Euler Method Absolutely Stable

Proof :

Yitz= Yith fctite ·

,
Yits)
=

Yi th xYi+1= (1-hx) + yi
·

,
Yo= 1 .

= - "

Yn= (1-hx) 21 hx)


-

Yn (1 hx)
1
Yn z
= -
= -
-
=
-
...

If = m1-hx) =
En =

Then 11- hx) > 1


Since XCO ,
any step size >0
So
any h satisfies
Therefore ,
the backward Euler Method is
Absolutely Stable .
(This is to change implicit method to explicit method)

3) Fixed Points for Backward Euler's Method :

predictor formula
.

① Definition
.
:

Gcy) Yith fctite Yitz)


=
·

,
with first guess
:

Y1= Yith futi ·

,
yil

Then yet =

Yithofctite y ,1) j ,
=
0 1 2,
, ,
...

GCys
Y= GLY Y
Recall NA1 .
fixed -

point iterations =

Yi )
Yi +h ·
f (ti+1 ,

=Yith fctitz Yith fiti Will


F1
· ·

. ,
, ,

imgcy11: Yitz
Y
:

Ih < 1
Yi= gyts(
If I / <M Ft y , =
Yi+h ·
fcti+1 yes ,

=Yith ·

fctitz Yith f Ctitz Yi th fiti Yill)


,
·
, ,

Then hi n
Explicit ?
,
NOW

4. The Trapezoidal Method :

(1) .
Definition :

h
Recall the trapezoidal quadrature rule :
a
-
b

Safixdxfa Paxidx Sat =

fasdx+ fal fab dx a

Ifas + f(b))

With Error :

f(x) Paxs ↑ (x-al(X-b)


=
+

Safexs -Pq(x)dx= x)/(x-a)(x-d)dX= f(x)


=> Yeti+1) Ycti) -
=

St**isds = [Yti)+Y'ti+1)) -
is )"

(Here Y'(s) =

f(x) -

P2())

=
[fiti , till + fatits Y(tie))] ,
-

" 25i)

Hence Yit =Yitz[futi , yil+fctite Yitzl] , ,


Go Yo
=

Implicit With Error =

Och")

(2) .
The total error for Trapezoidal Method :

(After n
steps)

n .
Och= nh Och= (En-to) Och" -
·
=> It's of second order accuracy .

23) .

Trapezoidal Method is Absolutely Stable ·


(Yo Yo
= :

1)

Proof :
Yitz
=

Yi+ [fcti , yil+fcti+1 Yi+11] ,

yi
+

Exyi ExYi+1 +

E) (1 -

Ex)Yit= LI+ ExY : <)


Yitz = y
Hence .
Yn=("Yo= (EE)" S

= mI =

0 -
/ I
i e
. .
-1 < 1

Since 230 ,
x0 .
So 1-Exs0
-> -
-

1 +
Ex 1 +
Ex<1-EX ,
which always holds for all h.

Therefore trapezoidal ,
method is always absolutely stable .

14) .
Implicit to Explicit :
By Fixed -
Point Iteration .
Henn's Method .

g(y) yi +
=

[fcti yi) + f(ti , +1 , y))

with h must
satisfy :

1) myxy)-1 .

Y
*
= >
=

Yit [futi yi)+fctit1 Y , ,

with first guess :

= Yi+hifcti ,
yi)

y =

Yit[futi yil+fcti+1 yi11] , ,

=yi+ Ifuti yi)+fctita yithf (ti Yill]


,
, ,

Not
Absolutely Stable

Proof :
Yitz =

Yi + :

[fcti yil+f(titz
, , Yitz Yith futi
=
·
,
fill]
yi E xyi x(yi+ h fcti yi))
=

+ .
+ .
.
,

Yi+Ehxyi+Ehxyi+EChx)"y
=

=21 +
hx + Echx)"] Y :

Thus , Un :
[Ithx + EchNsY
"

= Yn = hm[ 1 thx + chx]" 0


=

11+ hx + EchX") < 1


i e . .
- 1<1thx+ = ChN2 < 1
-
<hx +
=24x2 0

i e . .
-< x(1+ Ehx) < O

As ho ,
XCO ,
this implies It Ehx >0
Hence ,
-

ICEXCO -

2 ChXCO
So , Ihx1<2 => h >
1
This shows Henn's Mod is NOT absolutely stable .
·

Taylor Method :

Recall Forward Enter Method is Tayor Method of order 1 .

From Taylor Expansion Yetit1) Y(ti) +h Yctil + 1 Y"ctil+


: =

·
.

...

where forward Euler Method just uses the first two terms of Taylor Expansion .

Yut) = -
Yt) + 2 cost , Yo =

1 .
Exact Solution : Y :

sint+cost

1) .
Example of Taylor Method of order 2 :

From Taylor Expansion :


Yctitz)= Yeti) + h ·
Ycti) + Y"ti) +Och's

[Y(4)] =

Y" (t) = -

Y(t)-2sint=Yct-2cost-2sint
Then , Yitz Yith 2-yi+zwsti) +
=
· .

Lyi-20st: -2sinti) with yo


:
1 .

Hence the at each Ochi) Yi+1 Yi+1


error
step is -

, .

After n
steps ,
nochc :

nh .
Och =

(An-to) Och's .

Therefore ,
the total error is ochi .

2). Example of Taylor Method of order 3 :

From Taylor Expansion


:

Yct+z) =
Yeti) +
h Y cti)
·
+ .

Ycti) + Y"<ti) .
+ Och")

[Y" <til]' =

Y +i) [Y(ti) 2c0st-2sint]'


= -
=

Y'ti) +2 sint-2cost=-Ycti) + 2 Sint


Then ,
Yetits)= Yetil +h ·
( Yti) + 200sti)
-
+ (Ytil-2costi-2sinti) + .
(- Yeti) + 2sinti)

Hence ,
the total error after n
steps
:

Och" .

3). General Formula for Taylor Method of order n :

(1) .
Differentiation on variable t :
+y) =
3)
.
Y (t) =

fit ,
Yct1)
Yt)
Y"(t) =

(t
Yc+1) ,
+
·

Yct) Chain Rule

ft (t , Yt1) +
fyCt , YC) Y'(t) ·

AYt1)
t ,

fit Ct Yct1)
-2nd-order
Est-order
ft)y It Yet) YCt Note & Sty fyt
Y (t)]' +L
=

Ct [Y
"

dt
·
=
= , , .

=[ftCt , Yrt) +
fyct , Yct1) YCt3 ·

-
fit YAI ,

=fit It Yt1) + fty Ct YCH) Y (t) fit Y) + fyy It Y [fet YA11]


>
+

fry ct Y)
·
·

, , ·

,
, , ,

+
fyCt YAI) ftCt YA1) ,
·

,
+ fyct , YA) ·

fyct YA) Y'ct) ,


·

=[ftt + 2 fty f + fyy f+ fy (ft+fyf)] it YA1)· :


·

(2) Taylor Method of order p accuracy :

Yitz
=
Yith-yi+ y, + ... +By with yo: Yo

Error=OchP of order
+
At Each Step ,
) Yp-YP Since yitz p

So Asymptotic analysis Yet-yact)=hP DCt)+och' /


*
error
:

The total error after n


steps : noch" = nh -
Och" (tn-to) Och") =
·
=

Och"/
By Extrapolation :
Yet ynct) hP Dct) + Och+1)
· = .

Yet Y2hct) <2 h) Dct) + OchP+1)


-
P = .

=>
Yct =

2 1(2"yncH -yzhct) + OchPt)

YC-YnCt= Yurt -

YnLt) -

# Y2hLt)
22P 2P
21 Y2n(t)
-
+
1
-1 Yurt)
-

= YnLt)-Yzh(t)
( Y(t) yart)+ 25Lynct) -Yen(i) If Y not known
=
.
·

Runge- Kurta Method :


Same
accuracy as Taylor's ,
but less computation .

1) Definition
.

of Runge :
Kutta Method of e2 :

(with Error Ochill

Yitz =

Yith FCti Yi ·

, ,
h) +Och sit .

Y-Yn= Och
where Fct y h)
, ,
=

Difct y),
+ b2 ·

fct + 2h ,
y Bh f(t y)
+ ·

① Asymptotic
.
error
:

Yet -Yn2t= Dit) h2+ h


-

② . Constant Setting
:

By Taylor Expansion f(x-h)+h) fex-h) +h f/cx-h) +


=
·

fix-h) + ....

With Yet -yets =


och") at each step .

2). Definition of Runge-Kutta Method of Order n


:
=
Error at each step =

Ochrf)

Explicit Method & NOT Absolutely Stable

3) . Tutorial 4 & Implicit Method


.
.
·
Multistep Methods :

Yetiff) Ycti) + Stiff


Yadt
Main idea :
=

. Adams
1 -
Bashforth Method :

EXPLICIT ?

1) .

Definition : Yitz =
Yi+E B fiti . .
,
yi) -fCti-1 Yi-xl] , Interpolation of degree 1 .

Two-step A-B Med .

Proof
let father-actwind
:

Let two points ti-e titit ,


he

Hence ,
P1Ct) =

(p02) K2ti-1)· + L1qCt) K2ti)


=

[Cti-t) K(ti-1) + (t-t=1)- K2til)


-

With the error ,


K2-P1Ct=Ect-tielt-tilk" (3i) By Interpolation Def .

/Pactidt 1 [3kcti)
*

So .
kcdt- =
-
Kuti-e

2) Error
.

Analysis :
St katdt=1Pactdt+ Eh K "(3i) ->
Error at each step :
Och"

Proof :

Since IKLH-Pacts) ECt-Ei) (t-tia) K "Bil


=
.

↳ h

>
I I ·
titl ti ti+1
en

Hence IS kitidt- Pactidt) Ikats -


Pacts/dt

>
Itch2dt=c .

h =

och

Note that , YI is approximate The total error after n steps Ochi.


:

⑦ (Yctn) yn)= (A40ch) + 1Y=-y)


-
Och'+och"= Ochi) =

2 Ye . is estimated by the Euler Method :

Ye Yoth Y:
:
.

So Ma-y1= och'=> Ochi+Ochi =

Och'

4) Definition of Two-Step A-B Method :

Interpolation of degree 2 .
With tiz ,
tia ,
ti

Yitz =

Yi +Ezh [23f(ti yi)-1bfcti-1 y =-1) + 5 fctiz Yi-z)


·

, , ,
Need to know Yo Y1 Ye , , .

Proof :

Let k2t :

f (t Yct) Y(t)
,
= =
P2Ct) =
(2017) ·

f(tiz) + (2=(t) fcti-2) + (22 (t) fiti)· ·

(t-ti -1) (t-ti) (t-ti-z) (t-ti-1)


L20(t) Fitis)
(ti- Ei)
:

,
L21(t) titts
=E ,
Lazt= -

(ti-ti-z) (ti-ti-1)

It /
* **
ktdt Pactsdt =
[23k(ti) -16(s(ti 1) 5kti 2)] -
+

-
2) Error
.
Analysis of Three Step A-B :
(Except initial values)
the

** kctdt= I Pctdt+5 hYk" (3) -> Error at each step Och") :

Proof :
Kuts Parti
-
=

= k"(3i) :

It-tiz) (t-ti-z) (t-ti) By Interpolation def .

h h h
I 1 1 => It- ticksh .
It-tickch , It-tilth
ti ti-I ti tit 1

So / Stidt /Pectsdt1= /kat) - -


Pacts/dtstite-ti) Och =
Och")

The total error after n-2


steps :
(n-2) Och") ·
=

(n-2) h Och"c= (tn-tz)


-
·
·
Och'= Och")

There are
many ways to estimate ya Yz
, .

By Second-order Runge-Kutta Method ,


/Y-yz)=Ochs M2-Yz)= Och' ,

Therefore ,
the total error after n
steps
:

Och'+Och') + Och'l= Och's

3). General Adams -

Bashforth Method :

For a (9+1)-Step A-B method using Interpolation Polynomial of degree


, a with + 1 points

The error at each step


:

Ochaty) .

The total error after n


steps
:

Ochat) =>
Asymptotic error :
Y -YhCt)= Dc h &+ Ochat·

By extrapolation to accelerate
convergence .
2 . Adams -
Moulton Method :
IMPLICITI
1) .

One-Step Adams -
Moulton Method :

Let kCt) =

fit Yct)
,
=

Yct) with points ti ,


titz .

/
*

Recall Main Idea Yetits) Ycti)


:

=
+

ct , YCt)dt

So . (Etidtfbactidt=(stite-t ·
kitil+ (t-til ·

Kutiteldt= [futi Ytill + futite Yctital)


, ,

Therefore ,
Yitz =
YitE [fcti yis+fctive Yixas] , , Implicit .

i e
. .

Trapezoidal rule (Absolutely stable)

2) Error .

Analysis :

Since k2t) P1Ct) + E k (Bi)Ct-ti)(t-tite)


=
"

By Interpolation of degree 1 .

Iti t-rich
t-titzh
,

So ket) Pact)-
= E h h
. .
=

Och2

Then IS Kuts -
Pactsdt1 /ket) > -

Pects/dt= Och At each step .

Mct) Yucts) -
=

(n-1) :

och)+M1-y11 Here y= by Euler's Med .

=(n-1)h Och" · +
/Y= -y=)
=
(An-t1) Och" + Och"
=Och
The total error ,
here , Ochi .

after n
steps .

SF putdt=/
= *

pactdt-22hk"(i)

1) .

Two-Step Adams Moulton Method - :

With points ti-1 ,


ti ,
titz .

Interpolating Polynomial Pact) .

Implicit .

Therefore Yitz yi+ *>[5 fctiff yi+1) + 8 f (ti yi)-f(ti-1 Yi-1l]


. :
=
, , , ,

2). Error Analysis


:

Similar to Adams Bashforth Method -


.

⑦ . At each step
:

Error=Och" .

② Total
. error , after n
steps
=

Och .

S* S
**

KCt) At= Pactdt+h4k 5i)


predictor formula
y *1 Yi = +
h fiti yi)
·

3). Implicit Explicit


,
->
:

For Two-Step Adams -


Moulton :

PjyI= yith fitite yes , , y*: With fitite yes ,

. . . . .

=> P1 =

Yi +h f (tit1 ·

, Y! (
=Yi +h ·

fctite With fcti yil)


,
·

This is
by support of theory :

1)=12(Yi+2[5ftitz Yitz) 8 frti yi)-fcti 1


Yi)/<1 VE y
+

,
, ,

, .

2y

If hi
maxIy7
.
3 Comparisons of Adams -

Bashforth & Adams -


Moulton :

(h/k "(3i)))
① Second Order
. AM's error (Ehlk"(Bill) - Second Order AB's error

Similar for nith order AM's error - AB's error .

② .
AM :

Implicit ,
AB :

Explicit .

③ .
AM :
Absolutely stable .
AB NOT :

Proof :

Consider two-step AB method ,

Ditz =

Yi +
Eh[3f(ti yi)-fctie , , yi-zl)
Since Y'ct) fct y) x yct)
:

,
=

with x<0
So Yitz Yi+Eh[3 xycti) -xycti-Al]
=
.

(Eh-3x+ 1) yi Eh xYi-1
= - .

A difference equation Yitz (I+Ehx) Yi+Ehxyi-1 0


:
=
-

↳ E>

~S t .
r-2 + Ehx)r+

Un= C1 Vo+Cz Va
·
Ehx

.
=

E)
with roots
nee

(r-VoSCV-V)
Vo

=
,
VI

v=cro+V)U+roV
.

nimYn= m ro+(V) 0 =
IrokI IVK1
=
-

So IEhNc1 i e . .
IhIX , > h >
conflicts Uh .
4. General Multistep Method :

1) .
General Two-Step Multistep Method :

Yitz Yi +As Yiz th [D- fCtit Yitz) +Do fcti yi)+D1 fctin Yi-zl]
SEE
=

do . .
.

, ,
.

⑦ .
Adams -

Bashforth :

Yitz
=

Yith [Efiti
.
,
yi) -Efcti-z , Yi-11]

② Adams Moulton Yitz Yith [ futies Yit) + fiti yi) -F2fct-1 yi-zl]
=
- ·
:

, ,
.

You might also like