0% found this document useful (0 votes)
12 views21 pages

CEM TR Numerical Integration

Uploaded by

pmd.pour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views21 pages

CEM TR Numerical Integration

Uploaded by

pmd.pour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Numerical Integration

Fundamentals

Quadrature
ˆ 1 np
X
f (ξ) dξ ≈ Wi f (ξi )
−1 i=1

Different sets (families) of points ξi and weights Wi


Quadrature typically based on the assumption that f is a simple and
completed polynomial of order p

GREMA (UC3M) CEM v1.18 15 / 36


Numerical Integration (cont.)
Fundamentals

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

Quadrature formula on [a, b]


ˆ b np
b−a X b−a a+b
f (x) dx ≈ Wi f ( ξi + )
a 2 2 2
i=1

GREMA (UC3M) CEM v1.18 16 / 36


Some Quadratures

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.

GREMA (UC3M) CEM v1.18 17 / 36


Some Quadratures (cont.)

Methods such as Gaussian quadrature and Clenshaw-Curtis quadrature with


unequally spaced points are stable and much more accurate, and are
normally preferred to Newton-Cotes

GREMA (UC3M) CEM v1.18 18 / 36


Some Quadratures (cont.)

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).

GREMA (UC3M) CEM v1.18 19 / 36


Some Quadratures (cont.)

Clenshaw-Curtis quadrature (Fejér quadrature)


Based on an expansion of the integrand in terms of Chebyshev
polynomials.
I.e., employ a change of variables x = cos θ and use a discrete cosine
transform (DCT) approximation for the cosine series.
Naturally leads to nested quadrature rules where different accuracy
orders share points
⇒ important for adaptive quadrature
It exactly integrates polynomials only up to degree n (with n + 1 points)
▶ Competitive with Gaussian-quadratures for non polynomial integrands

GREMA (UC3M) CEM v1.18 20 / 36


Gaussian Quadratures

Gauss-Legendre quadrature, or simply “Gauss quadrature”


▶ Not typically used for integrable functions with endpoint singularities.
▶ If end point singularities, depending on the integrand, Gauss-Jacobi
Gauss-Lobato:
▶ Includes integration points at ξ = ±1
▶ Requires an extra point with respect to Gauss-¿¿Legendre??
Our focus here is on definite integrals. When not
▶ Gauss-Laguerre: semi-infinite interval
▶ Gauss-Hermite: infinite intervals

GREMA (UC3M) CEM v1.18 21 / 36


Gauss-Legendre Quadrature
(*) Taken from G. Dhat et al., Finite Element Method

352
Maximum
degree of

FINITE ELEMENT METHOD


r ξi wi Error polynomials
inteegrated
precisely
2
1 0 2 1d y 1
3 dξ 2

( )
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

Figure 5.2. One-dimensional Gaussian numerical integration


GREMA (UC3M) CEM v1.18 22 / 36
Gauss-Legendre Quadrature (cont.)
(*) Taken from G. Dhat et al., Finite Element Method

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

Figure 5.2. (Continued)


GREMA (UC3M) CEM v1.18 23 / 36
Gauss-Legendre Quadrature (cont.)
CEM v1.18 (*) Taken from G. Dhat et al., Finite Element Method

2021-01-19 Issues related to Numerical Analysis (contr. by Adrián r ξi wi Error


Maximum
degree of
polynomials
integratted
precisely

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

Figure 5.2. (Continued)

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

Often used with quads, hexas

GREMA (UC3M) CEM v1.18 24 / 36


Integration in Higher Dimensions (cont.)

Direct methods
Extend 1D quadrature to higher dimensional space, i.e.,
ˆ np
X
dΩ ≈
f (ξ, η, . . .) |{z} Wi f (ξi , ηi , . . .)
Ω i=1
dξdη...

With Gaussian method it integrates exactly m-order monomials

ξi ηj such that i +j ≤m

Often used with simplices (triangles, tetras)

GREMA (UC3M) CEM v1.18 25 / 36


Gauss-Legendre on Quads
(*) Taken from G. Dhat et al., Finite Element Method

Product Method Direct Method 5 – NUMERICAL METHODS 363

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

Product Method (Gauss-Radau)


366 FINITE ELEMENT METHOD

Figure 5.6. “Product” formula for integration on a triangle (Gauss–Radau)


GREMA (UC3M) CEM v1.18 27 / 36
Gauss-Legendre on Triangles
(*) Taken from G. Dhat et al., Finite Element Method

Direct Method ✔
5 – NUMERICAL METHODS 367 368 FINITE ELEMENT METHOD

Order Number Coordinates Weight


m of points r ξi ηi wi
η
4 6 a a ⎫ 0. 111690794839005
6
a = 0 .445948490915965 1–2a a ⎬
a 1–2a

2 1 b b
b = 0 .091576213509771 1–2b b ⎫ 0. 054975871827661
b 1–2b ⎬
4 3 5 ⎭
ξ

η 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) ⎭

Figure 5.7. (Continued)

5.1.4 NUMERICAL INTEGRATION IN THREE DIMENSIONS [STR 71;


HAM 56; IRO 71; HEL 72]

5.1.4.1 Cubic reference element


The “product” method is written as:
r1 r2 r3
1 1 1

Figure 5.7. Direct formulae for integration over a triangle (Hammer) ∫ ∫ ∫


−1 −1 −1
y(ξ , η, ζ ) dξ dη dζ = ∑ ∑ ∑w i w j w k y (ξ i , η j , ζ k ) (5.20)
i =1 j =1 k =1

where w i, wj and w k are the coefficients from Figure 5.2 (Gauss) or 5.3
(Newton–Cotes);

GREMA (UC3M) CEM v1.18 28 / 36


Gauss-Legendre on Triangles (cont.)
(*) Taken from G. Dhat et al., Finite Element Method

Introduce now barycentric (affine) coordinates

GREMA (UC3M) CEM v1.18 29 / 36


Gauss-Legendre on Triangles (cont.)
(*) Taken from G. Dhat et al., Finite Element Method

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);

if (npointeg == 3)# hasta orden 2

liref(1:3,1)=[2/3 1/6 1/6]’;


liref(1:3,2)=[1/6 2/3 1/6]’;
liref(1:3,3)=[1/6 1/6 2/3]’;

elseif (npointeg == 4)# hasta orden 3

liref(1:3,1)=[1/3 1/3 1/3]’;


liref(1:3,2)=[3/5 1/5 1/5]’;
liref(1:3,3)=[1/5 3/5 1/5]’;
liref(1:3,4)=[1/5 1/5 3/5]’;

elseif (npointeg == 6)# hasta orden 4

GREMA (UC3M) CEM v1.18 30 / 36


Gauss-Legendre on Triangles (cont.)
(*) Taken from G. Dhat et al., Finite Element Method

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

GREMA (UC3M) CEM v1.18 31 / 36


Gauss-Legendre on Triangles (cont.)
(*) Taken from G. Dhat et al., Finite Element Method

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);

if (npointeg == 3) # hasta orden 2

Wi(1:3)=1/3;

elseif (npointeg == 4)# hasta orden 3

Wi(1:4)=[-27/96 25/96 25/96 25/96]*2;

elseif (npointeg == 6)# hasta orden 4

Wi(1:6)=[0.223381589678011*[1 1 1] 0.109951743655322*[1 1 1]];

GREMA (UC3M) CEM v1.18 32 / 36


Gauss-Legendre on Triangles (cont.)
(*) Taken from G. Dhat et al., Finite Element Method

elseif (npointeg == 7)# hasta orden 5

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

GREMA (UC3M) CEM v1.18 33 / 36


Assignment

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy