Num. Math. Gauss kvadratúra Általánosított kvadratúra probléma: a b f x Ω x x Most csak azzal foglakozunk, amikor Ω=, [a,b]=[-,]. Nem ekvidisztáns alappontrendszer, n pont esetén [-,]-en minden(!) (n-)-ed fokú polinomra pontos. n=, -adfokú n=, -ödfokú stb. b Hogyan kapjuk a pontokat és a súlyokat? a f x x n i 0 f x i w i Alappontok: Ortogonális polinomrendszer elemeinek gyökei Súlyok: - n= {,}(nem kell tudni általánosan) Ha f g f x g x x, akkor OPR elemei az un. Legendre polinomok.. Legendre polinom, pl. n=: / (x^-) Határozatlan együtthatók módszere a formulák meghatározozá sára Kísérlet a súlyok és az osztópontok meghatározására a pontossági rendre vonatkozó feltételbôl n=: osztópontok a,b n=: osztópontok a,b,c In[]:= In[7]:= Clear W, X, w, x; W Table wj, j, 0, ; X Table xj, j, 0, ; sopexpr_, var_, n_ : Sum W j expr. x X j, j, n t Table sopx ^ n, x,, n, 0, w0 w, w0 x0 w x, w0 x0 w x, w0 x0 w x t Table Integrate x ^ n, x,,, n, 0,, 0,, 0 ThreadEqualt, t w0 w, w0 x0 w x 0, w0 x0 w x, w0 x0 w x 0
nummethods.nb Solve ThreadEqualt, t w0, w, x, x0, w0, w, x, x0 t Table sopx ^ n, x,, n, 0, w0 w w, w0 x0 w x w x, w0 x0 w x w x, w0 x0 w x w x, w0 x0 4 w x 4 w x 4, w0 x0 w x w x t Table Integrate x ^ n, x,,, n, 0,, 0,, 0,, 0 Solve ThreadEqualt, t4 w0, w 8, w, x, x 0, x0 Megjegyzés. Az osztópontok permutációtól eltekintve egyértelmû. Érdekesség n=4. t Table sopx ^ n, x, 4, n, 0, 7; t Table Integrate x ^ n, x,,, n, 0, 7; GroebnerBasisThreadPlust, t, JoinTake X, 4, Take W, 4 4 w w, 4 w w, 7 w w w w w w w w w, 4 w w, w0 w w w, 7 w x, x w x w x x w x w x, 7 w x, w x w x w x w x x w x w x w x, x w x w x x w x w x, 7 w 7 w 7 w x x x x x x, 7 w x, x0 x x x Solve 0 w 8 0, w 8 0 N w. 0.478, w. 0.4 Kísérlet (határozatlan együtthatók módszere ortogoná lis polinomok meghatározására): Speciá lis eset. a=-,b=, Ρ=, n= qx_ : c0 c x c x c x ; q ortogonális,x,x^ polinomokra:
nummethods.nb qx x 0, c0 c c 0, Solve c c0 0, c 0, c c qx x x 0, 0, c0 c 0 qx x qx. c0 0, c 0, c c. c x x Ez a köbös Legendre polinom: LegendreP, x x x? LegendreP x 0 LegendrePn, x gives the Legendre polynomial P n x. LegendrePn, m, x gives the associated Legendre polynomial P n m x. LegendreP, x x A Legendre polinomok ortogonális rendszert alkotnak Az ortogonalitás ellenõrzése L L 0 Integrate LegendreP, x LegendreP, P, x,, 0 TableForm Table i, LegendrePi, x, i, 0, 0 0 x 4 7 8 0 x x x 8 0 x x 4 8 x 70 x x 0 x x 4 x x x x 4 x 7 8 8 0 x 0 x 4 0 x 4 x 8 x 40 x 8 08 x 740 x 7 x 4 x 0 00 x 4 0 00 x 0 x 8 4 8 x 0 Ortogonalitás
4 nummethods.nb TableForm Table Integrate LegendrePi, x LegendrePj, x, x,,, i, 0,, j, 0, 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0 Mintapontok: a Legendre polinomok gyökei Solve LegendreP, x 0 x 0, x, x r Sort x. Solve LegendreP, x 0, Less, 0, A súlyok meghatározása a pontossági rend alapján. plist, x, x, x, x 4, x ; w w0, w, w; Table Sum wi plist j. x ri, i, Integrate plist j, x,,, j, w0 w w, w0 w 0, w0 w, w0 w 0, w0 w, w0 w 0 Solve w0, w, w 8 Itt vannak a súlyok általában x i P ' x i ^ ): Weight i_, n_, var_ : Module xi Sort var. Solve LegendrePn, var 0, Lessi, xi ^ D LegendrePn, var, var. var xi^ SimplifyWeight,, x SimplifyTable Weight i, n, x, n,, i, 0, n,,,, 8,,, 8 0, 8 0, 8 70, 70, 00 00, 70, 70 00 00,
nummethods.nb Kísérlet (osztópontok ismeretében súlyok) Speciá lis eset. a=-,b=, Ρ=, n= In[]:= Mapsop, x, &, Table LegendrePj, x, j, 0,. x0 Sqrt, x 0, x Sqrt Out[]= w0 w w, w0 w, w0 w w In[]:= ThreadEqual,, 0, 0 Out[]= w0 w w, w0 w 0, w0 w w 0 In[]:= Solve Out[]= w0, w, w 8 Feladat Hasonlítsuk össze a trapézszabályt, az n=-höz tartozó Gauss kvadratúrát és az integrál pontos értékét, ha, f[x]=x^+x^- In[4]:= fx_ : x x ; In[]:= fx x Out[]= 4 In[]:= p Integrate fx, x Out[]= x x In[7]:= x4 4 p. x p. x Out[7]= 4 In[8]:= f f Out[8]= 0 Nem pontos In[]:= Solve LegendreP, x 0 Out[]= x, x In[40]:= f Sqrt f Sqrt Out[40]= 4 A Gauss kvadratúra pontos értéket ad, a formula pontossági rendje, vagyis köbös polinomokra a hiba 0! In[4]:= fx_ : x 4 ;
nummethods.nb In[4]:= f Out[4]= In[4]:= Out[4]= In[44]:= Out[44]= f Sqrt f Sqrt fx x