Presentation_RSE FEM Lectures_updated 26th Aug2015

85
Finite Element Method (FEM) L. Guneshwor SO/F, SSS, HPD 44 th Batch (Physics)

description

n,

Transcript of Presentation_RSE FEM Lectures_updated 26th Aug2015

Page 1: Presentation_RSE FEM Lectures_updated 26th Aug2015

Finite Element Method(FEM)

L. GuneshworSO/F, SSS, HPD

44th Batch (Physics)

Page 2: Presentation_RSE FEM Lectures_updated 26th Aug2015

Course details• No. of lectures : 10 + 1(tutorial)

• Several books in BARC library on FEM

• Following are the suggested books for this course:

• Basic Finite Element Method by Pepper & Heinrich• Finite Element Method by L. Segerlind• Finite Element Method by Huebner

Page 3: Presentation_RSE FEM Lectures_updated 26th Aug2015

Why FEM & How it is different from FDM

Issues with Finite Difference method

• Approximates the operator e.g. differentiation operator

• Find the solution only at the nodes

• Can use only parallel grids/mesh of nodes

• Difficult to represent complex geometries

• Difficult to handle variable material properties

Page 4: Presentation_RSE FEM Lectures_updated 26th Aug2015

Finite Element Method 1/2

• Approximates the state variable itself, not operators

• Solves over an element i.e. solutions are obtained over every point in the element

• It can represent any complex geometries much more accurately or closely

• Many kinds of elements can be designed; not constrained by parallel grids

• Can adaptively refine the mesh / grid efficiently

• Two ways to improve accuracy: • by improving the approximating function • changing the element sizes/shapes

Page 5: Presentation_RSE FEM Lectures_updated 26th Aug2015

Finite Element Method 2/2

• FEM is one of the most widely studied / researched method

• It is a well established method, being applied at industrial scale /large scale engineering projects

• Most new softwares /codes are implemented in FEM;

• even old / legacy codes are being updated with FEM

Page 6: Presentation_RSE FEM Lectures_updated 26th Aug2015

Method of weighted residuals

• Initially, an approximate function( called trial function) is assumed as the solution

• The trial functions has parameters which has to be determined so that it satisfies the differential eqn. as closely as possible

• Since it is not an exact solution, substitution of the trial function into the differential equation will produce an error (called residual)

• The unknown parameters in the trial function are determined such that the residual(i.e. error) is made as small as possible (minimized)

Page 7: Presentation_RSE FEM Lectures_updated 26th Aug2015

Weighted residual method• The residual is usually multiplied by a weighting function, and the integral

(summation) of the product is required to be zero

• The number of weighting functions equals the number of unknown parameters in the trial function

• As an example, let us take the 1D differential equation(DE) below:

Suppose is an approximate solution(trial function) to the above equation. Substitution into the above DE gives,

( since is only an approx.)

The weighted residual method requires that,

• There are several choices of the weighting functions ; each leading to a distinct/unique technique

Page 8: Presentation_RSE FEM Lectures_updated 26th Aug2015

Weighted residual method

Commonly used weighted residual methods

1. Point collocation method

2. Method of least squares

3. Galerkin’s residual approach

1. Point Collocation method• impulse (dirac delta) functions, are chosen as the weighting function

• this choice is equivalent to requiring the residual to vanish at specific points called collocation points i.e.

∫Ω

𝑅 (𝑥 )𝛿 (𝑥−𝑥 𝑖 )𝑑𝑥=0⇒𝑅 (𝑥𝑖 )=0 ; 𝑖=1,…. ,𝑛 ;𝑛=𝑁𝑜 .𝑜𝑓 𝑐𝑜𝑙𝑙𝑜𝑐𝑎𝑡𝑖𝑜𝑛 𝑝𝑜𝑖𝑛𝑡𝑠

Page 9: Presentation_RSE FEM Lectures_updated 26th Aug2015

1. Point collocation method (1/2)

Example: Solve the following equation by using and as the collocation points

boundary conditions(BC): Ans: Let us choose the following function as the trial function. It satisfies the BCs at both ends.Differentiating,

𝑑𝜙h

𝑑𝑥 =𝛼1 (1−2𝑥 )+𝛼2 (2𝑥−3 𝑥2 ) ; 𝑑2𝜙h

𝑑𝑥2 =−2𝛼1+𝛼2(2−6 𝑥 )

Substituting these into the given DE, the residual is obtained as,𝑅 (𝑥 )=𝑑2𝜙h

𝑑𝑥2 −𝜙h−𝑥=𝛼1 (𝑥2−𝑥−2 )+𝛼2 (𝑥3−𝑥2−6 𝑥+2 )−𝑥

Page 10: Presentation_RSE FEM Lectures_updated 26th Aug2015

1. Point collocation method (2/2)

This residuals is made zero at the collocation points x = 0.25 & 0.50 as below:

Solving the above equations

Hence, the solution is given by

Page 11: Presentation_RSE FEM Lectures_updated 26th Aug2015

2. Method of Least Squares (1/3)

• the sum (integral)of squares of the residuals are minimised after substitution of the trial function in the DE

- i.e. the residual itself is used as the weighting function

- the squared sum is minimised w.r.t. the unknown parameters (coefficients) of the trial function i.e.

Using differentiation inside integral rule,

Page 12: Presentation_RSE FEM Lectures_updated 26th Aug2015

2. Method of Least Squares (2/3)

Ans: Let us use the same trial function

The residual is given (see earlier derivation) by:

Minimising the squared sum of residuals w.r.t. the unknown parameters , we get the following simultaneous linear equation

∫0

1

[𝛼1 (𝑥2−𝑥−2 )+𝛼2 (𝑥3−𝑥2−6 𝑥+2 )− 𝑥   ] (𝑥2−𝑥−2 )𝑑𝑥=0

∫0

1

[𝛼1 (𝑥2−𝑥−2 )+𝛼2 (𝑥3−𝑥2−6 𝑥+2 )− 𝑥   ] (𝑥3−𝑥2−6 𝑥+2 )𝑑𝑥=0

Example : solve the previous equation using method of least squares?

Page 13: Presentation_RSE FEM Lectures_updated 26th Aug2015

On integration ( ),

Hence the solution is,

2. Method of Least Squares (2/3)

left as homework

Page 14: Presentation_RSE FEM Lectures_updated 26th Aug2015

3. Galerkin’s Method (1/3)

• Here the approximating or trial functions are used as the weighting functions

• Galerkin’s method requires that the approximating function be of the form

• The residual is forced to zero by weighting with the trial functions ’s i.e.

∫Ω

𝑤 𝑖 (𝑥 ) 𝑅 (𝑥 )𝑑Ω=0 ; h𝑤 𝑒𝑟𝑒𝑤𝑖 (𝑥 )=𝑁 𝑖 (𝑥)

Page 15: Presentation_RSE FEM Lectures_updated 26th Aug2015

Galerkin’s method (2/3)

Example: Solve the previous equation using Galerkins method?

Ans: Let us use the same approximating function,

Or, in Galerkin’s form

h𝑤 𝑒𝑟𝑒 ,𝑁1 (𝑥 )=𝑥−𝑥2;𝑁 2 (𝑥 )=𝑥2−𝑥3

The residual is (derived earlier),

Page 16: Presentation_RSE FEM Lectures_updated 26th Aug2015

Galerkin’s method (3/3)

Hence by Galerkin’s method,

∫0

1

(𝑥−𝑥2 )𝑅 (𝑥 )𝑑𝑥=0

∫0

1

(𝑥2−𝑥3 )𝑅 (𝑥 )𝑑𝑥=0

On solving,

Hence the solution is

(Homework: verify this step)

(Homework)

On substituting the expression for and integrating ,we get

Page 17: Presentation_RSE FEM Lectures_updated 26th Aug2015

Comparison of the 3 methods

• The solutions are

Method Solution,

Point Collocation

Least Squares

Galerkin’s method

• Comparison of solutions at some points (exact solution is: )

X Exact, Point collocation Least Squares method Galerkin’s method

% error % error % error

