0% found this document useful (0 votes)
166 views26 pages

Numerical Integration in 1D (Lec 11)

- Newton-Cotes Integration Schemes and Gaussian quadrature are used to numerically compute integrals that arise in finite element analysis. - Gaussian quadrature seeks integration points and weights that exactly integrate polynomials up to a higher degree than Newton-Cotes schemes, using the same number of function evaluations. - For example, using 2 integration points, Gaussian quadrature can exactly integrate polynomials up to degree 3, whereas Simpson's rule only integrates polynomials up to degree 2. This makes Gaussian quadrature more accurate for a given number of function evaluations.

Uploaded by

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

Numerical Integration in 1D (Lec 11)

- Newton-Cotes Integration Schemes and Gaussian quadrature are used to numerically compute integrals that arise in finite element analysis. - Gaussian quadrature seeks integration points and weights that exactly integrate polynomials up to a higher degree than Newton-Cotes schemes, using the same number of function evaluations. - For example, using 2 integration points, Gaussian quadrature can exactly integrate polynomials up to degree 3, whereas Simpson's rule only integrates polynomials up to degree 2. This makes Gaussian quadrature more accurate for a given number of function evaluations.

Uploaded by

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

MANE 4240 & CIVL 4240

Introduction to Finite Elements

Prof. Suvranu De

Numerical Integration in 1D
Reading assignment:

Lecture notes, Logan 10.4

Summary:

• Newton-Cotes Integration Schemes


•Gaussian quadrature
Axially loaded elastic bar
y A(x) = cross section at x
b(x) = body force distribution
F (force per unit length)
x E(x) = Young’s modulus
x
x=0 x=L
x1 x2
For each element 1 2
Element stiffness matrix
x2 x2
kij   Bi EB j Adx d1x
d2x
k   B EB Adx
T
x1 x1

dN i ( x)
where Bi 
dx
Only for a linear finite element


x2

x1
T
B EB Adx 
1
 x 2  x1 
2
 1 1 x2
 1 1  x1 AEdx 
 

x1
x2
AEdx  x x 
2
1
1
2
 1 1
 1 1 
 

Element nodal load vector


x2
f b i   N i b dx
x2
f b   N b dx
T
x1 x1

Question: How do we compute these integrals using a computer?


Any integral from x1 to x2 can be transformed to the following
integral on (-1, 1)
1
I   f (r ) dr
1

Use the following change of variables


1 r 1 r
x x1  x2
2 2
Goal: Obtain a good approximate value of this integral
1. Newton-Cotes Schemes (trapezoidal rule, Simpson’s rule, etc)
2. Gauss Integration Schemes

NOTE: Integration schemes in 1D are referred to as “quadrature


rules”
Trapezoidal rule: Approximate the function fr by a straight line
g(r)that passes through the end points and integrate the straight
line
gr f

f fr

r
-1 1
1 r 1 r
g (r )  f (1)  f (1)
2 2
1 1
I   f (r ) dr   g (r ) dr  f (1)  f (1)
1 1
•Requires the function f(x) to be evaluated at 2 points
(-1, 1)
• Constants and linear functions are exactly integrated
• Not good for quadratic and higher order polynomials

How can I make this better?


Simpson’s rule: Approximate the function f(r) by a parabola g(r)
that passes through the end points and through f(0) and integrate
the parabola f
fr gr

