4//3 Leture 6 Fnte erenes and Boundar Value Problems Numeral derentaton A nte derene s an appromaton o a dervatve - eample erved rom Talor seres 3 O! Negletng all terms ger tan rst order O O Tat s te orward derene - also bakwards and entered derene O O W s entered nte derene O( )? 3 O! 3 O! Subtrat seond equaton rom rst 3 O O We an ombne Talor seres epansons n man derent was to get estmates o dervatves Eample: bakwards seond dervatve, O( ) Start wt 3 4 O! 3 4 4 8 O! 3 4 3 3 9 7 O! Multpl rst equaton b -5, seond equaton b 4 and add togeter 3 4 5 5 5 5 5 O! 4 + 4 4 8 6 3 O! 4 5 4 3 7 O!
4//3 Multpl trd equaton b - and add to above result 4 5 4 3 7 O! 4 + 3 3 9 7 O! 4 5 4 3 O! Rearrange 4 3 O Were dd I get -5, 4,-? We multpl st equaton b a, seond b b, trd b a b a a b b 3 3 a! 4b! 9! 3 4 a O 3 4 8b O 3 4 7 O Now sum all equatons and ollet terms a b 3 a b a b 3 3 4 a 4b 9 a 8b 7 O! ede wat dervatves we want to make dsappear - want a seond dervatve onl - elmnate rst and trd a b 3 a 8b 7 Tree unknowns - equatons - make an assumpton Let =- Can solve b and a b 3 a 8b 7 a 5 b 4 I we ave more dervatves to get rd o, use matr metods - alwas one assumpton Fnte derenes are used EXTENSIVELY or partal derental equatons (PEs), and more omplated OEs You sould reognze tpal rst and seond dervatve ormulas Boundar value problems Value o unton s known at two ponts - usuall end ponts Metods to solve sootng metod nte derene approa "
4//3 Idea bend sootng metod onvert boundar value problem (bvp) nto a set o ntal value problems solve b tral and error Eample: uson between two ponts, soure/snk d d soure Ambent onentraton Snk Let L= m =. = mg/l =5 mg/l =mg/l Splt nto two rst order odes d d gves us d d d d o We ave an ntal ondton or ( =5) We ave NO ntal ondton or! Wat to do? Guess a value, do ntegraton and ten make anoter guess Gven =5 mg/l, =mg/l, L= m, tr d d d d 5 o Use Euler metod 6 5 4 3 3.56 4 6 8 Reall = 3
4//3 Tr a derent value - ()=- Use Euler s metod agan 6 5 4 Orgnal OE s lnear, so use lnear nterpolaton between tem d Wen, 3. 56 d Wen d, 4. 94 d 6 3 4 4.94 -.4 8 4 6 8 -. -.9 -.7 -.5 -.3 -. -.9 6 4 6 Now we know te orret ntal ondton or () 6 ()=-.4 5 4 3 oversoot 3.56 4 6 8 6 5 4 5 3 4 undersoot 4.94 3 4 6 8. 6 5 4 3 4 6 8 Just rgt. 4 6 8 Wat about nonlnear problems - an t do lnear nterpolaton Agan, a tral and error proess Turn t nto a root-ndng problem Eample o a nonlnear problem o te usual substtuton d d 5 d d d d d d 5. (smaller ) 4
4//3 Assume a value or () (=k) and perorm ntegraton Te ntegraton elds (k) I k s orret, (k)-()= 6 5 4 3 Can use an root ndng metod to nd k were (k)-()= d Eample ontnued d d d Use bseton Tr ntal values or () o - and -5. 4 6 8 In lnear ase, wen k=-.4, (k)==() ()=- (-)- > ()=-5 (-5)- < 6 6 5 5 4 3 33.76 4 3 4 6 8 - -3.5 4 6 8 We ave braketed a root Now tr ()=-3 ()=-3 6 (-3)- < 5 4 3 5.38 4 6 8 5
4//3 6 ()=-.55. 3 4 5 6 4 6 8 (-.55)- = Eventuall, Fnte derene metod or BVPs Reall d d Substtute d d Rearrange terms Apples or all nteror nodes ( s) wen s rst or last, boundar ondtons appl Set up n matr orm L n Solve b an matr metod d d Wll also work or nonlnear problems - more omplated equatons, and need to use nonlnear matr solvers Ts messes tngs up Wat to do? Iterate - assume a value or all s and plug nto rgt and sde Solve and use new values o n rgt and sde Repeat untl onverged
4//3 Matlab eample or lnear nte derene metod Stablt o metod depends on ) startng guess, and ) step sze 7