0.25 -0.0351 -0.0345 1.54 -0.03576 2.02 -0.0349 0.21

0.50 -0.0566 -0.5555 1.84 -0.05789 2.27 -0.0568 0.39

0.75 -0.0503 -0.0488 2.94 -0.05106 1.50 -0.0502 0.11

Page 18: Presentation_RSE FEM Lectures_updated 26th Aug2015

Finite element method

• Steps in FEM1. Create a grid/mesh of the domain - locating & numbering of nodes, specifying the coordinates of the nodes,

identifying the elements

2. Specify the approximation equation -shape function determination for each element

3. Develop the discretized equation for each element

-using Galerkin’s method, form the element equations

4. Assemble the element equations to form the global system of equations

5. Solve the system of equations

Page 19: Presentation_RSE FEM Lectures_updated 26th Aug2015

FEM in 1D

• The finite element formulation is illustrated with the following equation:

Discretization of the domain:

Nodes

x= 0 x = L

An element

1 2 3 4 5 6

1 2 3 4 5

Page 20: Presentation_RSE FEM Lectures_updated 26th Aug2015

Approximation of the solution

• Approximation function: Polynomials normally used as they are easy to manipulate

𝜙

x1 2

𝜙 (𝑥 )=𝑎0+𝑎1𝑥

• Let us take a linear one dimensional element as in the figure above. Let us interpolate or approximate the function with a line i.e.

…………………………(1)

𝜙2

𝜙1

Page 21: Presentation_RSE FEM Lectures_updated 26th Aug2015

Function approximation or shape function construction

• Referring to the figure, we can see that

