gaussian quadratures
DESCRIPTION
Gaussian quadraturesTRANSCRIPT
Gaussian Gaussian QuadraturesQuadratures• Newton-Cotes Formulae
– use evenly-spaced functional values– Did not use the flexibility we have to select the quadrature points
• In fact a quadrature point has several degrees of freedom.Q(f)=∑i=1
m ci f(xi)A formula with m function evaluations requires specification of
2m numbers ci and xi• Gaussian Quadratures
– select both these weights and locations so that a higher order polynomial can be integrated (alternatively the error is proportional to a higher derivatives)
• Price: functional values must now be evaluated at non-uniformly distributed points to achieve higher accuracy
• Weights are no longer simple numbers• Usually derived for an interval such as [-1,1] • Other intervals [a,b] determined by mapping to [-1,1]
Gaussian Quadrature on [-1, 1]
• Two function evaluations:– Choose (c1, c2, x1, x2) such that the method yields “exact
integral” for f(x) = x0, x1, x2, x3
)x(fc)x(fc)x(fc)x(fcdx)x(f nn2211i
1
1
n
1ii +++=≈∫ ∑−
=
L
)f(xc)f(xcf(x)dx :2n
2211
1
1
+=
= ∫−
x2x1-1 1
Finding quadrature nodes and weights
• One way is through the theory of orthogonal polynomials.
• Here we will do it via brute force• Set up equations by requiring that the 2m points
guarantee that a polynomial of degree 2m-1 is integrated exactly.
• In general process is non-linear – (involves a polynomial function involving the unknown point
and its product with unknown weight)– Can be solved by using a multidimensional nonlinear solver– Alternatively can sometimes be done step by step
Gaussian Quadrature on Gaussian Quadrature on [[--1, 1]1, 1]
Exact integral for f = x0, x1, x2, x3
– Four equations for four unknowns
)f(xc)f(xcf(x)dx :2n 2211
1
1+== ∫−
⎪⎪⎪
⎩
⎪⎪⎪
⎨
⎧
=
−=
==
⇒
⎪⎪⎪
⎩
⎪⎪⎪
⎨
⎧
+==⇒=
+==⇒=
+==⇒=
+==⇒=
∫
∫∫∫
−
−
−
−
31x
31x
1c1c
xcxc0dxx xf
xcxc32dxx xf
xcxc0xdx xf
cc2dx1 1f
2
1
2
1
322
31
1
1 133
222
21
1
1 122
221
1
1 1
2
1
1 1
)3
1(f)3
1(fdx)x(fI1
1+−== ∫−
Error
• If we approximate a function with a Gaussian quadrature formula we cause an error proportional to 2n thderivative
Gaussian Quadrature on Gaussian Quadrature on [[--1, 1]1, 1]
• Choose (c1, c2, c3, x1, x2, x3) such that the method yields “exact integral” for f(x) = x0, x1, x2, x3,x4, x5
)x(fc)x(fc)x(fcdx)x(f :3n 332211
1
1++== ∫−
x3x1-1 1x2
Gaussian Quadrature on Gaussian Quadrature on [[--1, 1]1, 1]
533
522
511
1
1
55
433
422
411
1
1
44
333
322
311
1
1
33
233
222
211
1
1
22
332211
1
1
321
1
1
0
52
0
32
0
21
xcxcxcdxxxf
xcxcxcdxxxf
xcxcxcdxxxf
xcxcxcdxxxf
xcxcxcxdxxf
cccxdxf
++==⇒=
++==⇒=
++==⇒=
++==⇒=
++==⇒=
++==⇒=
∫
∫
∫
∫
∫
∫
−
−
−
−
−
−
⎪⎪⎪⎪
⎩
⎪⎪⎪⎪
⎨
⎧
=
=−=
===
⇒
5/3
05/3
9/59/89/5
3
2
1
3
2
1
x
xx
ccc
Gaussian Quadrature on Gaussian Quadrature on [[--1, 1]1, 1]
Exact integral for f = x0, x1, x2, x3, x4, x5
)53(f
95)0(f
98)
53(f
95dx)x(fI
1
1++−== ∫−
Gaussian Quadrature on Gaussian Quadrature on [a, b][a, b]
Coordinate transformation from [a,b] to [-1,1]
t2t1a b
∫∫∫ −−=
−++
−=
1
1
1
1
b
adx)x(gdx)
2ab)(
2abx
2ab(fdt)t(f
⎩⎨⎧
=⇒==⇒−=
++
−=
bt 1xat1x2
abx2
abt
Example: Gaussian QuadratureExample: Gaussian QuadratureEvaluate
Coordinate transformation
Two-point formula
33.34%)( 543936.3477376279.3468167657324.9
e)3
44(e)3
44()3
1(f)31(fdx)x(fI 3
443
441
1
==+=
++−=+−
==+−
−∫ε
926477.5216dtteI4
0
t2 == ∫
∫∫∫ −−
+ =+==
=+=+
+−
=
1
1
1
1
444
0
2 )()44(
2dxdt ;2222
dxxfdxexdtteI
xabxabt
xt
Example: Gaussian QuadratureExample: Gaussian QuadratureThree-point formula
Four-point formula4.79%)( 106689.4967
)142689.8589(95)3926001.218(
98)221191545.2(
95
e)6.044(95e)4(
98e)6.044(
95
)6.0(f95)0(f
98)6.0(f
95dx)x(fI
6.0446.04
1
1
==
++=
+++−=
++−==
+−
−∫
ε
[ ][ ]
%)37.0( 54375.5197 )339981.0(f)339981.0(f652145.0 )861136.0(f)861136.0(f34785.0dx)x(fI
1
1
==+−+
+−== ∫−
ε
Other rules
• Gauss-Lobatto:– requiring end points be included in the formula
• Gauss-Radau– Require one end point be in the formula