CEM TR Numerical Integration
CEM TR Numerical Integration
Fundamentals
Quadrature
ˆ 1 np
X
f (ξ) dξ ≈ Wi f (ξi )
−1 i=1
Change of Interval
b−a a+b
Change of variable x = ξ+
2 2
ˆ b ˆ 1
b−a a + b dx
f (x) dx = f( ξ+ ) dξ
a −1 2 2 dξ
|{z}
b−a
2
Newton-Cotes
Point locations are fixed a-priori (equally spaced n + 1), only the
weigthts need to be calculated
Based on Lagrange polynomials
Exact for polynomials of order n (if n is even of polynomials of order
n + 1)
Closed Newton-Cotes formulas (well known Trapezoidal rule, Simpson’s
rule, etc.) and Open Newton-Cotes formulas (rectangle -mid point- rule,
Milne’s rule, etc.)
Allows for nested quadrature schemes
For large n a Newton-Cotes rule can sometimes suffer from catastrophic
Runge’s phenomenon where the error grows exponentially for large n.
Gaussian Quadrature
Point locations are NOT fixed a-priori
▶ Points are NOT equally spaced
▶ Points are weights need to be calculated
Exact for polynomials of order p = 2np − 1
It can be shown (see Press, et al., or Stoer and Bulirsch) that the
quadrature nodes ξi are the roots of a polynomial belonging to a class of
orthogonal polynomials (the class orthogonal with respect to a weighted
inner-product).
352
Maximum
degree of
( )
4
d y
2 ± 0.577350269189626 ± 1 3 1 ≈ 0.7 × 10 −2 3
dξ 4
0 0.888888888888889 ( 8 9 ) d6 y
3 ≈ 0.7 × 10 −4 5
(
± 0.774596669241483 ± 3 5 ) 0.555555555555556 ( 5 9 ) dξ 6
⎛ 3−2 6 5 ⎞ ⎛ ⎞
± 0.339981043584856 ⎜ ±
7
⎟ 0.652145154862546 ⎜ 1 + 1 ⎟
⎜⎝ ⎠⎟ ⎝ 2 6 6 5⎠ d8 y
≈ 0.3 × 10 −6 7
4 dξ 8
⎛ 3+2 6 5 ⎞ ⎛ ⎞
± 0.861136311594053 ⎜ ± ⎟ 0.347854845137454 ⎜ 1 − 1 ⎟
⎝⎜
7
⎠⎟ ⎝2 6 6 5⎠
1 r
∫ y (ξ ) dξ = ∑ w y (ξ )
−1
i =1
i i
Maximum
degree of
r ξi wi Error polynomials
integratted
precisely
0.56888 88888 88889 (128 225)
0
( )
⎛ ⎞ d10 y
5 ± 0.53846 93101 05683 ± 1 5 − 4 5 14 0.47862 86704 99366 ⎜ 161 + 13
⎟ ≈ 0.8 × 10 −9 9
3 ⎝ 450 180 5 14 ⎠ dξ 10
(
± 0.90617 98459 38664 ± 1 5 + 4 5 14
3 ) ⎛
0.23692 68850 56189 ⎜ 161 − 13
⎞
⎟
⎝ 450 180 5 14 ⎠
± 0.23861 91860 83197 0.46791 39345 72691
d12 y
6 ± 0.66120 93864 66265 0.36076 15730 48139 ≈ 1.5 × 10 −12 11
dξ 12
± 0.93246 95142 03152 0.17132 44923 79170
5 – NUMERICAL METHODS
0 0.41795 91836 73469
± 0.40584 51513 77397 0.38183 00505 05119 d14 y
7 ≈ 2.1 × 10 −15 13
± 0.74153 11855 99394 0.27970 53914 89277 dξ 14
± 0.94910 79123 42759 0.12948 49661 68870
Amor) 5
0
(
± 0.53846 93101 05683 ± 1 5 − 4 5 14
3 )
0.56888 88888 88889 (128 225)
⎛
0.47862 86704 99366 ⎜ 161 + 13
⎞
⎟
⎝ 450 180 5 14 ⎠
≈ 0.8 × 10 −9
d10 y
dξ 10
9
(
± 0.90617 98459 38664 ± 1 5 + 4 5 14
3 ) ⎛
0.23692 68850 56189 ⎜ 161 − 13
⎞
⎟
Numerical Integration 6
± 0.23861 91860 83197
± 0.66120 93864 66265
± 0.93246 95142 03152
⎝ 450 180 5 14 ⎠
0.46791 39345 72691
0.36076 15730 48139
0.17132 44923 79170
≈ 1.5 × 10 −12
d12 y
dξ 12
11
5 – NUMERICAL METHODS
0 0.41795 91836 73469
Gauss-Legendre Quadrature 7
± 0.40584 51513 77397
± 0.74153 11855 99394
± 0.94910 79123 42759
0.38183 00505 05119
0.27970 53914 89277
0.12948 49661 68870
≈ 2.1 × 10 −15
d14 y
dξ 14
13
353
• NUMERICAL INTEGRATION IN HIGHER DIMENSIONS:
• Presentamos el quad como productor tensorial 1D x 1D
• Luego el triangulo como transformación del quad
• Finalmente, formulas “simétricas” para el triangulo (coordenadas afines)
• Same ideas pretty much hold in 3D (hexas and tetra)
Integration in Higher Dimensions
“Product” methods
Direct methods
“Product” methods
1D quadrature in both directions ξ and η
With npξ , npη points Gaussian method uses np = npξ npη and it
integrates exactly monomials
0 ≤ i ≤ 2npξ − 1
ξi ηj such that
0 ≤ j ≤ 2npη − 1
Direct methods
Extend 1D quadrature to higher dimensional space, i.e.,
ˆ np
X
dΩ ≈
f (ξ, η, . . .) |{z} Wi f (ξi , ηi , . . .)
Ω i=1
dξdη...
ξi ηj such that i +j ≤m
GREMA (UC3M) CEM v1.18 Figure 5.5. Direct integration formulae on a square 26 / 36
Gauss-Legendre on Triangles
(*) Taken from G. Dhat et al., Finite Element Method
Direct Method ✔
5 – NUMERICAL METHODS 367 368 FINITE ELEMENT METHOD
η 5 7 1 3 1 3 9 80
a a
⎪⎫ A =
6 + 15 155 + 15
7 a= 1–2a a
21 ⎬ 2 400
= 0 . 470142064105115 a 1–2a
a 3 2
b b ⎭⎪ = 0 . 0661970763942530
1–2b b ⎫⎪ 31 − A =
1
b= 4 −a b 1–2b
7 ⎬ 240
b
5 4 6
b a ξ = 0 . 101286507323456 ⎪⎭ = 0 . 0629695902724135
6 12 a a
1–2a a ⎫ 0 . 025422453185103
a = 0 . 063089014491502 ⎬
a 1–2a ⎭
b = 0 . 249286745170910 b b
1–2b b ⎫ 0 . 058393137863189
⎬
b 1–2b ⎭
c = 0 . 310352451033785 c d
d c ⎫
⎪
d = 0 . 053145049844816 1 – (c + d) c
⎬ 0 . 041425537809187
1 – (c + d) c
c 1 – (c + d) ⎪
d 1 – (c + d) ⎭
where w i, wj and w k are the coefficients from Figure 5.2 (Gauss) or 5.3
(Newton–Cotes);
Direct Method ✔
function liref=lligauss(npointeg)
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# calculo de puntos de integracion para formula de gauss sobre triangulos.
# distintas cuadraturas dependiendo de parametro npointeg
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
liref=zeros(3,npointeg);
a=0.445948490915965;
liref(1:3,1)=[1-2*a a a ]’;
liref(1:3,2)=[ a 1-2*a a ]’;
liref(1:3,3)=[ a a 1-2*a]’;
b=0.091576213509771;
liref(1:3,4)=[1-2*b b b ]’;
liref(1:3,5)=[ b 1-2*b b ]’;
liref(1:3,6)=[ b b 1-2*b]’;
else
.
.
.
endfunction
Direct Method ✔
function Wi=lwigauss(npointeg)
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# calculo de pesos de integracion para formula de gauss sobre triangulos.
# distintas cuadraturas dependiendo de parametro npointeg
#
# NORMALIZACION: area unidad
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Wi=zeros(1,npointeg);
Wi(1:3)=1/3;
Wi(1)=9/80;
A=(155+sqrt(15))/2400;
Wi(2:4)=A;
Wi(5:7)=31/240-A;
Wi=Wi*2;
elseif
.
.
.
else
disp (’ valor de npointeg incorrecto, npointeg: ’), disp (npointeg);
return
endif
endfunction