mane 4240 & civl 4240 introduction to finite elements

26
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De

Upload: matteo

Post on 21-Jan-2016

39 views

Category:

Documents


0 download

DESCRIPTION

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. y. F. x. x. x=L. x=0. 2. 1. d 2x. d 1x. Axially loaded elastic bar. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: MANE 4240 & CIVL 4240 Introduction to Finite Elements

MANE 4240 & CIVL 4240Introduction to Finite Elements

Numerical Integration in 1D

Prof. Suvranu De

Page 2: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Reading assignment:

Lecture notes, Logan 10.4

Summary:

• Newton-Cotes Integration Schemes•Gaussian quadrature

Page 3: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Axially loaded elastic bar

A(x) = cross section at xb(x) = body force distribution (force per unit length)E(x) = Young’s modulusx

y

x=0 x=Lx

F

2

1

TB EB dxx

xk A

Element stiffness matrix2

1i jB EB dx

x

ij xk A

1 2

d1xd2x

For each elementx1

x2

where i

( )B idN x

dx

Page 4: MANE 4240 & CIVL 4240 Introduction to Finite Elements

dxbN2

1x

x

Tbf

Element nodal load vector

dxbN2

1i

x

xibf

2 2 2

1 1 1

T

2 2

2 1 2 1

1 1 1 11 1B EB dx AEdx AEdx

1 1 1 1x x x x

x x x

x x xA

Only for a linear finite element

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

Page 5: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Any integral from x1 to x2 can be transformed to the following integral on (-1, 1)

1

1)( dfI

Use the following change of variables

21 2

1

2

1xxx

Goal: Obtain a good approximate value of this integral1. Newton-Cotes Schemes (trapezoidal rule, Simpson’s rule, etc)2. Gauss Integration Schemes

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

Page 6: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Trapezoidal rule: Approximate the function f by a straight line gthat passes through the end points and integrate the straight line

f

-1 1

f

fg

)1(2

1)1(

2

1)( ffg

)1()1()()(1

1

1

1

ffdgdfI

Page 7: MANE 4240 & CIVL 4240 Introduction to Finite Elements

•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?

Page 8: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Simpson’s rule: Approximate the function f by a parabola gthat passes through the end points and through f(0) and integrate the parabola

( 1) (1 )( ) ( 1) (1 )(1 ) (0) (1)

2 2g f f f

)1(3

1)0(

3

4)1(

3

1)()(

1

1

1

1

fffdgdfI

f

-1 1

f

fg

f(

Page 9: MANE 4240 & CIVL 4240 Introduction to Finite Elements

•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?

Page 10: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Notice that both the integration formulas had the general form

Trapezoidal rule:M=2

11

11

22

11

W

W

Simpson’s rule:M=3

Accurate for polynomial of degree at most 1 (=M-1)

13/1

03/413/1

22

22

11

W

WW Accurate for polynomial of

degree at most 2 (=M-1)

M

iii fWdfI

1

1

1)()(

Weight Integration point

Page 11: MANE 4240 & CIVL 4240 Introduction to Finite Elements

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

-1 1

f

f

g

Page 12: MANE 4240 & CIVL 4240 Introduction to Finite Elements

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

Page 13: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Gauss quadrature

M

iii fWdfI

1

1

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.

Page 14: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Example: M=1 (Midpoint qudrature)

How can we choose W1 and 1 so that we may integrate a (2M-1=1) linear polynomial exactly?

10)( aaf

)()( 11

1

1 fWdfI

0

1

12)( adf

But we want

101011

1

1)()( WaWafWdf

Page 15: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Hence, we obtain the identity

1111002 WaWaa

For this to hold for arbitrary a0 and a1 we need to satisfy 2 conditions

0:2

2:1

11

1

WCondition

WCondition

i.e., 0;2 11 W

Page 16: MANE 4240 & CIVL 4240 Introduction to Finite Elements

f

-1 1

f

g

For M=1 )0(2)(1

1fdfI

Midpoint quadrature rule: • Only one evaluation of fis required at the midpoint of the interval.• Scheme is accurate for constants and linear polynomials (compare with Trapezoidal rule)

Page 17: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Example: M=2

How can we choose W1 ,W2 1 and 2 so that we may integrate a polynomial of degree (2M-1=4-1=3) exactly?

33

2210)( aaaaf

)()()( 2211

1

1 fWfWdfI

20

1

1 3

22)( aadf

But we want

322

3113

222

211222111210

2211

1

1)()()(

WWaWWaWWaWWa

fWfWdf

Page 18: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Hence, we obtain the 4 conditions to determine the 4 unknowns (W1 ,W2 1 and 2 )

0:4

3

2:3

0:2

2:1

322

311

222

211

2211

21

WWCondition

WWCondition

WWCondition

WWCondition

Check that the following is the solution

3

1;

3

1

1

21

21

WW

Page 19: MANE 4240 & CIVL 4240 Introduction to Finite Elements

f

-1 1

For M=2 )3

1()

3

1()(

1

1ffdfI

• Only two evaluations of fis required.• Scheme is accurate for polynomials of degree at most 3 (compare with Simpson’s rule)

)3

1(f )

3

1(f

**

Page 20: MANE 4240 & CIVL 4240 Introduction to Finite Elements

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 necessary to exactly integrate a polynomial of degree ‘M-1’ 2. More expensive

1. ‘M’ integration points are necessary to exactly integrate a polynomial of degree ‘2M-1’ 2. Less expensive3. Exponential convergence, error proportional to M

M

2

2

1

Page 21: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Example

1 3 2

1f( )d f( )I where

Exact integration

2

3I Integrate and check!

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?

Page 22: MANE 4240 & CIVL 4240 Introduction to Finite Elements

1

1f( )d

1 1f(- ) f( )

3 32

3

I

Gauss quadrature:

Exact answer!

Page 23: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Comparison of Gauss quadrature and Newton-Cotes for the integral

1

1)2cos( dxxI

Newton-Cotes

Gauss quadrature

Page 24: MANE 4240 & CIVL 4240 Introduction to Finite Elements

In FEM we ALWAYS use Gauss quadrature

Linear Element1 2

1 1

1 1 1T

1 1 1

1 1 1 11 1B EB d AEd AEd

1 1 1 14 4k A

Stiffness matrix

dbN1

1 Tbf dbN

1

1 iibf

Nodal load vector

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

Page 25: MANE 4240 & CIVL 4240 Introduction to Finite Elements

Quadratic Element

2

1 1T T

1 1B EB d E B B dk A A

Stiffness matrix

Nodal shape functions 1

1 10

3

1

22

3

( ) 12

( ) 1

( ) 12

N

N

N

You should be able to derive these!

Assuming E and A are constants

31 2 1 1B 2 1 2 2 1

2 2

dNdN dNdN

d d d d

Page 26: MANE 4240 & CIVL 4240 Introduction to Finite Elements

1 1T T

1 1

2 2

12

1 22

B EB d E B B d

1/ 2 2 1/ 2 1/ 4

2 1/ 2 4 2 1/ 2

1/ 4 2 1/ 2 1/ 2

k A A

AE d

Need to exactly integrate quadratic terms.Hence we need a 2-point Gauss quadrature scheme..Why?