Integrtion COS 33
Nuericl Integrtion Proles Bsic D nuericl integrtion Given ility to evlute or ny, ind Gol: est ccurcy wit ewest sples Clssic prole even nlytic unctions not necessrily integrle in closed or Oter proles uture lectures: Multi-diensionl integrtion Ordinry dierentil equtions Prtil dierentil equtions G = d e t dt
Qudrture Sple t set o points Approite y unction Integrte unction Alterntives: it single unction vs. ultiple piecewise Even vs. uneven spcing
Trpezoidl Rule Approite unction y trpezoid
Trpezoidl Rule d
Etended Trpezoidl Rule d d n Divide into segents o widt, piecewise trpezoidl pproition
Trpezoidl Rule Error Anlysis How ccurte is tis pproition? Strt wit Tylor series or round idpoint 4 4 4 3 6 E d
Trpezoidl Rule Error Anlysis Epnd LHS: Epnd RHS: 0 0 4 5 90 3 4 d [ ] E E = 0 0 4 4 9 4
Trpezoidl Rule Error Anlysis So, E = 3 5 4 480 In generl, error or single segent proportionl to 3 Error or sudividing entire intervl proportionl to Cuic locl ccurcy, qudrtic glol ccurcy Ect or liner unctions Note tt only even-power ters in error:, 4, etc.
Deterining Step Size Cnge in integrl wen reducing step size is resonle guess or ccurcy or trpezoidl rule, esy to go ro / witout wsting previous sples
Sipson s Rule Approite integrl y prol troug tree points d 6 4 5 O Better ccurcy or se # o evlutions Glol error O 4, ect or cuic! unctions Higer-order polynoils Newton-Cotes: Glol error O k or k odd, O k or k even
Ricrdson Etrpoltion Better wy o getting iger ccurcy or given # o sples Suppose we ve evluted integrl or step size nd step size / using trpezoidl rule: Ten = = 4 / 4 β α β α 4 3 / 3 4 O =
Ricrdson Etrpoltion Tis trets te pproition s unction o nd etrpoltes te result to =0 Cn repet: 8 6 4 8 / 4 / / O O O O /3 4/3 /5 6/5 /63 64/63
Open Metods Trpezoidl rule won t work i unction undeined t one o te points were evluting Most oten: unction ininite t one endpoint 0 d Open etods only evlute unction on te open intervl i.e., not t endpoints
Midpoint Rule Approite unction y rectngle evluted t idpoint
Etended Midpoint Rule d 3 d Divide into segents o widt :
Midpoint Rule Error Anlysis ollowing siilr nlysis to trpezoidl rule, ind tt locl ccurcy is cuic, qudrtic glol ccurcy Surprisingly, leding-order constnt is ½ s ig! Better tn trpezoidl rule wit ewer sples orul suitle or dptive etods nd Ricrdson etrpoltion, ut cn t lve intervls witout wsting sples
Etended / Adptive Midpoint Rule Cn cut intervl into tirds:
Liits t Ininity Usul trick: cnge o vriles d = / t / t dt Works wit, se sign, one o te ininite Oterwise, split into ultiple pieces Also requires to decrese ster tn / Else need dierent cnge o vriles, i possile!
Oter Qudrture Rules Nonunior spling: copleity vs. ccurcy Clensw-Curtis: Ceysev polynoils Cnge o vriles: =cos θ Sple t etre o polynoils T-sed lgorit to ind weigts Gussin qudrture Optiize spling loctions to get igest possile ccurcy: O n or n spling points
Discontinuities All te ove error nlyses ssued nice continuous, dierentile unctions In te presence o discontinuity, ll etods revert to ccurcy proportionl to In generl, i te k-t order derivtive is discontinuous, cn do no etter tn O k Loclly-dptive etods: do not sudivide ll intervls eqully, ocus on tose wit lrge error estited ro cnge wit single sudivision