COSC 336 Numerial Analsis I Ordinar Dierenial Equaions I - Inroduion Edgar Gabriel Fall 5 COSC 336 Numerial Analsis I Edgar Gabriel
Terminolog Dierenial equaions: equaions onaining e derivaive o a union as a variable An ordinar dierenial equaion ODE onl onains unions o one independen variable A parial dierenial equaion PDE onains unions o muliple independen variables and eir parial derivaives Te order o a dierenial equaion is a o e iges derivaive a i onains Te goal is o ind a union wose derivaives ulill e given dierenial equaions, e.g.,,,,..., n n COSC 336 Numerial Analsis I Edgar Gabriel
Iniial value vs. boundar value problems Addiional equaions required or unique soluion o e ODE s: Iniial value problem :, a b a Boundar value problem, a b a b n COSC 336 Numerial Analsis I Edgar Gabriel 3
Example rom meanis: modeling e suspension x Car m d w Damper Spring k w x Weel m w ux Sree Spring kw m m w k w k w w d d w w k w u w COSC 336 Numerial Analsis I Edgar Gabriel 4
5 COSC 336 Numerial Analsis I Edgar Gabriel Transorming ODE s o order > An ODE o order > an alwas be ransormed ino a ssem o ODEs o order Example: Deine: 5: beomes en onl dealing wi s order ODEs z z 5: z z z z z o 5: z z
Some eorems I Exisene Teorem or iniial-value Problems: I is oninuous in a reangle R enered around en e iniial value problem α, β, a a soluion or min α, β / M wi on R M max, COSC 336 Numerial Analsis I Edgar Gabriel 6
Some eorems II Uniqueness eorem or iniial-value problems I and are oninuous on e reangle R deined previousl, en e iniial value problem as a unique soluion in e inerval min α, β / M COSC 336 Numerial Analsis I Edgar Gabriel 7
Approximaing soluions o iniial-value problems I Given: d, d a a b 8: B replaing e derivaive b e dierene quoien d d ou an alulae an approximae soluion or 8:,, 8: COSC 336 Numerial Analsis I Edgar Gabriel 8
Approximaing soluions o iniial-value problems II Goal: deermine x a disree poins Deine: i i b Na i Using 8: one an derive e algorims Inpu,a,b,N, b-a/n or i :N i i-,i- end COSC 336 Numerial Analsis I Edgar Gabriel 9
Grapial inerpreaion Sine, e evaluaion o, alulaes e slope a a given loaion. a a a COSC 336 Numerial Analsis I Edgar Gabriel
Approximaing soluions o iniial-value problems III Te meod presened so ar is known as Euler s meod I is a speial ase o e Talor series meod i.e. Euler s meod is e Talor series meod o degree Euler s meod requires One union evaluaion or ea new poin No derivaives o as o be small or aepable preisions COSC 336 Numerial Analsis I Edgar Gabriel
Example using Eulers meod Given:.5 COSC 336 Numerial Analsis I Edgar Gabriel
Talor series meod I Generalizing Euler s meod, ake e Talor series e.g. 3! 3!... Te appearing derivaives an be obained rom e dierenial equaion Te order o e meod i e las power o wi is used Te runaion error is e irs power o wi as no been used 4 4! 4 3: COSC 336 Numerial Analsis I Edgar Gabriel 3
Talor series meod II Given: os sin 3 Derive e algorim or e aording Talor series meod o degree 4 To generae 3:, we need o deermine e ig order derivaives o rom e dierenial equaion 4: sin os sin os os 4 sin os 3 sin 3 os x 4: 4: 4:3 4:4 COSC 336 Numerial Analsis I Edgar Gabriel 4
Talor series meod III - Algorim Inpu a,b,, Nb-a/ or i :N alulae as in 5: alulae as in 5: alulae as in 5:3 alulae 4 as in 5:4 i i- / /3 /4 4 end COSC 336 Numerial Analsis I Edgar Gabriel 5
Error esimaes Loal runaion error: error made in one sep b replaing e ininie Talor series b a inie one Loal roundo error: error made in one sep due o e limi preision o e ompuer Global runaion error: aumulaion o all loal runaion errors I loal runaion error is o order O n, e global runaion error is o order O n, sine e number o seps is inal - / Global roundo errors: aumulaion o all loal roundo errors in prior seps Toal error: sum o global runaion and roundo error COSC 336 Numerial Analsis I Edgar Gabriel 6
Talor series meod Pros Simple Wi a large number o derivaives e meod an produe good approximaions even or large values o Cons Meod depends on e availabili o e derivaives Large amoun o preliminar work Calulaions per sep an be ver large COSC 336 Numerial Analsis I Edgar Gabriel 7
8 COSC 336 Numerial Analsis I Edgar Gabriel Runge-Kua Meods I Te Talor series or is To deermine e derivaives o rom e ODE, one an wrie generall Tus, 8: an be rewrien as... 4! 3!! 4 4 3, ',, 8: 8: 3 O 3 O
Runge-Kua Meods II On e oer and, e Talor polnomial in wo variables an be wrien as, Hene 8: beomes O,,, O To alulae aording o 9: one ould do s, s, s s s nd Order Runge-Kua meod or Heun s meod 3 9: COSC 336 Numerial Analsis I Edgar Gabriel 9
Runga-Kua Meods III General ormulaion o nd order Runge-Kua meods: 3 ω ω α, β O wi ω, ω, α, β being parameers a our disposal. B rewriing : as in 8: and b omparing e parameers o 8: e ollowing ondiions or e parameers arise: ω ω ω α ω : :4 β : COSC 336 Numerial Analsis I Edgar Gabriel
Runge-Kua Meods IV Equaions :-:4 are over deermined and ave ereore several soluions: ω ω α β Heun s meod ω, ω α β modiied Euler meod COSC 336 Numerial Analsis I Edgar Gabriel
Grapial Inerpreaion e.g. nd order Runge-Kua: averaging e slopes a and a Slope : a avergage o Slope and slope Slope : a a a/ COSC 336 Numerial Analsis I Edgar Gabriel
4 order Runge-Kua Te lassial Runge-Kua algorim s, s, s s 3, s s 4, s3 s s s3 s4 6 COSC 336 Numerial Analsis I Edgar Gabriel 3
4 Order Runge-Kua II Inpu a,b,,, Nb-a/ a or i :N s * eval,, i- s * eval, /, i-s/ s3 * eval, /, i-s/ s4 * eval,, i-s3 i i- /6s*s*s3s4 end COSC 336 Numerial Analsis I Edgar Gabriel 4
5 COSC 336 Numerial Analsis I Edgar Gabriel General Runge-Kua ormulas General ormulas or iger order Runge-Kua meods: wi Buer oeiien seme m i i s i ω m i ω i, m j j ij i i s a s and m j i a ij m mm m m m m m a a a a a a a a a ω ω ω T D L R A A A ω
General Runge-Kua ormulas II i A R A D : explii Runge-Kua ormulas i A R : semi-implii Runge-Kua ormulas else: implii Runge-Kua ormulas Example: Buer oeiien seme or e 4 order Runge-Kua 6 3 COSC 336 Numerial Analsis I Edgar Gabriel 6 3 6 Explii Runge-Kua ormula