f
f(
r
-1 1
r (r  1) r (1  r )
g (r )  f (1)  (1  r )(1  r ) f (0)  f (1)
2 2
1 1 1 4 1
I   f (r ) dr   g (r ) dr  f (1)  f (0)  f (1)
1 1 3 3 3
•Requires the function f(x) to be evaluated at 3 points
(-1,0, 1)
• Constants, linear functions and parabolas are exactly
integrated
• Not good for cubic and higher order polynomials

How to generalize this formula?


Notice that both the integration formulas had the general form
M
I   f (r ) dr   Wi f (ri )
1

1
i 1

Weight Integration point


Trapezoidal rule: Accurate for polynomial of
W1  1 r1  1
M=2 degree at most 1 (=M-1)
W2  1 r2  1

Simpson’s rule: W1  1 / 3 r1  1 Accurate for polynomial of


M=3 W2  4 / 3 r2  0 degree at most 2 (=M-1)
W2  1 / 3 r2  1
Generalization of these two integration rules: Newton-Cotes
• Divide the interval (-1,1) into M-1 equal intervals using M points
• Pass a polynomial of degree M-1 through these M points (the
value of this polynomial will be equal to the value of the function
at these M-1 points)
• Integrate this polynomial to obtain an approximate value of the
integral
f
fr
f
gr
r
-1 1
With ‘M’ points we may integrate a polynomial of degree ‘M-1’
exactly.

Is this the best we can do ?

With ‘M’ integration points and ‘M’ weights, I should be able to


integrate a polynomial of degree 2M-1 exactly!!
Gauss integration rule

See table 10-1 (p 405) of Logan


Gauss quadrature
M
I   f (r ) dr   Wi f (ri )
1

1
i 1

Weight Integration point

How can we choose the integration points and weights to exactly


integrate a polynomial of degree 2M-1?

Remember that now we do not know, a priori, the location of the


integration points.
Example: M=1 (Midpoint qudrature)
1
I   f (r ) dr  W1 f (r1 )
1

How can we choose W1 and r1 so that we may integrate a


(2M-1=1) linear polynomial exactly?
f (r )  a0  a1r
1
1
f (r ) dr  2a0

But we want
1
1
f (r ) dr  W1 f (r1 )  a0W1  a0W1r1
Hence, we obtain the identity

2a0  a0W1  a1W1r1


For this to hold for arbitrary a0 and a1 we need to satisfy 2
conditions
Condition 1 : W1  2
Condition2 : W1r1  0

i.e., W1  2; r1  0
1
For M=1 I   f (r ) dr  2 f (0)
1

fr
f
gr

r
-1 1
Midpoint quadrature rule:
• Only one evaluation of fris required at the midpoint of the
interval.
• Scheme is accurate for constants and linear polynomials
(compare with Trapezoidal rule)
Example: M=2
1
I   f (r ) dr  W1 f (r1 )  W2 f (r2 )
1

How can we choose W1 ,W2 r1 and r2 so that we may integrate a


polynomial of degree (2M-1=4-1=3) exactly?
f (r )  a0  a1r  a2 r 2  a3r 3
1 2
1 f (r ) dr  2a0  3 a2
But we want
1
 1
f (r ) dr  W1 f (r1 )  W2 f (r2 )

 2 2
 
 a0 W1  W2   a1 W1r1  W2 r2   a2 W1r1  W2 r2  a3 W1r1  W2 r2
3 3

Hence, we obtain the 4 conditions to determine the 4 unknowns
(W1 ,W2 r1 and r2 )
Condition 1 : W1  W2  2
Condition 2 : W1r1  W2 r2  0
2 2
2
Condition 3 : W1r1  W2 r2 
3
3 3
Condition 4 : W1r1  W2 r2  0

Check that the following is the solution


W1  W2  1
1 1
r1   ; r2 
3 3
1 1 1
For M=2 I   f (r ) dr  f ( )  f ( )
1
3 3
1 1
f ( ) f( )
3 3
fr

* * r
-1 1

• Only two evaluations of fris required.


• Scheme is accurate for polynomials of degree at most 3
(compare with Simpson’s rule)
Exercise: Derive the 6 conditions required to find the
integration points and weights for a 3-point Gauss quadrature
rule

Newton-Cotes Gauss quadrature


1. ‘M’ integration points are 1. ‘M’ integration points are
necessary to exactly integrate necessary to exactly integrate a
a polynomial of degree ‘M-1’ polynomial of degree ‘2M-1’
2. More expensive 2. Less expensive
3. Exponential convergence,
error proportional to  1  2 M
 
 2 M 
Example
1
I   f (r )dr where f (r )  r 3  r 2
1
Exact integration
2
I Integrate and check!
3
Newton-Cotes
To exactly integrate this I need a 4-point Newton-Cotes
formula. Why?
Gauss
To exactly integrate this I need a 2-point Gauss formula.
Why?
Gauss quadrature:
1
I  f (r )dr
1

1 1
 f ( ) f ( )
3 3
2
 Exact answer!
3
Comparison of Gauss quadrature and Newton-Cotes for the
integral 1
I   cos(2x) dx
1

Newton-Cotes

Gauss quadrature
In FEM we ALWAYS use Gauss quadrature
Linear Element 2
1

r  1 r 1

Stiffness matrix
r 1
1  1  1 1
 1
 1  1  1
k   B EBAdr  
T
  AEdr   AEdr   
r  1
4   1 1  1  1  4   1 1 
Nodal load vector
1
f b i   N i b dr
1
f b   N b dr
T
1 1

Usually a 2-point Gauss integration is used. Note that if A, E and b


are complex functions of x, they will not be accurately integrated
Quadratic Element

Nodal shape functions 1 2 3


r (r  1) r  1 r 0 r 1
N1 ( r ) 
2
N 2 (r )  (1  r 2 ) You should be able to derive these!
r (r  1)
N 3 (r ) 
2
Stiffness matrix
r 1 r 1

 B EBAdr  AE  B Bdr Assuming E and A are constants


T T
k
r  1 r  1

dN  dN1 dN 2 dN 3   (2r  1) (2r  1) 


B     2r
dr  dr dr dr   2 2 
r 1 r 1

 B EBAdr  AE  B Bdr
T T
k
r  1 r  1

1
 (r  1/2) 2
 2r(r  1/2) (r 2
 1/4) 
 
 AE   2r(r  1/2) 4r 2  2r(r  1/2)dr
-1  2 
 (r 2
 1/4)  2r(r  1/2) (r  1/2) 

Need to exactly integrate quadratic terms.


Hence we need a 2-point Gauss quadrature scheme..Why?

You might also like