Numerical Solution of Ordinary Differentiation Equations

Size: px
Start display at page:

Download "Numerical Solution of Ordinary Differentiation Equations"

Transcription

1 Numerical Soluio of Ordiar Differeiaio Equaios

2 Oulie Boudar value problem Shooig mehod Fiie differece mehod Higher-Order Equaios ad Ssems Summar of Chaper 6 Numerical Mehods We-Chieh Li

3 Boudar Value Problems Le s cosider solvig a d-order ODE " f Iiial Value Problem IVP Codiios are give a he same poi Solve " f give a ad a Recall ha auiliar codiios are eeded for solvig a h-order ODE! Numerical Mehods We-Chieh Li 3

4 Boudar Value Problems Le s cosider solvig a d-order ODE " f Iiial Value Problem IVP Codiios are give a he same poi Solve " f give a ad a Boudar Value Problem BVP Codiios are give a differe pois Solve " f give a ad b Numerical Mehods We-Chieh Li 4

5 Boudar Value Problems co. Auiliar codiios are ofe specified a boudaries of he domai so he problem is usuall called Boudar Value Problem From Wiipedia Numerical Mehods We-Chieh Li 5

6 Shooig Mehod Covers he boudar value problem io a equivale iiial value problem Numerical Mehods We-Chieh Li 6

7 Eample: Shooig Mehod Solve for aliude of roce give = -g g = 9.8 m/s 0 = 0 lauch from groud 5 = 40 reach 40 m off groud afer 5 secods 5=40 0=0 Numerical Mehods We-Chieh Li 7

8 Numerical Mehods We-Chieh Li 8 Eample co. Use Euler s mehod o solve he IVP wih differe guesses of iiial speeds g g h v

9 Soluios obaied wih differe iiial speeds v 0 usig h = 0.5 Correc aswer is 3.5 Eample co. Paul Hecber hp:// Numerical Mehods We-Chieh Li 9

10 Soluios obaied wih differe iiial speeds v 0 usig h = 0. Error is due o he iaccurac of Euler s mehod Beer accurac ca be achieved usig oher mehods Eample co. Numerical Mehods We-Chieh Li 0

11 Eample co. Iiial speed fidig ca be cosidered as a roo fidig problem. 0 Le v be he soluio curve wih iiial 0 codiios 0 = 0 ad 0 = v 0 The iiial speed v 0 ha saisfies he boudar codiio 5 = 40 is he roo of P 0 v0 0 v Numerical Mehods We-Chieh Li

12 Roo-Fidig for Shooig Mehod 0 v 0 5 v 0 = 3.5 s v 0 g v 0 Numerical Mehods We-Chieh Li

13 Roo-Fidig for Shooig Mehod For liear BVP Pv 0 is liear ad we ca obai he correc aswer b ierpolaig bewee a pair of compued values For oliear BVP Pv 0 is oliear; roo fidig mehod ca be applied Numerical Mehods We-Chieh Li 3

14 Roo-Fidig for Shooig Mehod If Pv 0 ad is derivaive fucio are available Newo s mehod ca be used I geeral Pv 0 ad dpv 0 /dv 0 are complicae or uavailable seca mehod is recommeded sice i ol eeds fucio values Numerical Mehods We-Chieh Li 4

15 Eample: Noliear BVP Paul Hecber hp:// 5

16 Eample co. Paul Hecber hp:// 6

17 Eample: Shooig Mehod hp:// Numerical Mehods We-Chieh Li 7

18 Fiie Differece Mehod Covers BVP io ssem of algebraic equaios b replacig derivaives wih fiie differece approimaio Cosider solvig a wo-poi BVP " f a Divide [a b] io subiervals b 0 =a i = i =b a h b a i =a+ih Numerical Mehods We-Chieh Li 8 b

19 Fiie Differece Mehod " f Solvig ca be covered io solvig a ssem of algebraic equaios i i i i i i " i h h i i i i i h f i i 0 h The ssem ca be liear or oliear depedig o wheher f is liear or oliear i ad Numerical Mehods We-Chieh Li 9

20 Numerical Mehods We-Chieh Li 0 0 h f h i i i i i i i Eample: fiie differece mehod Solvig = -g wih 0=0 5=40 Usig he formula Dividig [05] io 0 subiervals we ge 0 g h i i i g h i i i

21 Eample co. = -g 0=0 5=40 i i i h g Solvig liear ssem A=b =

22 Iiial speed is 30.05liear es. 3.5 quadraic 3.5 correc Eample co. Numerical Mehods We-Chieh Li

23 Numerical Mehods We-Chieh Li 3 Higher-Order Equaios ad Ssems Recall ha a higher-order equaio ca be covered io a ssem of s-order equaio 3 f... f d d " 3

24 Numerical Mehods We-Chieh Li 4 Higher-Order Equaios ad Ssems -dimesioal ODE ca be formulaed as a ssem of s order equaio Eiher case ca be hadled as solvig a ssem of s-order ODEs f f f f

25 Eample: Ssem of wo s-order ODEs Solvig d d 0 d 0 d Equivale o solvig 0 Numerical Mehods We-Chieh Li 5

26 Numerical Mehods We-Chieh Li 6 Eample co. Solvig Usig Euler s mehod 0 hf h h h

27 Numerical Mehods We-Chieh Li 7 Eample co. Solvig Usig Ruge-Kua mehod f h f h f 3 h f h hf h

28 Numerical Mehods We-Chieh Li 8 Eample co. Solvig Usig Ruge-Kua mehod 0 h hf h h h 6 4 3

29 Eample co. Compue 3 4 accordigl we ca obai Trace he eample o pages of he eboo b ourself! Numerical Mehods We-Chieh Li 9

30 Summar of Numerical Soluio of ODE Visualizaio of umericall solvig ODE Error Global error vs. Local error Propagaed error Sabili Sabili of aalical soluio Sabili of umerical soluio growh facor Solvig iiial value problems Solvig boudar value problems Numerical Mehods We-Chieh Li 30

31 Solvig Iiial Value Problem Sigle sep mehod Euler s Mehod Ruge-Kua mehod Mulisep mehod Adams mehod Mehods of udeermied coefficies Adams-Moulo mehod Predicor-correcor scheme Siff equaios ad implici mehod Numerical Mehods We-Chieh Li 3

32 Solvig Boudar Value Problem Shooig mehod Fiie differece mehod Numerical Mehods We-Chieh Li 3