Numeril Methods Leture 5. Numeril itegrtio dr h. iż. Ktrzy Zkrzewsk, pro. AGH Numeril Methods leture 5
Outlie Trpezoidl rule Multi-segmet trpezoidl rule Rihrdso etrpoltio Romerg's method Simpso's rule Gussi method Numeril Methods leture 5
Numeril itegrtio - ide d Y The itegrl e pproimted y: d S i i Δ i X i i i Numeril Methods leture 5
Newto Cotes methods Newto Cotes itegrtio elogs to lss o methods with ied odes: utio is iterpolted y polyomil e.g. Lgrge polyomil where: 0... The, the itegrl o e pproimted s itegrl o the iterpolted utio d d Numeril Methods leture 5
5 Trpezoidl rule The trpezoidl rule ssumes:, thus: 0 d d d 0 But wht is 0 d? 0 Now i oe hooses,, i, s the two poits to pproimte y stright lie rom to. t ollows tht: 0 0 0 Numeril Methods leture 5
Trpezoidl rule d d re o trpezoid Y X Numeril Methods leture 5 6
Trpezoidl rule Emple : Veloity vt o roket rom t 8 s to t 0 s is give y: 0000 v t 000 l 9. 8t 0000 00t Use the sigle segmet trpezoidl rule to id the diste overed y the roket rom t 8 s to t 0 s Fid the true reltive error. Numeril Methods leture 5 7
Trpezoidl rule 0000 t 000 l 9. 8t 0000 00t 0000 8 000 l 9.88 0000 008 0000 0 000 l 9.80 0000 000 8 s 0 s 77.7 90.67 m / m / s s 77.7 90.67 0 8 868 m Numeril Methods leture 5 8
Trpezoidl rule The true vlue Δ 0000 000l 9.8t dt 8 0000 00t 0 06m The reltive error: 06 868 t 00 7.959 % 06 Numeril Methods leture 5 9
Multi-segmet trpezoidl rule The true error usig Y sigle segmet trpezoidl rule ws lrge. We divide the itervl rom to ito smller segmets o equl legth h d pply the trpezoidl rule over eh segmet: h or X d h h h d d d h h h h d Numeril Methods leture 5 0
d ih i h h h h h h d d... d d d... h h h h h ] [... h h Multi-segmet trpezoidl rule Numeril Methods leture 5
Emple : Multi-segmet trpezoidl rule Veloity vt o roket rom t 8 s to t 0 s is give y: 0000 v t 000 l 9. 8t 0000 00t Use the omple segmet trpezoidl rule to id the diste overed rom t 8 s to t 0 s or Fid the true reltive error. Numeril Methods leture 5
Multi-segmet trpezoidl rule 8 s 0 s ih i 0 8 h s 0 8 8 i ih 0 [ 8 9 0] [ 77. 7 8. 75 90. 67] 66 m Numeril Methods leture 5
Multi-segmet trpezoidl rule true vlue: 0 8 0000 000l 9. 8t dt 0000 00t 06m The reltive error: 0666 t 00.85% 06 Numeril Methods leture 5
Multi-segmet trpezoidl rule E t % % t 868-807 7.96 --- 66-05.85 5. 5-9. 0.865.09-5.5 0.655 0.59 5 09 -.0 0.98 0.669 6 08 -.9 0.070 0.0908 7 078-6.8 0.5 0.058 8 07 -.9 0.65 0.0560 Numeril Methods leture 5 5
Estimtio o error The reltive error or simple trpezoidl rule is E t " ζ, < ζ < The reltive error i the multi-segmet trpezoidl rule is sum o errors or eh segmet. The reltive error withi the irst segmet is give y: [ h ] E " ζ, < ζ < h " ζ h Numeril Methods leture 5 6
Estimtio o error By logy: [ ih i h ] Ei " ζi, i h < ζi < ih h " ζ i or -th segmet : [ { h} ] E " ζ, h < ζ < h " ζ Numeril Methods leture 5 7
Estimtio o error The totl error i the omple trpezoidl rule is sum o the errors or sigle segmet: E t E i i Formul: " ζ h i " ζi i i yields pproimte verge vlue o the seod derivtive i the rge o E t " ζ i α i < < Numeril Methods leture 5 8
Estimtio o error Tle elow presets the results or the itegrl 0 8 0000 000l 9. 8t dt 0000 00t s utio o the umer o segmets. Whe twie ireses, the solute error E t dereses our times! Vlue E % % t t 66-05.85 5. -5.5 0.655 0.59 8 07 -.9 0.65 0.0560 6 065 -. 0.09 0.000 Numeril Methods leture 5 9
Rihrdso s etrpoltio d Romerg s method o itegrtio Rihrdso s etrpoltio d Romerg s method o itegrtio ostitute etesio o the trpezoidl method d give etter pproimtio o the itegrl y reduig the true error. Numeril Methods leture 5 0
Rihrdso etrpoltio The true error otied whe usig the multi-segmet trpezoidl rule with segmets to pproimte itegrl is give y: E t where: C is pproimte ostt o proportiolity C Sie: E TV t true vlue pproimte vlue usig -segmets Numeril Methods leture 5
Rihrdso etrpoltio t e show tht: C TV the umer o segmets is douled rom to : C C TV TV We get: TV Numeril Methods leture 5
Rihrdso etrpoltio Emple : The veloity vt o roket rom t 8 s to t 0 is give y: 0000 v t 000 l 9. 8t 0000 00t Use Rihrdso etrpoltio rule to id the diste overed or Fid the reltive true error Numeril Methods leture 5
Tle o results or 8 segmets trpezoidl rule E t % % 868-807 7.96 --- 66-05.85 5. 5-9. 0.865.09-5.5 0.655 0.59 5 09 -.0 0.98 0.669 6 08 -.9 0.070 0.0908 7 078-6.8 0.5 0.058 8 07 -.9 0.65 0.0560 t Numeril Methods leture 5
Rihrdso etrpoltio 66m m TV TV or 66 06m Numeril Methods leture 5 5
Rihrdso etrpoltio The true vlue: 0 8 0000 000l 9. 8t dt 0000 00t 06 m The solute true error: Et 0606 m Numeril Methods leture 5 6
Rihrdso etrpoltio The reltive error: 0606 t 00 0.0090% 06 Compriso o dieret methods:. 8 m Trpezoidl rule 868 66 07 % m % t Trpezoidl rule 7.96.85 0.655 0.65 Rihrdso etrpoltio -- 065 06 06 t Rihrdso etrpoltio -- 0.066 0.0090 0.0000 Numeril Methods leture 5 7
Romerg's method Romerg s method uses the sme ptter s Rihrdso etrpoltio. However, Romerg used reursive lgorithm or the etrpoltio s ollows: TV The true vlue TV is repled y the result o the Rihrdso etrpoltio R Note lso tht the sig is repled y the sig R Numeril Methods leture 5 8
Romerg's method TV Ch Esimted true vlue is give y: R where: Ch is the vlue o the error o pproimtio Aother vlue o itegrl otied while doulig the umer o segmets rom to : R Estimted true vlue is give y: TV R R 5 R R R R Numeril Methods leture 5 9
Romerg's method A geerl epressio or Romerg itegrtio e writte s: k, j k, j k, j k, j, k k The ide k represets the order o etrpoltio k represets the vlues otied rom the regulr trpezoidl rule k represets the vlues otied usig the true error estimte s Oh The vlue o itegrl with or j is more urte th the vlue o the itegrl or j ide Numeril Methods leture 5 0
Romerg's method Emple : Veloity vt o roket rom t 8 s to t 0 s is give y: 0000 v t 000 l 9. 8t 0000 00t Use Romerg s method to id the diste overed. Use,,, d 8 Fid the solute true error d the reltive pproimte error Numeril Methods leture 5
Tle o results or 8 segmets trpezoidl rule E t % % 868-807 7.96 --- 66-05.85 5. 5-9. 0.865.09-5.5 0.655 0.59 5 09 -.0 0.98 0.669 6 08 -.9 0.070 0.0908 7 078-6.8 0.5 0.058 8 07 -.9 0.65 0.0560 t Numeril Methods leture 5
Romerg's method From this tle, the iitil vlues rom the trpezoidl rule re: 868 66,,, 07, To get the irst order etrpoltio vlues:,,,, 66 66 868 Numeril Methods leture 5
Romerg's method Similrly,,,,,,,,, 66 07 07 06 06 Numeril Methods leture 5
Romerg's method For the seod order etrpoltio: Similrly,,,, 06 06, 06 06, 5, 06 065 5,, 5 06 06 5 Numeril Methods leture 5 5
Romerg's method For the third order etrpoltio,,, 6, 06 0606 6 06m Numeril Methods leture 5 6
Romerg's method Appr. Appr. Appr. -segmet 868 065 -segmet 6 06 06 06 -segmet 06 06 8-segmet 07 mproved estimtes o the vlue o itegrl usig Romerg itegrtio Numeril Methods leture 5 7
Simpso's rule The trpezoidl rule ws sed o pproimtig the itegrd y irst order polyomil, d the itegrtig the polyomil over itervl rom to. Simpso s rule ssumes tht the itegrd e pproimted y seod order polyomil. d d where: 0 Numeril Methods leture 5 8
Simpso's rule A prol pssig through three poits :,, Y,,, 0 0 0 X Numeril Methods leture 5 9
0 Coeiiets 0,, re: Simpso's rule Numeril Methods leture 5 0
Simpso's rule Sie: d 0 d 0 0 Numeril Methods leture 5
Simpso's rule d 6 h t ollows tht: h d it is lled Simpso s / rule Numeril Methods leture 5
d d d 0... Multi-segmet Simpso's rule 0 d d... 0 6... Numeril Methods leture 5... 6... 6 6 d... 0 - i i h i,,...,...
Simpso's rule d 0 h 6... h... 6 h 6... h 6 Numeril Methods leture 5
Simpso's rule h d 0 {... } [...] {... } }]... h odd i i 0 i i i i eve odd i i 0 i i i i eve Numeril Methods leture 5 5
Estimtio o errors i Simpso's rule Approimte vlues o the itegrl, usig Simpso's rule with multiple segmets Approimte vlues E t Є t 6 8 0 065.7 06.6 06.0 06.5 06..8 0.0 0.06 0.0 0.00 0.096% 0.007% 0.0005% 0.000% 0.0000% Numeril Methods leture 5 6
Simpso's rule errors Error or oe segmet 5 E t ζ, < ζ < 880 Error or the multi-segmet E E 5 h 5 0 ζ ζ, 880 90 5 h ζ ζ, 880 90 5 < 0 < ζ < < ζ E i i 880 5 i ζ i 5 h 90 ζ i, i < ζi < i Numeril Methods leture 5 7
Simpso's rule errors True error E i t E i i ζ i 5 h 90 i ζ i 5 90 5 ζ i i 90 E t 90 5 5 i ζ the verge vlue o the derivtive i Numeril Methods leture 5 8
Guss-Qudrture Method Gussi itegrl is give y: d ostt oeiiets Poits d, whih deie the vlue o the itegrd re ot ied s eore, ut there re priori distriuted rdomly withi <,>. Numeril Methods leture 5 9
50 Guss-Qudrture Method. 0 d d 0 0 0 There re our ukows,,,. These re oud y ssumig tht the ormul gives et results or itegrtig geerl third order polyomil: Numeril Methods leture 5
5 Guss-Qudrture Method 0 0 d 0 d d d 0 0 Hee: The ormul would the give: Numeril Methods leture 5
5 Guss-Qudrture Method 0 0 Numeril Methods leture 5
5 Guss-Qudrture Method This gives us our equtios s ollows: we id tht the ove our simulteous olier equtios hve oly oe eptle solutio Numeril Methods leture 5
5 Guss-Qudrture Method d Hee:....... d Geerl -poit rules would pproimte the itegrl: Numeril Methods leture 5
Guss-Qudrture Method The oeiiets d rgumets or -poit Guss method re give withi the rge o <-,> : g d i i g i Coeiiets Futio rgumets.000000000.000000000 0.555555556 0.888888889 0.555555556 0.78585 0.65555 0.65555 0.78585-0.5775069 0.5775069-0.77596669 0.000000000 0.77596669-0.866-0.9980 0.9980 0.866 Numeril Methods leture 5 55
Guss-Qudrture Method Coeiiets Futio rgumets 5 0.696885 0.7868670 0.568888889 0.7868670 5 0.696885 6 0.79 0.607657 0.67995 0.67995 5 0.607657 6 0.79-0.9067986-0.58690 0.000000000 0.58690 5 0.9067986-0.9695-0.660986-0.869860 0.869860 5 0.660986 6 0.9695 Numeril Methods leture 5 56
So i the tle is give or: Guss-Qudrture Method g d d? The swer lies i tht y itegrl with limits o [, ] e overted ito itegrl with limits: [,] itegrls, how does oe solve Let, mt i, t ir t, t ollows tht: m Numeril Methods leture 5 57
58 Hee: t dt d Sustitutig our vlues o d d ito the itegrl gives us: dt t d Guss-Qudrture Method Numeril Methods leture 5
Emple 5: Guss-Qudrture Method Use two-poit Guss qudrture rule to pproimte the diste overed y roket rom t 8 s to t 0 s i the veloity is give y: 0000 v t 000 l 9. 8t 0000 00t Use the Guss-Qudrture Mmethod to id the diste overed rom t 8 s to t 0 s Fid the true error. Numeril Methods leture 5 59
Guss-Qudrture Method First, hge the limits o itegrtio rom rom [8,0] to [-,] 0 t dt 0 8 0 8 0 8 d 8 The weightig tors d utio rgumet vlues re : 9 d. 000000000 0. 5775069. 000000000 0. 5775069 Numeril Methods leture 5 60
Guss-Qudrture Method The ormul is: 9 d 9 9 0. 57750 9 0. 57750 9. 695 5. 5085 96. 87 708. 8 058. m Numeril Methods leture 5 6
Guss-Qudrture Method Sie: 0000. 695 000l 9. 8. 695 0000 00. 695 96.87 0000 5. 5085 000l 9. 8 5. 5085 0000 00 5. 5085 708.8 Numeril Methods leture 5 6
Guss-Qudrture Method The solute true error: E t 06. 058..9000 m The reltive error: t 06. 058. t 00% 06. 0.06% Numeril Methods leture 5 6