Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... ·...

22
Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb p Ideam effpretend the solution is of the form ult IE Ci Oilt coyg.ae itsbasis functions defined on Ca b Possible choices of Pi's polynomials B splines trig functions 2 Then n Lt Ci Ct but also n Lt Gct u u so that t.Ecioh H.Ecioiu.Eeioitts fdt.E.ci EEtsiE EEF d t t t Unknown known known known known

Transcript of Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... ·...

Page 1: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Collocation Methodrnme

Want to solve the two point BVP

u fl t n ri act c buca L mlb p

Ideameffpretend the solution is of the form

ult IE Ci Oiltcoyg.ae

itsbasisfunctions defined on Cab

Possible choices of Pi'spolynomials B splines trig functions

2 Then n Lt Ci Ct but also

n Lt Gct u u

so that t.EciohH.Ecioiu.Eeioitts

fdt.E.ciEEtsiE EEFd t t tUnknown known known known known

Page 2: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

So we have n unknowns we'd like tocreate n equation

3 define a set of n cellocationpointsa L Ltd b

and resolve the systemE 9 Oilty L

EI H'EeioiaaiEI.i9EEwe now have the Ci'swe now have

NHK Ci 0 ltExamplemi

u ft Oct Cuco 0 uh I

Let's use t 0 tz Yz tz

and let's use 0 ft felt t 0ft t

Page 3: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

so that our approx Sohn

NCE C t Cz t t GEN'LE Cz t 2Gt W t 2cg

We'd like 20 Cts Gtwas.io wii

2

25 6 keGt Cz o O C t CE tCj I

c o Cz 0.5 Cz 1.5

and WH o t o s t t t.SE

note that the true solar is 3 u lotn 3 Eta

a O

uh I

Page 4: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

ExampleW t plait qH 2 Ltu a L ucb p

orderUse B splines Bik k 3

2 conf's derivatives 17013

choose the knots such thatti tip h t D

and use the knots as collocationpointsSo we want to approx theSol n ult byWtt jfcjo.ttwhere B splines chosen

Uj g jc

well

Page 5: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

satisfies

Eisz

Using prop's of B splines this leadsto a system of linear equations

for the coeff's G Cn

Ac b where

A is a banded matrixfast inversion is

g

Caosible

Page 6: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

CollocationforthYET fit y

want to solve

y off L over say Cto toth

Idema approximate the sokn y.ltby a polynomial pH

of degree n

htt parametersneeded

WantP tea f th Pttpito a

hit equations

Examplem n 2 trap rule

p to Yop Cto f to ptto

p toth f toth pltoth

Page 7: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

write p E g t toy 1 Cft to C

and so he for G Cz Cz

a yoCz f Lto p to

tCz f toth pltothP'Hoth

g fttothpctothD f to.pt2h

we now have

PCto the got f to PLtoDh1 f toth pCtoth oPD ht2h

p toth Yo t hzffftothgpltothD flt.plJhyT

yothzffCtoth y tfftoy

Page 8: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

T TImplicit egg in y

solve and repeatto get ya

Page 9: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Stiff Equationsrnmm

Solving IVP's using numericalmethods leads to errors thatinvolve a higher derivative ofthe solution

Problems can happen if themagnitude of the derivative increases

but the solution does notJVP's with this type of issueare called stiff

Example 8 Consider the IVP

09 Soc 24 2 5 cost kg suit

XI 2404 51 2 S cost t g sit04 o 413 213

Page 10: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

This has the unique soknx t zest FIE cost

show Fistdpecay dpecay oscillatory

out Est 2 Edt Ig cost

Here the Est term causes theequation to be stiff

derivatives of Ets cetteqE

How does this affect numericalmethods

In the example above RR4with h o 05 works just finebut RK4 with h oil blowsup 5553

Page 11: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

How can we predictfundersfoundstiffness when seeking numericalsolutions

AgmDFix the numerical method2 Examine the error it produceswhen applied to

the testequation

s

which has the Solh x e

interested in K o

Tompkins Euler's Method

No IWnt Wn t h f tu Wn

Twain

Page 12: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Wnt Wnt hXwn

fthDwnWn EhDnwT faff'd

approx

Truesolutionatfn Dh.INTabsolute

Reindeeings the Terror is

lactn conf lefhn 4th'D Iwhen Ko only decaysthis decays

to zero it

to zero 11h21 C l

we need I CHHIC I2 CHICO

J b vewe

So we need hf2 for Euler

Page 13: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

In other words bigger M requiressmaller step size even thoughthey solution o very fasttrue

Examptere Taylor method of orderk

Here non CHh7tELKt nthwnSo we'd want

KHh7tEhH that 81o o O

Tompkins Implicit Euler methodWnt Wnt hf try wut

when wnthn.com using

Page 14: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Wnt f ht Wn

wnef hHnw.TTso now we want

1 eth f LX f smallson T

want It Ext's1Always true It Ahl ai

when h o ft 7h17 Ihe the

Systemsoestiness

TuneIn e Fix a methodexamine on atest case

Examplemp IF

Page 15: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

tx LX t By occo

y Batty yes z

True some x Et taek Bt

yet eh t ek Pst

E_o d here would yield

Wnt Wn t h 2Wnt Bun Wo 2

Unt Vn h Bont dun godWn ah Ph t Ctdh BhVn ah PHY Chah Bh

wantSo we want IHdh tph 141

Hah PHILwant hczZ

Page 16: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

General linear multi step methods

Remark aaFni h bnif

general multi step method

Apply this to the test problem

I I Geo

to get q q Xh obn i

fan h7bDxn n n Cao h7bo7xn k o

ibsoknis.acombo ofterms an rn

where r is a root of 10 E

Page 17: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

KHE.tn bga 7gfah1bn DE

I characteristic polynomialOlle p z h7qc

Tfrom stability section

i

A stabilityWe've been considering a Xx

wite noroom

Page 18: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Let us now consider complex

Too 7 µ iv

now the sokn to E is

xcts ett entfcosvtisvtf.me're

interested in µ

So for a multistep method to

do well we want the roots of

EEkon.so.int IiiisTy

nIhistaETEgtgiO

Page 19: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Examp lee Implicit Euler is

A stable check

Implicit Trapezoid method

Wn Wn i t Ih fn tfn i isYun Tun i

also A stable bee0 Z Z l Ihf Z 1

C hDz HEHIt kHzhas root 2Iq

when he o RecA so

I E't fatthlutin Llt

TheommonaffipeifnufftasisformethetTimana

Page 20: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

RegionogAbsolutestabilitywww.tistepmethods

Idean want roots ofDCE plz ht qCZ to be

in unit disk so the multi stepmethod can work on the testprob

x Xx

So we are interested in E

i

A stable methods work for allh o other methods workwhen he is small enough

Page 21: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

Example s an In h ht Euler's method

then 0 Z E D tixI

Z l w Root i Hw

Region of absolute stabilityis WE Cio 1 It w I s I

it hits i lit her i hit a

TetherD L I

I t Eti 2hm htt Cl

Lyne v2 c 2hahe 2M v

Page 22: Collocation Method - math.ucsd.edursaab/teaching/2019Spring170C/Lecture notes 9 - Math... · Collocation Method rn me Want to solve the two point BVP u fl t n ri act c b uca L mlb

PracticalimplicationsTo use higher order methods we'dlike W THER Region of abs stab

When x Tx is our ODEwe just pick h so that 1h

ER

If you have a non hear IUP

x Ht Flt a a 1linearapprox