Introducton to umercl Integrton Prt II CS 75/Mth 75 Brn T. Smth, UM, CS Dept. Sprng, 998 4/9/998 qud_ Intro to Gussn Qudrture s eore, the generl tretment chnges the ntegrton prolem to ndng the ntegrl w d The uncton w s ntroduced to hndle nnte ntervls, nd unctons tht hve sngulrtes n the ntervl o ntegrton. 4/9/998 qud_
Intro to Gussn Qud. Cont. gn suppose we know t dstnct ponts {,,, } nd consder the nterpoltng polynoml tht ppromtes t these ponts the nterpoltng polynoml s never ormed eplctly ut ntegrls o the Lgrnge polynomls re determned nd yeld vrous rules Smpson s, trpezodl, mdpont, w d L w d L w d 4/9/998 qud_ Intro to Gussn Qud Cont. The re clled the weghts The ormul s clled the qudrture rule ll the rules so r hve ths structure The rule ntegrte ectly ll polynomls up to certn degree, sy o degree d d s clled the degree o precson o the rule 4/9/998 qud_ 4
Intro to Gussn Qudrture Hence our ntegrton rule cn e wrtten s w d E Lst tme, we sw tht the or ed, the method o undetermned coecents llowed us to pck the weghts so tht the rule correctly ntegrted polynomls up to degree d-. 4/9/998 qud_ 5 Intro to Gussn Qudrture In the method o undetermned coecents, only the weghts re treted s unknowns. Demndng tht polynomls o degree - or less e ntegrted ectly gves use equtons we cn use to solve or the weghts. Cn we do etter, we choose the s well? 4/9/998 qud_ 6
4 4/9/998 qud_ 7 Intro to Gussn Qudrture The nswer s yes! Creully choosng the s well llows the rule to ntegrte polynomls o up to degree -. These re the Gussn qudrture rules. Guss 84, Jco86, nd Chrstoel 877 derved generl ormuls or the nd or mny choces o w. 4/9/998 qud_ 8 Emple - Gussn Qudrture s eore, t s eser to work on stndrd ntervl -, nd then trnsorm to,. d d d c d t dene w c d gves vrles chngng ξ ξ
5 4/9/998 qud_ 9 pont Gussn rule We look or rule o the orm We requre E0 or {,,, } E d 0 : : 0 : : 4/9/998 qud_ 0 pont Gussn rule cont. The lst equton ollows rom the nd, so These equtons gve : 0 : : 0.57750698966
Generl ormuls or Gussn Qudrture The modern theory o Gussn ntegrton or rtrry w, s lrgely due to Jco nd Chrstoel, who used the theory o orthogonl polynomls. They showed tht the or n -pont Gussn rule wth weght uncton w re the zeros o the th orthogonl polynoml determned y w nd the ntervl. 4/9/998 qud_ Mthemtcl nterlude... Orthogonl polynomls re dened y p pm dw p pm c δ, M c s then the polynomls re clled orthonorml. the p cn e constructed or w usng Grm-Schmdt orthogonlzton. 4/9/998 qud_ 6
Gussn Qudrture cont. The weghts,, correspondng to the hve nce representton n terms o the orthogonl polynomls, too. They re: p p p p 4/9/998 qud_ Gussn Qudrture cont. For severl common w, the polynomls, nd hence the qudrture rules re well known. E.g., Guss-Legendre, w, < <, p P Guss-Cheyshev, w, < <, p T α α Guss-Lguerre, w e,0 < <, p L Guss-Hermte, Guss-Jco 4/9/998 qud_ 4 7
Gussn Qudrture cont. One prolem wth usng sequences o Gussn rules s tht the chnge rom rule to rule. Hence, one cnnot reuse uncton vlues. Kronrod developed method o ddng ponts to the ponts o n th order Gussn rule to otn rule o degree. The weghts chnge, so must sve vlues. 4/9/998 qud_ 5 Constructng generl ntegrtor So r we hve tlked out ed ntegrton rules. I.e., s ed. ow we wnt to wrte generl purpose ntegrtor usng these ed-rules. Generl purpose ntegrtors cn e clssed s ether tertve or non-tertve dptve or non-dptve 4/9/998 qud_ 6 8
Generl purpose ntegrton Itertve schemes compute successve ppromtons to the ntegrl usng hgher order rules untl some sort o greement s reched. on-tertve schemes only do or ppromtons nd stop. dptve schemes choose the ponts t whch s evluted dependng on the ehvor o. on-dptve schemes choose ponts ndependent o. 4/9/998 qud_ 7 dptve Qudrture In n dptve scheme, the user nputs desred ccurcy reltve & solute error. ed ntegrton rule, or set o ed rules s then ppled to the ntegrton rnge. I more thn one ed rule s used, the ccurcy s tested y comprng the results o the rules. I the test ls, the ntegrton rnge s splt typclly n hl nd the rules ppled to ech pece. Ths process s repeted untl convergence. 4/9/998 qud_ 8 9
dptve Qudrture I only sngle ed rule s used, then the ntegrton rnge s splt nd the ed rule s ppled to ech pece. The ed rule s compred gnst the sum o the peces. I no greement s ound, then the peces re splt, etc. Typclly, the user lso enters tolernces or how smll the ntegrtor s llowed to dvde the rnges. 4/9/998 qud_ 9 dptve Qudrture Code n dptve ntegrtor sed on Guss-Kronrod scheme s presented n secton 5., pges 88-89. C nd F90 versons o the code re n ~smth/pulc_html/cs75/codes/c/dpt.c ~smth/pulc_html/cs75/codes/90/dpt.90 dvntges o G-K sed scheme: non-eqully spced ponts, no end ponts. reuse prevous uncton clls s much s possle. 4/9/998 qud_ 0 0
G-K sed dptve lgorthm Over th ntervl, compute ppromtons to the ntegrl Q, ˆ Q usng -pont G nd 7 pont G-K rules. Estmte error n ntervl s E Qˆ ow dvde th ntervl Q E > m ER, RER* 4/9/998 qud_ j Q j dptve lgorthm To strt the process, orm Q or [,] nd ts estmted error ERRESTE. I ERREST <TOL, SWERQ nd we stop. Otherwse, put {α,β,q,e} nto queue lnked lst nd strt the ollowng loop: 4/9/998 qud_
dptve lgorthm Loop Remove α,β,q,e rom the top o the queue compute χαβ/ compute QL or [α,χ] nd ts error EL compute QR or [χ,β] nd ts error ER SWERQLQR-Q ERRESTELER-E EL s too g, dd α,χ,ql,el to end o queue ER s too g, dd χ,β,qr,er to end o queue 4/9/998 qud_ dptve lgorthm The loop stops when The queue s empty ERREST <TOL The queue gets too lrge Too mny uncton evlutons re mde 4/9/998 qud_ 4