⇒ {𝜙1=𝑎0+𝑎1𝑥1

𝜙2=𝑎0+𝑎2𝑥2⇒ [1 𝑥1

1 𝑥2][𝑎0

𝑎1]=[𝜙1

𝜙2]• On solving for the unknowns ,

𝑎0=𝜙1 𝑥2−𝜙2 𝑥1

𝑥2−𝑥1∧𝑎1=

𝜙2−𝜙1

𝑥2−𝑥1

• Putting these results into the interpolation function (eqn. 1),

𝜙 (𝑥 )=( 𝜙1 𝑥2−𝜙2 𝑥1

𝑥2−𝑥1)+( 𝜙2−𝜙1

𝑥2−𝑥1)𝑥¿ 𝑥2−𝑥𝑥2−𝑥1

𝜙1+𝑥−𝑥1

𝑥2−𝑥1𝜙2

𝜙 (𝑥 )=𝑁1 (𝑥 )𝜙1+𝑁2 (𝑥 ) 𝜙2 h𝑤 𝑒𝑟𝑒 ,𝑁1 (𝑥 )=𝑥2−𝑥𝑥2− 𝑥1

;𝑁 2 (𝑥 )=𝑥−𝑥1

𝑥2−𝑥1

It can be seen that are the Lagrange polynomials.

In matrix form, ………………..(2)

Or,

Page 22: Presentation_RSE FEM Lectures_updated 26th Aug2015

shape function construction

• are known as shape functions/basis functions/trial functions /interpolation functions

• Advantages of the Lagrange format

1. 𝑑𝜙𝑑𝑥 =𝑑𝑁1 (𝑥 )𝑑𝑥 𝜙1+

𝑑𝑁2 (𝑥 )𝑑𝑥 𝜙2

2.∫𝑥1

𝑥2

𝜙 (𝑥 )𝑑𝑥=(∫𝑥1

𝑥2

𝑁1 (𝑥 )𝑑𝑥 )𝜙1+(∫𝑥1

𝑥2

𝑁2 (𝑥 )𝑑𝑥 )𝜙2

¿ [∫𝑥1

𝑥2

𝑁1 (𝑥 )𝑑𝑥 ∫𝑥1

𝑥2

𝑁2 (𝑥 )𝑑𝑥 ]{𝜙1

𝜙2}=∫𝑥1

𝑥2

𝑁𝜙𝑑𝑥

Discretized equation for an element:Let us concentrate on a single element as shown in the previous slide.

¿ [ 𝑑𝑁 1 (𝑥 )𝑑𝑥

𝑑 𝑁2 (𝑥 )𝑑𝑥 ]{𝜙1

𝜙2}¿ 𝑑𝑁𝑑𝑥 𝜙

For this element the solution is approximated as:

Page 23: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretized equation• The residual can be obtained as

• Galerkin’s method: in this method the shape functions are used as the weighting function.

∫Ω

𝑅 (𝑥 ) 𝑁 𝑖 (𝑥 )𝑑𝑥=0 ; i=1,2Hence in our case,

• Putting the expression for the residual we get,

∫𝑥1

𝑥2 [ 𝑑2𝜙h

𝑑𝑥2 + 𝑓 (𝑥 )]𝑁 𝑖 (𝑥 )𝑑𝑥=0 ; 𝑖=1,2

⇒∫𝑥1

𝑥2 𝑑2𝜙h

𝑑𝑥2 𝑁 𝑖 (𝑥 )𝑑𝑥=−∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁 𝑖 (𝑥 )𝑑𝑥 ; 𝑖=1,2……(3)

Page 24: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretized equation• Applying integration by part , the LHS term can be simplified as

∫𝑥1

𝑥2

𝑁 𝑖 (𝑥 ) 𝑑2𝜙h

𝑑𝑥2 𝑑𝑥¿ [𝑁 𝑖 (𝑥 ) 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

−∫𝑥1

𝑥2 𝑑𝑁 𝑖 (𝑥 )𝑑𝑥

𝑑𝜙h𝑑𝑥 𝑑𝑥 ; 𝑖=1,2

• This expansion is known as the weak form, since the order of the differential equation has been ‘weakened’ /reduced

………………….(4)

• Let us now explicitly evaluate the terms of equation (3)

Page 25: Presentation_RSE FEM Lectures_updated 26th Aug2015

Galerkin’s Method

∫𝑥1

𝑥2 [ 𝑑2𝜙h

𝑑𝑥2 + 𝑓 (𝑥 )]𝑁 1 (𝑥 )𝑑𝑥=0⇒∫𝑥1

𝑥2 𝑑2𝜙h

𝑑𝑥2 𝑁 1 (𝑥 )𝑑𝑥=−∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥

∫Ω

𝑅 (𝑥 ) 𝑁 𝑖 (𝑥 )𝑑𝑥=0 ; i=1,2⇒ {∫𝑥1

𝑥2

𝑅 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥=0… (3𝑎)

∫𝑥1

𝑥2

𝑅 (𝑥 ) 𝑁2 (𝑥 )𝑑𝑥=0… (3𝑏)

• Putting the expression for the residual in eqn. (3a) , we get,

⇒ [𝑁1 (𝑥 ) 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

−∫𝑥1

𝑥2 𝑑𝑁 1 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥

⇒𝑁 1 (𝑥2 )𝑑𝜙h (𝑥2 )

𝑑𝑥 −𝑁1 (𝑥1 )𝑑𝜙h (𝑥1 )

𝑑𝑥⏞

¿−∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 )𝑑𝑥

−∫𝑥1

𝑥2 𝑑𝑁1 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥¿−∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 )𝑑𝑥

⇒−𝑑𝜙h (𝑥1 )

𝑑𝑥 −∫𝑥1

𝑥2 𝑑𝑁1 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥¿−∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 )𝑑𝑥

0 1

Integrating by parts,

…………… (5a)

Page 26: Presentation_RSE FEM Lectures_updated 26th Aug2015

Galerkin’s Method contd.

∫𝑥1

𝑥2 [ 𝑑2𝜙h

𝑑𝑥2 + 𝑓 (𝑥 )]𝑁 2 (𝑥 )𝑑𝑥=0⇒∫𝑥1

𝑥2 𝑑2𝜙h

𝑑𝑥2 𝑁 2 (𝑥 )𝑑𝑥=−∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁2 (𝑥 )𝑑𝑥

• Similarly , we get from eqn. (3b) :

⇒ [𝑁2 (𝑥 ) 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

−∫𝑥1

𝑥2 𝑑 𝑁2 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥

⇒𝑁 2 (𝑥2 )𝑑𝜙h (𝑥2 )

𝑑𝑥 −𝑁 2 (𝑥1 )𝑑𝜙h (𝑥1 )𝑑𝑥

¿−∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥

−∫𝑥1

𝑥2 𝑑𝑁2 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥¿−∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥

⇒𝑑𝜙h (𝑥2 )𝑑𝑥 −∫

𝑥1

𝑥2 𝑑𝑁2 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥¿−∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥

1 0

Integrating by parts,

…………… (5b)

Page 27: Presentation_RSE FEM Lectures_updated 26th Aug2015

Discretization

Using equations 5a & 5b , the original equation (3) can be written as below

For

⇒∫𝑥1

𝑥2 𝑑𝜙h𝑑𝑥

𝑑𝑁1

𝑑𝑥 𝑑𝑥=−𝑑𝜙h (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥

Similarly, for

Page 28: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretised equation

Thus for the element ,the discretized system of equations is:

∫𝑥1

𝑥2 𝑑𝜙h

𝑑𝑥𝑑𝑁1

𝑑𝑥 𝑑𝑥=−𝑑𝜙h (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 )𝑑𝑥

∫𝑥1

𝑥2 𝑑𝜙h

𝑑𝑥𝑑𝑁2

𝑑𝑥 𝑑𝑥=𝑑𝜙h (𝑥2 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥………….. (6)

A few observations: Neumann(derivative) boundary condition has been directly incorporated

into the element equations because of integration by parts

Lowering of the 2nd derivative to 1st derivative means that the approximation function needs to preserve continuity of value but not slope at the nodes

On the RHS: First term represent boundary condition of the element Second term represents the systems forcing function /load function

LHS represents the internal mechanisms that governs the distribution of over the element

Page 29: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretized equation• Let us now evaluate the LHS integrals explicitly:

𝑁1 (𝑥 )=𝑥2−𝑥𝑥2− 𝑥1

⇒𝑑𝑁1

𝑑𝑥 =− 1𝑥2−𝑥1

;𝑁 2 (𝑥 )=𝑥−𝑥1

𝑥2−𝑥1

⇒𝑑𝑁2

𝑑𝑥 = 1𝑥2−𝑥1

also,𝜙h (𝑥 )=𝑁1 (𝑥 )𝜙1+𝑁 2 (𝑥 )𝜙2⇒

𝑑𝜙h

𝑑𝑥 =𝑑𝑁1

𝑑𝑥 𝜙1+𝑑 𝑁2

𝑑𝑥 𝜙2

• Using the preceding results,

𝑑𝜙h

𝑑𝑥 =− 1𝑥2−𝑥1

𝜙1+1

𝑥2−𝑥1𝜙2

Hence,

¿𝜙2−𝜙1

𝑥2− 𝑥1

∫𝑥1

𝑥2 𝑑𝜙h

𝑑𝑥 .𝑑 𝑁1

𝑑𝑥 𝑑𝑥=∫𝑥1

𝑥2 𝜙2−𝜙1

𝑥2− 𝑥1. −1𝑥2−𝑥1

𝑑𝑥¿− 𝜙2−𝜙1

(𝑥2−𝑥1 )2∫𝑥1

𝑥2

𝑑𝑥

Similarly,

¿𝜙2−𝜙1

(𝑥2−𝑥1 )2∫𝑥1

𝑥2

𝑑𝑥∫𝑥1

𝑥2 𝑑𝜙h

𝑑𝑥 .𝑑 𝑁2

𝑑𝑥 𝑑𝑥=∫𝑥1

𝑥2 𝜙2−𝜙1

𝑥2−𝑥1. 1𝑥2−𝑥1

𝑑𝑥

¿−𝜙2+𝜙1

𝑥2−𝑥1

¿𝜙2−𝜙1

𝑥2− 𝑥1

Page 30: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretized equation

• Thus equations (6) can be written as,

−𝜙2+𝜙1

𝑥2−𝑥1=−

d𝜙h (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥

𝜙2−𝜙1

𝑥2−𝑥1=d𝜙h (𝑥2 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁2 (𝑥 )𝑑𝑥 ………….(8)

• In matrix form, it can be written as,

1𝑥2−𝑥1

[ 1 −1−1 1 ]⏟ {𝜙1

𝜙2}stiffness   matrix

¿ {− 𝑑𝜙h (𝑥1 )𝑑𝑥

𝑑𝜙h (𝑥2 )𝑑𝑥

}⏟boundary   condition

+{∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥

∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁2 (𝑥 )𝑑𝑥 }⏟load  vector ( external  effects ) 

……………(9)

Page 31: Presentation_RSE FEM Lectures_updated 26th Aug2015

More than 1 element (Assembling of element equations)

Let us consider the two element grid as shown below,

x1 x2

1 2Elements:

Nodes: x3

The shape functions are given by:

Point 1: 𝑁1 (𝑥 )={ 𝑥−𝑥2

𝑥1−𝑥2; 𝑥1≤𝑥 ≤𝑥2

0 ; h𝑜𝑡 𝑒𝑟𝑤𝑖𝑠𝑒

Point 2: 𝑁 2 (𝑥 )={ 𝑥1−𝑥𝑥1−𝑥2

;𝑥1≤𝑥 ≤𝑥2

¿𝑥−𝑥3

𝑥2−𝑥3;𝑥2≤𝑥 ≤𝑥3

Point 3 : 𝑁 3 (𝑥 )={ 𝑥2−𝑥𝑥2−𝑥3

;𝑥2≤ 𝑥≤ 𝑥3

0 ; h𝑜𝑡 𝑒𝑟𝑤𝑖𝑠𝑒

Page 32: Presentation_RSE FEM Lectures_updated 26th Aug2015

Assembling of element equations

Let us apply Galerkin’s finite element formulation,

∫Ω

𝑁 𝑖 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0 ; 𝑖=1,2,3

Writing explicitly,

∫𝑥1

𝑥3

𝑁 1 (𝑥 )𝑅 (𝑥 )𝑑𝑥=0

∫𝑥1

𝑥3

𝑁 2 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0

∫𝑥1

𝑥3

𝑁 3 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0

Let us evaluate the integrals corresponding to the boundary points 1 & 3. Take the 1st integral,

∫𝑥1

𝑥3

𝑁 1 (𝑥 )𝑅 (𝑥 )𝑑𝑥=0⇒∫𝑥1

𝑥2

𝑁1 (𝑥 )𝑅 (𝑥 )𝑑𝑥+∫𝑥2

𝑥3

𝑁 1 (𝑥 )𝑅 (𝑥 )𝑑𝑥=0

⇒∫𝑥1

𝑥2

𝑁1 (𝑥 )𝑅 (𝑥 )𝑑𝑥+∫𝑥2

𝑥3

0.𝑅 (𝑥 )𝑑𝑥=0 (∵𝑁 1 (𝑥 )=0 𝑓𝑜𝑟 𝑥2≤𝑥 ≤𝑥3)

Page 33: Presentation_RSE FEM Lectures_updated 26th Aug2015

Assembling the element equations

Or,∫𝑥1

𝑥2

𝑁 1 (𝑥 )𝑅 (𝑥 )𝑑𝑥=0

• This is the same integral we have evaluated earlier for a single element case.

• As we saw there, integrating by parts and re-arranging the terms gives the following result (refer to equation 8),

−𝜙2+𝜙1

𝑥2−𝑥1=−

d𝜙h (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥

For point 3: a similar process gives

∫𝑥1

𝑥3

𝑁 3 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0⇒∫𝑥1

𝑥2

𝑁3 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥+∫𝑥2

𝑥3

𝑁 3 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0

⇒∫𝑥1

𝑥2

0.𝑅 (𝑥 )𝑑𝑥+¿∫𝑥2

𝑥3

𝑁 3 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0¿(∵𝑁3 (𝑥 )=0 𝑓𝑜𝑟 𝑥1≤ 𝑥≤ 𝑥2 )

As for point 1 above, referring to equation (8) again, we get,

−𝜙2+𝜙3

𝑥3−𝑥2=−

d𝜙h (𝑥3 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 )𝑁 3 (𝑥 )𝑑𝑥

Page 34: Presentation_RSE FEM Lectures_updated 26th Aug2015

Assembling the element equationsFor point 2: the Galerkin formulation gives,

∫𝑥1

𝑥3

𝑁 2 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥=0⇒∫𝑥1

𝑥2

𝑁2 (𝑥 ) 𝑅 (𝑥 )𝑑𝑥+∫𝑥2

𝑥3

𝑁 2 (𝑥 )𝑅 (𝑥 )𝑑𝑥=0

• Here, both the integrals has to be evaluated as is defined in both the intervals.

• But these integrals has been evaluated earlier.

• Now using integration by parts to each integrals and re-arranging (homework & refer to equation 8), we get,

𝜙2−𝜙1

𝑥2−𝑥1+¿−𝜙3+𝜙2

𝑥3−𝑥2=¿−

𝑑𝜙 (𝑥2 )𝑑𝑥

+𝑑𝜙 (𝑥2 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁 2 (𝑥 )𝑑𝑥+∫𝑥2

𝑥3

𝑓 (𝑥 ) 𝑁 2 (𝑥 )𝑑𝑥

• Thus we get 3 equations corresponding to the shape function (weighting function) of the 3 points. This forms the system equation. Assuming ,we can write

𝜙1

Δ𝑥 −𝜙2

Δ𝑥=−𝑑𝜙 (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁1 (𝑥 )𝑑𝑥

−𝜙1

Δ𝑥 +2𝜙2

Δ𝑥 −𝜙3

Δ 𝑥=∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥+¿∫𝑥2

𝑥3

𝑓 (𝑥 ) 𝑁 2 (𝑥 )𝑑𝑥¿

𝜙3

Δ𝑥 −𝜙2

Δ𝑥=−𝑑𝜙 (𝑥3 )𝑑𝑥 +∫

𝑥2

𝑥3

𝑓 (𝑥 )𝑁 3 (𝑥 )𝑑𝑥

Page 35: Presentation_RSE FEM Lectures_updated 26th Aug2015

Assembling the element equations

𝜙1

Δ𝑥 −𝜙2

Δ𝑥 +0.𝜙3=−𝑑𝜙 (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 )𝑑𝑥

−𝜙1

Δ𝑥 +𝜙2

Δ 𝑥 +𝜙2

Δ 𝑥 −𝜙3

Δ𝑥=∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁 2 (𝑥 ) 𝑑𝑥+¿∫𝑥2

𝑥3

𝑓 (𝑥 ) 𝑁2 (𝑥 )𝑑𝑥 ¿

0.𝜙1−𝜙2

Δ𝑥 +𝜙3

Δ𝑥=−𝑑𝜙 (𝑥3 )𝑑𝑥 +∫

𝑥2

𝑥3

𝑓 (𝑥 )𝑁 3 (𝑥 )𝑑𝑥

• In matrix form, we can write as,

• The system of equations can be written as,

[ 1 −1 0−1 1+1 −10 −1 1 ]{𝜙1

𝜙2

𝜙3}={ 𝑓 1

𝑓 2+ 𝑓 2 ′𝑓 3

}or,

[ 1 −1 0−1 2 −10 −1 1 ]{𝜙1

𝜙2

𝜙3}={ 𝑓 1

𝑓 2+ 𝑓 2 ′𝑓 3

}

Page 36: Presentation_RSE FEM Lectures_updated 26th Aug2015

Assembling of element equations

• An alternative way to remember the assembling process is as discussed below.• Let us consider the two element grid as shown below:

x1 x2

1 2Elements:

Nodes: x3

• The element equations are of the form (assuming unit grid size i.e. 1),

Element 1: Element 2:

• Since there are a total of three nodes, the global equation will have three unknowns viz., .

• The above element equations can be transformed as below to include all the 3 unknowns:

Element 1: ; Element 2:

Page 37: Presentation_RSE FEM Lectures_updated 26th Aug2015

Assembling the element equations

• Now the two equations can be combined (added) into a single global matrix as below:

[ 1 −1 0−1 1+1 −10 −1 1 ]{𝜙1

𝜙2

𝜙3}={ 𝑓 1

𝑓 2+ 𝑓 2 ′𝑓 3

}Or,

[ 1 −1 0−1 2 −10 −1 1 ]{𝜙1

𝜙2

𝜙3}={ 𝑓 1

𝑓 2+ 𝑓 2 ′𝑓 3

}

• This is equivalent to adding the individual element stiffness & load vectors at the joining point.

Conclusion: To assemble the global system of equation Form the stiffness and load vectors for each individual elements

Add/combine the element stiffness & load vectors at their joining nodes

Page 38: Presentation_RSE FEM Lectures_updated 26th Aug2015

Example problem• Solve the DE,

• using the grid given below:

x1=0 x2 =2.5 x3 =5.0 x4 =7.5 x5 =10

1 2 3 4Elements:

Nodes:

Ans: Please refer to equation (9). Let us evaluate the RHS integrals explicitly using

For element 1:

∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 ) 𝑑𝑥¿∫0

2.5

10. 2.5−𝑥2.5−0

𝑑𝑥¿ 4∫0

2.5

(2.5−𝑥 ) 𝑑𝑥=12.5

∫𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥¿∫0

2.5

10. 𝑥−02.5−0

𝑑𝑥¿ 4∫0

2.5

𝑥𝑑𝑥=12.5

Page 39: Presentation_RSE FEM Lectures_updated 26th Aug2015

Example problem• thus the elemental equation for element 1 is given by,

12.5−0 [ 1 −1

−1 1 ]{𝜙1

𝜙2}={− 𝑑𝜙 (0 )𝑑𝑥

𝑑𝜙 (2.5 )𝑑𝑥

}+{12.512.5 }

• Repeat the process for other elements,

For element 2:

∫𝑥2

𝑥3

𝑓 (𝑥 )𝑁 1 (𝑥 ) 𝑑𝑥 ¿∫2.5

5.0

10. 5−𝑥5−2.5

𝑑𝑥¿ 4∫2.5

5

(5− 𝑥 )𝑑𝑥=12.5

∫𝑥2

𝑥3

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥¿∫2.5

5

10. 𝑥−2.55−2.5

𝑑𝑥¿ 4∫2.5

5

(𝑥−2.5 ) 𝑑𝑥=12.5

the element equation is,

12.5 [ 1 −1

−1 1 ]{𝜙2

𝜙3}={− 𝑑𝜙 (2.5 )𝑑𝑥

𝑑𝜙 (5 )𝑑𝑥

}+{12.512.5 }

Page 40: Presentation_RSE FEM Lectures_updated 26th Aug2015

Example problemFor element 3:

∫𝑥3

𝑥4

𝑓 (𝑥 )𝑁 1 (𝑥 ) 𝑑𝑥=∫5

7.5

10. 7.5− 𝑥7.5−5 𝑑𝑥=4∫5

7.5

(7.5−𝑥 )𝑑𝑥=12.5

∫𝑥3

𝑥4

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥=∫5

7.5

10. 𝑥−52.5 𝑑𝑥=4∫5

7.5

(𝑥−5 )𝑑𝑥=12.5

the element equation is,12.5 [ 1 −1

−1 1 ]{𝜙3

𝜙4}={− 𝑑𝜙 (5 )𝑑𝑥

𝑑𝜙 (7.5 )𝑑𝑥

}+{12.512.5 }For element 4:

∫𝑥4

𝑥5

𝑓 (𝑥 )𝑁 1 (𝑥 ) 𝑑𝑥=∫7.5

10

10. 10− 𝑥10−7.5 𝑑𝑥=4∫

7.5

10

(10−𝑥 ) 𝑑𝑥=12.5

∫𝑥4

𝑥5

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥=∫7.5

10

10. 𝑥−7.52.5 𝑑𝑥=4∫7.5

10

(𝑥−7.5 )𝑑𝑥=12.5

the element equation is,

12.5 [ 1 −1

−1 1 ]{𝜙4

𝜙5}={− 𝑑𝜙 (7.5 )𝑑𝑥

𝑑𝜙 (10 )𝑑𝑥

}+{12.512.5 }

Page 41: Presentation_RSE FEM Lectures_updated 26th Aug2015

Example problem -Assembling element equation

• Using the technique described previously, the 4 element equations of the example problem can be assembled as below:

12.5 [ 1 −1 0 0 0

−1 1+1 −1 0 0000

−100

1+1 −1 0−10

1+1−1

−11

]{𝜙1

𝜙2

𝜙3

𝜙4

𝜙5

}={−𝑑𝜙 (0 )𝑑𝑥

𝑑𝜙 (2.5 )𝑑𝑥 −

𝑑𝜙(2.5)𝑑𝑥

𝑑𝜙 (5 )𝑑𝑥 − 𝑑𝜙(5)

𝑑𝑥𝑑𝜙 (7.5 )𝑑𝑥 − 𝑑𝜙(7.5)

𝑑𝑥𝑑𝜙 (10 )𝑑𝑥

}+{12.525252512.5

} ; (on applying the BCs)

Page 42: Presentation_RSE FEM Lectures_updated 26th Aug2015

Example problem –Solving the discretised system

Rearranging the terms (homework: verify it) , we can re-write the equation as,

[1 −0.4 0 0 00 0.8 −0.4 0 00 −0.4 0.8 −0.4 00 0 −0.4 0.8 00 0 0 −0.4 −1

]{𝑑𝜙 (0 )𝑑𝑥𝜙2

𝜙3

𝜙4

𝑑𝜙 (10 )𝑑𝑥

}={−3.54125105−67.5

}Homework: Solve the above equation and compare it to the exact solution

Page 43: Presentation_RSE FEM Lectures_updated 26th Aug2015

Comparision of FEM & Exact solution

Page 44: Presentation_RSE FEM Lectures_updated 26th Aug2015

Improving the accuracy

• Increase the number of sub-divisions

Page 45: Presentation_RSE FEM Lectures_updated 26th Aug2015

Matrix formulation of element equation

• The function approximation is,

¿ [𝑁 1 (𝑥 ) 𝑁 2 (𝑥 ) ]{𝜙1

𝜙2}¿𝑵 𝝓

where,

• The Galerkin formulation is,

• Hence, in matrix form, Galerkin’s formulation is

∫𝑥1

𝑥2

{𝑁 1 (𝑥 )𝑁 2 (𝑥 )}𝑅 (𝑥 )𝑑𝑥=𝟎⇒∫

𝑥1

𝑥2

𝑵𝑇 𝑅 (𝑥 )𝑑𝑥=𝟎;h𝑒𝑟𝑒𝟎={00}

¿𝑑2𝑵𝑑𝑥2 𝝓+ 𝑓 (𝑥 )

𝜙h (𝑥 )=𝑁1 (𝑥 )𝜙1+𝑁 2 (𝑥 )𝜙2¿∑𝑖=1

2

𝑁 𝑖 (𝑥 )𝜙 𝑖

• But,(plz. see previous notes) : 𝑅 (𝑥 )=𝑑2𝜙h

𝑑𝑥2 + 𝑓 (𝑥 )

Page 46: Presentation_RSE FEM Lectures_updated 26th Aug2015

Matrix formulation of element equation

• Putting this in the previous Galerkin’s formulation, we get

∫𝑥1

𝑥2

𝑵𝑇 [ 𝑑2𝑵𝑑𝑥2 𝝓+ 𝑓 (𝑥 )]𝑑𝑥=𝟎⇒ (∫𝑥1

𝑥2

𝑵𝑇 𝑑2𝑵𝑑𝑥2 𝑑𝑥 )𝝓+∫

𝑥1

𝑥2

𝑵𝑇 𝑓 (𝑥 )𝑑𝑥=𝟎

• Applying integration by parts,

[𝑵𝑇 𝑑𝑵𝑑𝑥 ]𝑥1

𝑥2

𝝓−¿

⇒(∫𝑥1

𝑥2 𝑑𝑵𝑇

𝑑𝑥𝑑𝑵𝑑𝑥 𝑑𝑥 )𝝓=[𝑵𝑇 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

+∫𝑥1

𝑥2

𝑵𝑇 𝑓 (𝑥 ) 𝑑𝑥 ……….(10)

• Let us evaluate the terms explicitly for a linear element (refer the fig.) Recall that,

𝑁1 (𝑥 )=𝑥2−𝑥𝑥2− 𝑥1

∧𝑁 2 (𝑥 )=𝑥−𝑥1

𝑥2−𝑥1;𝑙𝑒𝑡 Δ𝑥=𝑥2−𝑥1

x1 x2

1

• Now,

𝑑𝑵𝑑𝑥 =[ 𝑑𝑁1

𝑑𝑥𝑑 𝑁2

𝑑𝑥 ] ¿ [− 1Δ𝑥

1Δ𝑥 ] ¿ 1

Δ𝑥 [−11]; ∴ 𝑑𝑵𝑇

𝑑𝑥 =1Δ𝑥 {−11 }

Page 47: Presentation_RSE FEM Lectures_updated 26th Aug2015

Matrix formulation of element equation• LHS is:

∫𝑥1

𝑥2 𝑑𝑵𝑇

𝑑𝑥𝑑𝑵𝑑𝑥 𝑑𝑥¿ 1

(Δ 𝑥 )2∫𝑥1

𝑥2

{−11 } [−11 ]𝑑𝑥¿1

(Δ 𝑥 )2∫𝑥1

𝑥2

[ 1 −1−1 1 ]𝑑𝑥

¿ 1(Δ 𝑥 )2 [ Δ𝑥 − Δ𝑥

− Δ𝑥 Δ𝑥 ] ¿ 1Δ𝑥 [ 1 −1

−1 1 ]• 1st term of RHS:

[𝑵𝑇 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

¿𝑵 𝑇 (𝑥2 )𝑑𝜙h (𝑥2 )𝑑𝑥 −𝑵𝑇 𝑑𝜙

h (𝑥1 )𝑑𝑥

¿ {𝑁 1 (𝑥2 )𝑁 2 (𝑥2 )}𝑑𝜙

h (𝑥2 )𝑑𝑥 −{𝑁 1 (𝑥1 )

𝑁 2 (𝑥1 )}𝑑𝜙h (𝑥1)𝑑𝑥

¿ {01 }𝑑𝜙h (𝑥2 )𝑑𝑥 −{10}

𝑑𝜙h (𝑥1 )𝑑𝑥

¿ {− 𝑑𝜙h (𝑥1)

𝑑𝑥𝑑𝜙h (𝑥2 )

𝑑𝑥}

• 2nd term of RHS:

∫𝑥1

𝑥2

𝑵𝑇 𝑓 (𝑥 )𝑑𝑥 ¿∫𝑥1

𝑥2

{𝑁 1(𝑥 )𝑁 2(𝑥 )} 𝑓 (𝑥 )𝑑𝑥 ¿ {∫𝑥1

𝑥2

𝑁 1 (𝑥 ) 𝑓 (𝑥 ) 𝑑𝑥

∫𝑥1

𝑥2

𝑁 2 (𝑥 ) 𝑓 (𝑥 ) 𝑑𝑥}

Page 48: Presentation_RSE FEM Lectures_updated 26th Aug2015

Matrix formulation of FEM

• Putting these results in equation (10), we get,

1Δ𝑥 [ 1 −1

−1 1 ] {𝜙1

𝜙2}={− 𝑑𝜙h (𝑥1 )𝑑𝑥

𝑑𝜙h (𝑥2 )𝑑𝑥

}+{∫𝑥1

𝑥2

𝑁 1 (𝑥 ) 𝑓 (𝑥 )𝑑𝑥

∫𝑥1

𝑥2

𝑁 2 (𝑥 ) 𝑓 (𝑥 )𝑑𝑥}which is the same equation (9) derived earlier.

Advantage of matrix formulation:

it allows generalization of the finite element formulation to any type of shape function

Page 49: Presentation_RSE FEM Lectures_updated 26th Aug2015

Quadratic elements

• Refer to the figure below which shows the difference between approximating a function with linear and quadratic functions

• Clearly the use of quadratic functions can drastically improve the accuracy as they adds curvature

LinearQuadratic

Exact

Page 50: Presentation_RSE FEM Lectures_updated 26th Aug2015

Quadratic elements• A general quadratic or parabolic functions is of the form:

…………..(11)𝜙h (𝑥 )=𝑎0+𝑎1𝑥+𝑎2𝑥2

𝜙

𝑥

𝜙1

𝜙2𝜙3

0 L/2 L

• Let us use a quadratic polynomial as the interpolation function for an element as shown in figure.

• Such an element has 3 nodes.• Since the interpolation function has to pass through the 3

points, we get(similar to linear case),

𝜙1=𝑎0+𝑎1 .0+𝑎2 .02=𝑎0

𝜙2=𝑎0+𝑎1( 𝐿2 )+𝑎2( 𝐿2 )2

𝜙3=𝑎0+𝑎1𝐿+𝑎2 𝐿2

⇒ {𝜙1

𝜙2

𝜙3}=[1 0 0

1 𝐿2

𝐿2

41 𝐿 𝐿2 ]{𝑎0

𝑎1

𝑎2}

Page 51: Presentation_RSE FEM Lectures_updated 26th Aug2015

Quadratic element

• The above equation can be solved for the unknown coeffs. (left as homework)

• Substituting these solutions back into equation (11) and re-arranging /collecting the terms for , we get the shape functions,

𝜙h (𝑥 )=𝑁1 (𝑥 )𝜙1+𝑁 2 (𝑥 )𝜙2+𝑁 3 (𝑥 )𝜙3

¿ [𝑁 1(𝑥) 𝑁 2(𝑥) 𝑁 3(𝑥)] {𝜙1

𝜙2

𝜙3}¿𝑵𝝓

where(verification left as homework),𝑁1 (𝑥 )=1− 3𝑥

𝐿 +2 𝑥2

𝐿2 ;𝑁2 (𝑥 )=4 𝑥𝐿 (1− 𝑥

𝐿);𝑁 3 (𝑥 )= 𝑥𝐿 ( 2 𝑥𝐿 −1)

Now, ¿ [ 4 𝑥𝐿2 −

3𝐿

4𝐿 −

8 𝑥𝐿2

4 𝑥𝐿2 −

1𝐿 ]

Page 52: Presentation_RSE FEM Lectures_updated 26th Aug2015

Quadratic element

• Now the stiffness matrix for a quadratic element is then given by (refer to eqn. 10)

∫𝑥1

𝑥3 𝑑𝑵𝑇

𝑑𝑥𝑑𝑵𝑑𝑥 𝑑𝑥¿∫

0

𝐿 {4 𝑥𝐿2 −

3𝐿

4𝐿 −

8 𝑥𝐿2

4 𝑥𝐿2 −

1𝐿

}[ 4 𝑥𝐿2 −3𝐿

4𝐿 −

8𝑥𝐿2

4 𝑥𝐿2 −

1𝐿 ]𝑑𝑥

¿∫0

𝐿 [ ( 4 𝑥𝐿2 −3𝐿 )

2

( 4 𝑥𝐿2 −3𝐿 )( 4𝐿 − 8 𝑥

𝐿2 ) ( 4 𝑥𝐿2 −3𝐿 )( 4 𝑥𝐿2 −

1𝐿)

( 4𝐿− 8𝑥𝐿2 )( 4 𝑥𝐿2 −

3𝐿 ) ( 4𝐿− 8𝑥

𝐿2 )2

( 4𝐿 − 8 𝑥𝐿2 )( 4 𝑥𝐿2 −

1𝐿 )

( 4 𝑥𝐿2 −1𝐿 )( 4 𝑥𝐿2 −

3𝐿 ) ( 4 𝑥𝐿2 −

1𝐿 )( 4𝐿 − 8 𝑥

𝐿2 ) ( 4 𝑥𝐿2 −1𝐿 )

2 ]𝑑𝑥

Page 53: Presentation_RSE FEM Lectures_updated 26th Aug2015

Quadratic element

• On integration, the stiffness matrix is given by,

∫𝑥1

𝑥3 𝑑𝑵𝑇

𝑑𝑥𝑑𝑵𝑑𝑥 𝑑𝑥 ¿ 1

6𝐿 [ 1 4 −16 2−16 32 −162 −16 14 ]

• The boundary flux term is given by,

[𝑵𝑇 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥3

¿ {𝑁 1(𝑥3)𝑁 2(𝑥3)𝑁 3(𝑥3)

}𝑑𝜙h(𝑥3)𝑑𝑥 −{𝑁1(𝑥1)

𝑁 2(𝑥1)𝑁3 (𝑥1)

}𝑑𝜙h(𝑥1)𝑑𝑥

¿ {001 }𝑑𝜙h(𝑥3)𝑑𝑥 − {100}𝑑𝜙

h(𝑥1)𝑑𝑥¿

¿ {− 𝑑𝜙h (𝑥1)𝑑𝑥0

𝑑𝜙h (𝑥3 )𝑑𝑥

}

Page 54: Presentation_RSE FEM Lectures_updated 26th Aug2015

Quadratic Element• The load vector is given by (refer eqn. 10)

∫𝑥1

𝑥3

𝑵𝑇 𝑓 (𝑥 )𝑑𝑥¿∫0

𝐿 {𝑁 1(𝑥)𝑁 2(𝑥)𝑁 3(𝑥)} 𝑓 (𝑥 )𝑑𝑥¿∫

0

𝐿 {1−3 𝑥𝐿 +2 𝑥

2

𝐿2

4 𝑥𝐿 (1− 𝑥𝐿 )

𝑥𝐿 ( 2𝑥𝐿 −1) }𝑓 (𝑥 )𝑑𝑥

• Important Observations:

• Obviously, even higher-order elements e.g. cubic (degree=3), quartic (degree=4), quantic (degree=5) etc. can be constructed by adding more interpolation nodes in an element

• Even though the derivatives of quadratic elements are functions of x (independent variable), they will not be continuous at the inter-element nodes

• The interpolation type used here is called Lagrangian& it only guarantees continuity of function across inter-element boundaries (C0 elements)

• Elements that also interpolate derivatives at the nodes can also be constructed (Hermite polynomials) e.g. cubic Hermites interpolates the function and its first derivative at the 2 nodes located at the ends of the element (C1 elements)

• C1 elements: function and its 1st derivative is continuous everywhere in the domian

Page 55: Presentation_RSE FEM Lectures_updated 26th Aug2015

Important observations• More sophisticated elements can be constructed;

• there is virtually no limitation to the degree of complexity or pre-determined element behaviour that can be attained

=> enormous flexibility/possibility in FEM

• However, the more sophisticated the element, the more computationally expensive it will be

• The element interpolation functions considered so far possess Kronecker delta function property i.e.

𝑁 𝑖 (𝑥 𝑗 )=𝛿𝑖𝑗 ; h𝑤 𝑒𝑟𝑒𝛿𝑖𝑗={ 1 𝑖𝑓 𝑖= 𝑗¿0 𝑖𝑓 𝑖≠ 𝑗

• The type of interpolation chosen defines the “shape” that the dependent variable (variable being solved) can take within an element i.e. linear, quadratic etc.

• Hence the name shape function is used to denote ‘s

• Higher –order functions always reduce exactly to the lower-order ones. For example,

• quadratic elements exactly represent linear & constant functions,

• cubic elements represents quadratic, linear & constant functions etc.

Page 56: Presentation_RSE FEM Lectures_updated 26th Aug2015

2D elements (triangles)• Consider the linear triangular element as shown in the figure

𝜙 (𝑥 , 𝑦 )=𝑎0+𝑎1𝑥+𝑎2 𝑦𝜙𝑖

𝜙 𝑗

𝜙𝑘

𝜙

y

x

(𝑥 𝑖 , 𝑦 𝑖)

(𝑥 𝑗 , 𝑦 𝑗)

(𝑥𝑘, 𝑦 𝑘)𝑖

𝑗

𝑘

Page 57: Presentation_RSE FEM Lectures_updated 26th Aug2015

Linear triangular element (2D)• The interpolation polynomial (2D) is given by

……………………….(12)

• Since the polynomial has to pass through the 3 points viz. , we have the following interpolation conditions,

𝜙h=𝜙𝑖𝑎𝑡 (𝑥 𝑖 , 𝑦 𝑖 )

𝜙h=𝜙 𝑗 𝑎𝑡 (𝑥 𝑗 , 𝑦 𝑗 )⇒𝜙 𝑗=𝑎0+𝑎1𝑥 𝑗+𝑎2𝑦 𝑗

𝜙h=𝜙𝑘𝑎𝑡 (𝑥𝑘 , 𝑦𝑘 )⇒𝜙𝑘=𝑎0+𝑎1 𝑥𝑘+𝑎2 𝑦𝑘

⇒𝜙 𝑖=𝑎0+𝑎1 𝑥𝑖+𝑎2𝑦 𝑖

• In matrix form,

{𝜙𝑖

𝜙 𝑗𝜙𝑘

}=[1 𝑥 𝑖 𝑦 𝑖

1 𝑥 𝑗 𝑦 𝑗1 𝑥𝑘 𝑦𝑘

]{𝑎0

𝑎1

𝑎2}

• On solving,

{𝑎0=1

2 𝐴 [(𝑥 𝑗 𝑦𝑘−𝑥𝑘 𝑦 𝑗 )𝜙 𝑖+(𝑥𝑘 𝑦 𝑖−𝑥 𝑖 𝑦𝑘 )𝜙 𝑗+(𝑥 𝑖 𝑦 𝑗−𝑥 𝑗 𝑦 𝑖 )𝜙𝑘]

𝑎1=1

2 𝐴 [ ( 𝑦 𝑗− 𝑦𝑘 )𝜙 𝑖+( 𝑦𝑘−𝑦 𝑖)𝜙 𝑗+ (𝑦 𝑖− 𝑦 𝑗 )𝜙𝑘]

𝑎2=1

2 𝐴 [(𝑥𝑘−𝑥 𝑗 )𝜙𝑖+ (𝑥𝑖−𝑥𝑘 )𝜙 𝑗+ (𝑥 𝑗−𝑥𝑖 )𝜙𝑘]

(Homework)

Page 58: Presentation_RSE FEM Lectures_updated 26th Aug2015

Linear triangular element (2D)Here,

; A is the area of the triangle

• Substitute the solutions for into equation (12) and re-arrange /collect the terms

• we will get an expression of in terms of three shape functions & nodal values: (Homework)

𝜙h=𝑁 𝑖 (𝑥 , 𝑦 )𝜙𝑖+𝑁 𝑗 (𝑥 , 𝑦 )𝜙 𝑗+𝑁𝑘 (𝑥 , 𝑦 )𝜙𝑘

where,

{ 𝑁 𝑖=12𝐴 [𝑎𝑖+𝑏𝑖 𝑥+𝑐𝑖 𝑦 ]

𝑁 𝑗=12 𝐴 [𝑎 𝑗+𝑏 𝑗 𝑥+𝑐 𝑗 𝑦 ]

𝑁𝑘=1

2 𝐴 [𝑎𝑘+𝑏𝑘 𝑥+𝑐𝑘 𝑦 ]

And, 𝑎𝑖=𝑥 𝑗 𝑦𝑘−𝑥𝑘 𝑦 𝑗 ,𝑏𝑖=𝑦 𝑗− 𝑦𝑘𝑎𝑛𝑑𝑐 𝑖=𝑥𝑘− 𝑥 𝑗

𝑎 𝑗=𝑥𝑘 𝑦 𝑖−𝑥𝑖 𝑦𝑘 ,𝑏 𝑗=𝑦𝑘− 𝑦 𝑖𝑎𝑛𝑑𝑐 𝑗=𝑥𝑖−𝑥𝑘

𝑎𝑘=𝑥𝑖 𝑦 𝑗−𝑥 𝑗 𝑦 𝑖 ,𝑏𝑘=𝑦 𝑖− 𝑦 𝑗 𝑎𝑛𝑑𝑐𝑘=𝑥 𝑗− 𝑥𝑖

𝑖

𝑗 𝑘

Page 59: Presentation_RSE FEM Lectures_updated 26th Aug2015

Linear triangular element - Example

Example: Calculate the value of the pressure at point A (shown in figure) if the nodalpressure values (in N/m2) are given as in the Figure. Coordinates of A are (2, 1.5)

𝜙𝑖=40

𝜙 𝑗=34

𝜙𝑘=46

𝜙

y

x

(0 ,0)

(4,0.5)

(2,5)𝑖

𝑗

𝑘A

(homework)

Homework: verify that the shape functions derived for the linear triangular element satisfies the Kronecker delta property.

Page 60: Presentation_RSE FEM Lectures_updated 26th Aug2015

Higher order elementsQuadratic triangular element

• It has six nodes (figure). The interpolating polynomial is of the form,

Quadratic triangular element

• As can be seen, determination of the shape functions for this case becomes very tedious. In fact, for higher 2D polynomials, it becomes almost prohibitive.

• Using area coordinates makes the shape function derivation easier (or makes it possible)

𝜙h=𝑎0+𝑎1𝑥+𝑎2 𝑦+𝑎3𝑥2+𝑎4 𝑥𝑦+𝑎5 𝑦2

Page 61: Presentation_RSE FEM Lectures_updated 26th Aug2015

Time-dependent problems (review of FDM)• Consider the following equation

with given boundary and initial conditionsAs you might be aware, in finite difference method, the discretization in time is done using the -method which in this case will be ,

The parameter is usually specified in the range . It is used to control the convergence/accuracy and stability of the algorithm. When , the algorithm is unconditionally stable When the algorithm is only conditionally stable e.g. in explicit method () it is stable if Commonly used values are: backward implicit method Centered implicit method (Crank-Nicolson method)explicit Euler forward scheme

Page 62: Presentation_RSE FEM Lectures_updated 26th Aug2015

Time-dependent problem -FEM• The -method is generally applied in FEM formulation of time-dependent

problems. Let us discuss the problem discussed in previous slide

• Let us approximate using the shape functions as below:

• The important point to note is that the shape function is not affected by time; only the dependent variable is a function of time. Hence,

• Applying Galerkin’s formulation we get,(

Page 63: Presentation_RSE FEM Lectures_updated 26th Aug2015

Time-dependent problem -FEM• The matrix M is called the mass matrix. The presence of the mass matrix is

a major difference between FEM and FDM. Let us denote the stiffness matrix by K. Then the above eqn. can be written as,

• If the boundary flux remains constant with time(which is generally the case) then, the third term is just a constant. Let us denote it by F. In the -method the time-derivative by a simple forward difference as,

• Introducing the relaxation parameter , the dependent variable can be expressed as,

• Using the above results, we get,

Page 64: Presentation_RSE FEM Lectures_updated 26th Aug2015

Time-dependent problem -FEM• Re-arranging the terms (HW: verify) we get,

• The above formulation is known as semi-discrete Galerkin formulation since only the spatial variable has been discretized, but not the time derivative term

• The stability and convergence of the method is controlled by the value of the relaxation parameter . As mentioned earlier, for unconditional stability

(𝐌+𝜃 Δ𝑡 𝑲 )𝝓𝑡+Δ𝑡=[ 𝑴+(𝜃−1 ) Δt𝐊 ]𝜙𝑡+𝑭

Page 65: Presentation_RSE FEM Lectures_updated 26th Aug2015

Concluding remarks on FEM

• FEM is a very versatile and robust technique for solving PDEs• Extensive research and field applications has proven its robustness. It is a

well established technique.• It offers virtually unlimited flexibilities in term of function approximation,

domain discretization & element construction, choice of weight functions etc.

• Nowadays most modeling softwares are written in FEM. Even the old FDM codes are re-written or FEM version is produced.

• Major areas where FEM has been successfully applied are – Computational Fluid Dynamics (CFD) which involves aerodynamics of everything from

missile, submarine , aircraft design to channel flow analysis– structural analysis– Heat transfer – Plus many engineering and scientific endeavors

Page 66: Presentation_RSE FEM Lectures_updated 26th Aug2015

Concluding remarks on FEM

• But FEM is not without its disadvantages:– The biggest drawback of FEM is the requirement of mesh creation which has

been found to be computationally very expensive. In many cases the mesh creation itself became the major component than the problem itself

– Usually meshing process is done by computer without human intervention; this compromise the mesh quality

– Wherever re-meshing or re-zoning is required FEM is very expensive computationally

– Some areas where FEM application is not suitable are:• Simulation of Crack growth & propagation• Modeling breakage of material with large number of fragments• Large deformation modeling

• The root of the above issues with FEM is the use of mesh. Meshfree or meshless methods are being proposed to do away with the requirement of meshes but they are in research stage currently

Page 67: Presentation_RSE FEM Lectures_updated 26th Aug2015

Concluding remarks on FEM• In this class we have avoided the use of advective /convective term (first

derivative of the dependent variable) as it leads to upwinding issues• Singular sources needs some treatment though not as serious a problem

as in FDM• Some popular FEM softwares are

– ANSYS : mainly for engineers– COMSOL Multiphysics: easy coupling of different phenomenon, fully implemented in GUI

(3D capability)– MATLAB has also a PDETOOL written in FEM and a suite of library functions to

implement FEM for any problem type (only 2D)

• Reference books: thousands of titles have been published. For beginners following are suggested– Introduction to FEM by D. Pepper and J. Heinrich– FEM by L. Segerlind– FEM by Hutton /by Huebner

Page 68: Presentation_RSE FEM Lectures_updated 26th Aug2015

GOOD LUCK FOR YOUR EXAM

Page 69: Presentation_RSE FEM Lectures_updated 26th Aug2015

Domain representation

Solve the equation in the given domain:

Page 70: Presentation_RSE FEM Lectures_updated 26th Aug2015

Approximation of equation -discretization

𝜕2𝜙𝜕 𝑥2 +

𝜕2 𝜙𝜕𝑥2 =−

𝜌𝜖

Page 71: Presentation_RSE FEM Lectures_updated 26th Aug2015

𝜙𝑖 , 𝑗 𝜙𝑖+1 , 𝑗𝜙𝑖− 1 , 𝑗

𝜙𝑖 , 𝑗+1

𝜙𝑖 , 𝑗− 1

At point (i,j)

Page 72: Presentation_RSE FEM Lectures_updated 26th Aug2015

Discretization of equation

• Hence , the discretized Poisson’s equation at point is,

𝜙 𝑖+1 , 𝑗−2𝜙𝑖 , 𝑗+𝜙 𝑖−1 , 𝑗

(∆ 𝑥 )2+𝜙 𝑖 , 𝑗+1−2𝜙𝑖 , 𝑗+𝜙 𝑖 , 𝑗− 1

(∆ 𝑦 )2=−

𝜌 𝑖𝑗

𝜖

• This discretization is performed at all the internal points (i,j). At the boundary proper boundary conditions are applied.

• The resulting set of simultaneous linear equations is solved to get the solution, :

[ 𝐴 ] {𝜙 }= {𝑏}⇒ {𝜙 }= [ 𝐴 ]− 1{𝑏}

Page 73: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 74: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 75: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 76: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 77: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 78: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 79: Presentation_RSE FEM Lectures_updated 26th Aug2015

a

Page 80: Presentation_RSE FEM Lectures_updated 26th Aug2015
Page 81: Presentation_RSE FEM Lectures_updated 26th Aug2015

Integration by parts

• Rule for integrating product of two functions

Page 82: Presentation_RSE FEM Lectures_updated 26th Aug2015

Approximation of the solution

• Approximation function: Polynomials normally used as they are easy to manipulate

𝜙

x1 2

𝜙 (𝑥 )=𝑎0+𝑎1𝑥

• Let us take a linear one dimensional element as in the figure above. Let us interpolate or approximate the function with a line i.e.

…………………………(1)

𝜙2

𝜙1

Page 83: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretized equation• The residual can be obtained as

• Galerkin’s method: in this method the shape functions are used as the weighting function.

∫Ω

𝑅 (𝑥 ) 𝑁 𝑖 (𝑥 )𝑑𝑥=0 ; i=1,2Hence in our case,

• Putting the expression for the residual we get,

∫𝑥1

𝑥2 [ 𝑑2𝜙h

𝑑𝑥2 + 𝑓 (𝑥 )]𝑁 𝑖 (𝑥 )𝑑𝑥=0 ; 𝑖=1,2

⇒∫𝑥1

𝑥2 𝑑2𝜙h

𝑑𝑥2 𝑁 𝑖 (𝑥 )𝑑𝑥=−∫𝑥1

𝑥2

𝑓 (𝑥 ) 𝑁 𝑖 (𝑥 )𝑑𝑥 ; 𝑖=1,2……(3)

Page 84: Presentation_RSE FEM Lectures_updated 26th Aug2015

Elemental discretised equation

Thus for the element ,the discretized system of equations is:

∫𝑥1

𝑥2 𝑑𝜙h

𝑑𝑥𝑑𝑁1

𝑑𝑥 𝑑𝑥=−𝑑𝜙h (𝑥1 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 )𝑁 1 (𝑥 )𝑑𝑥

∫𝑥1

𝑥2 𝑑𝜙h

𝑑𝑥𝑑𝑁2

𝑑𝑥 𝑑𝑥=𝑑𝜙h (𝑥2 )𝑑𝑥 +∫

𝑥1

𝑥2

𝑓 (𝑥 )𝑁 2 (𝑥 )𝑑𝑥………….. (6)

A few observations: Neumann(derivative) boundary condition has been directly incorporated

into the element equations because of integration by parts

Lowering of the 2nd derivative to 1st derivative means that the approximation function needs to preserve continuity of value but not slope at the nodes

On the RHS: First term represent boundary condition of the element Second term represents the systems forcing function /load function

LHS represents the internal mechanisms that governs the distribution of over the element

Page 85: Presentation_RSE FEM Lectures_updated 26th Aug2015

Contd.

• Similarly , for

• Using these results, we get,

¿−𝒅𝝓𝒉 (𝒙𝟏 )

𝒅𝒙 −∫𝒙 𝟏

𝒙 𝟐 𝒅𝑵𝟏 (𝒙 )𝒅𝒙

𝒅𝝓𝒉

𝒅𝒙 𝒅𝒙 …………..(5a)

And,

¿𝑑𝜙h (𝑥2 )

𝑑𝑥 −∫𝑥1

𝑥2 𝑑 𝑁2 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥 ………… (5b)

¿𝑑𝜙h (𝑥2 )

𝑑𝑥¿𝑁 2 (𝑥2 )𝑑𝜙h (𝑥2 )

𝑑𝑥 −𝑁2 (𝑥1)𝑑𝜙h (𝑥1 )

𝑑𝑥

¿ [𝑁1 (𝑥 ) 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

−∫𝑥1

𝑥2 𝑑𝑁 1 (𝑥 )𝑑𝑥

𝑑𝜙h𝑑𝑥 𝑑𝑥∫

𝑥1

𝑥2

𝑁 1 (𝑥 ) 𝑑2𝜙h

𝑑𝑥2 𝑑𝑥

¿ [𝑁2 (𝑥 ) 𝑑𝜙h

𝑑𝑥 ]𝑥1

𝑥2

−∫𝑥1

𝑥2 𝑑𝑁 2 (𝑥 )𝑑𝑥

𝑑𝜙h

𝑑𝑥 𝑑𝑥∫𝑥1

𝑥2

𝑁 2 (𝑥 ) 𝑑2𝜙h

𝑑𝑥2 𝑑𝑥