You are on page 1of 37

This is Just a Sample Book

with only Chapter 1.


Complete Book is coming soon
at your nearby Book Store.

Finite Element Formulation


Starting From Governing
Differential Equations

1.1 Weighted Residual Method


It is a numerical method to solve differential equations. In this method, we first assume an approximate solution and then try
to minimize the error.
For example, let us consider a differential equation

dy
x ; 0 x 1
dx
Lets assume an approximate solution to this equation

y=Co C1 x C2 x 2
As this is an approximate solution, when we put this value of y in the differential equation, it will not completely satisfy the
equation. That means L.H.S. R.H.S. will not be equal to 0 and we will get L.H.S. R.H.S.=R. This R is called residual.

dy
xR
dx
In order to make our solution more accurate, we need to minimize the value of R. For this we use different methods, such as

Point collocation method.

Galerkin method.

Sub-domain method.

Least square method.

In our syllabus, we will only learn Galerkin method to minimize the residual.
Assumtion of approximate solution
There can be two types of approximate solution
1.

Polynomial function

2.

Trigonometric function

MECHANICAL eryc GATEMENTOR

1-2 Finite Element Methods


1.1.1. Polynomial Function
Polynomial approximate solution is given by

y=Co C1 x C2 x2 C3 x3 .............Cn x n
Here Co , C1 , C2 , C3 ,. Cn are constant parameters.
Following rules need to b followed while choosing a polynomial approximate solution
I.

Degree of the polynomial should be equal to or one more that the order of differential equation.
For example, we have a differential equation such as

d2y
x . Here the order of the equation is 2. Then our
dx 2

approximate solution should be y=Co C1 x C2 x 2 .


II.

The polynomial should satisfy all the boundary conditions given in the problem.

Methods adopted to minimize the error


Let us consider a differential equation

dy
x ; 0 x 1
dx
y(0)=1
Lets assume an approximate solution to this equation

y=Co C1 x C2 x 2
As this is an approximate solution, when we put this value of y in the differential equation, it will not completely satisfy the
equation. That means L.H.S. R.H.S. will not be equal to 0 and we will get L.H.S. R.H.S.=R. This R is called residual.

dy
xR
dx
From the above equation, we can see that the value of R will vary according to x. In order to minimize the value of R in the
entire domain ( 0 x 1 ), we create a weighted integral of the product of the residue and a weight function attached to it
and set the integral within the boundary limits to zero.
1

w R dx = 0
i

Where wi is the weight function and suffix i indicates the number of parameters of approximate solution ( Co , C1 , C2 etc) to
be calculated. This means that there will be as many weight functions as the number of unknown parameters and after
integrating we will get that many simultaneous equations to solve.
The value of wi is taken from the coefficient of the parameter ( Co , C1 , C2 etc) in the equation of y.
Lets understand this through an example.
Example. Solve the differential equation given below

dy
x ; 0 x 1
dx
y(0)=1
Solution :
Step 1 Get the approximate solution:
As the order of the differential equation is 1, we will assume an polynomial of the order 2.

y=Co C1 x C2 x 2
Now we will apply the boundary condition given in the problem, i.e. y(0)=1

1 Co C1 0 C2 0
Co 1

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-3


Rewriting the approximate solution

y=1 C1 x C2 x 2
Step 2 Find the residual R
Substitute the value of y in the given problem,

dy
x
dx
dy
xR
dx
d
(1 C1 x C2 x 2 ) x R
dx
C1 2C2 x x R
Step 3 The weighted integral form
1

w R dx = 0
i

0
1

w C
i

2C2 x x dx = 0

Step 4 Galerkin method

wi = coefficient of Ci in y.
For i=1, w1 x .
1

x C

2C2 x x dx = 0

C x 2C x
1

x 2 dx = 0

C1 x 2 2C2 x 3 x 3

3
3 0
2

C1 2C2 1

2
3
3

(i)

For i=2, w2 x 2
1

x C
2

2C2 x x dx = 0

C x
1

2C2 x 3 x 3 dx = 0

C1 x 3 2C2 x 4 x 4

4
4 0
3
C1 2C2 1

3
4
4
Solving equations (i) and (ii), we will get

C1 0.0865 and C2 0.557


Hence from the equation of y, we will get our solution as
y 1 0.0865x 0.557 x2

MECHANICAL eryc GATEMENTOR

(ii)

1-4 Finite Element Methods


Q.1

Solve the following equation using a two-parameter trial solution by (a) the point-collocation method
Rd 0 at x 1/ 3 and x 2 / 3 ; (b) the Galerkin method. Then, compare the two solutions with the exact solution.

dy
y 0, 0 x 1
dx

y 0 1
dy
y 0, 0 x 1
dx

Sol.

y 0 1
Lets assume at trail solution

y Co C1 x C1 x C2 x 2
Applying boundary conditions
At x 0, y 1

1 Co

y 1 C1 x C2 x 2
Residual R

dy
y
dx

d
1 C1 x C2 x2 1 C1 x C2 x2
dx
C1 2C2 x 1 C1 x C2 x 2

1 C1 1 x C2 2 x x 2
(a) Point collocation method
Given Rd 0 at x

1
2
and x
3
3

1
At x ,
3
1 1 2
1
0 1 C1 1 C2 2
3
3 3

4
7
0 1 C1 C2
3
9

(i)

2
At x ,
3
2 2 2
2
0 1 C1 1 C2 2
3
3 3

5
16
0 1 C1 C2
3
9
Solving equation (i) and (ii) we get

C1 0.931, C2 0.31

MECHANICAL eryc GATEMENTOR

(ii)

Finite Element Formulation Starting from Governing Differential Equations 1-5


y 1 0.931x 0.31x 2

(b) Galerkin method


1

w Rdx 0
i

w 1 C 1 x C 2 x x dx 0
2

For i 1, w1 x [coefficient of C1 in equation y]


1

x 1 C 1 x C 2x x dx 0

x C x C x

2C2 x 2 C2 x3 dx 0

x 2 C x 2 C x3 2C x3 C x 4
1 1 2 2 0
2
3
3
4 0
2

1 C C 2C C
1 1 2 20
3
4
2 2 3

5
11
1
C1 C2 0
6
12
2

(i)

For i 2, w2 x 2 [coefficient of C2 in y]
1

1 C1 1 x C2 2 x x 2 dx 0

C1 x 2 C1 x3 2C2 x3 C2 x 4 dx 0

x3 C x3 C x 4 2C x 4 C x5
1 1 2 2 0
3
4
4
5 0
3
1

1 C C x 4 2C x 4 C x5
1 1 2 2 0
4
4
5 0
3 3
1 C C C C
1 1 2 20
2
5
3 3 4

7
7
1
C1 C2 0
12
10
3

Solving equation (i) and (ii) , we get

C1 0.914, C2 0.285
y 1 0.914 x 0.285x 2

MECHANICAL eryc GATEMENTOR

1-6 Finite Element Methods


Q.2

Determine the Galerkin approximation solution of the differential equation


A

d 2u
du
B
C 0
2
dx
dx

u 0 u L 0
Sol. Lets assume a trial function

u Co C1 x C2 x 2
Applying boundary conditions
At x 0, u 0

0 Co
At x L, u 0

0 C1 L C2 L2
0 C1 C2 L
C1 C2 L

u C2 L x C2 x 2
u C2 x 2 Lx
Residual R
RA
RA

d 2u
du
B
C
2
dx
dx

d2
d
C2 x 2 Lx B C2 x 2 Lx C

dx
dx 2

R A 2C2 B C2 2 x L C
From Galerkin method
L

w Rdx 0
i

w A 2C B C 2x L C dx 0
i

For i 1, w1 x 2 Lx
L

Lx A 2C2 B C2 2 x L C dx 0

2 AC x
2

2BC2 x3 BLx 2 Cx 2 2 AC2 Lx 2BC2 Lx 2 BL2 x CLx dx 0

2 AC2 x3 2 BC2 x 4 BLx3 Cx3 2 AC2 Lx 2 2BC2 Lx3 BL2 x 2 CLx 2


0
4
3
3
2
3
2
2 0
3
2 AC2 L3 BC2 L4 BL4 CL3 AC2 L3 2BC2 L4 BL4 CL3

0
2
3
3
1
3
2
2
3

2 A BL A 2BL BL C BL C 3
C2

L 0

2 1
3 3 3
2 2
3

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-7


A BL BL C
C2
0

3 6 6 6
C BL
6
C2
BL A

6 3

C BL
C2

C2

U
Q.3

6
BL 2 A

C BL
BL 2 A

C BL 2
x Lx
BL 2 A

Solve the following differential equation.


y " 64 y 10 0;0 x 1

y 0 0
y 1 0
Find y(0.25), y(0.5) and y(0.25) using Galerkin method.
Sol. Given differential equation is
y " 64 y 10 0

Let the approximate solution by

y C0 C1 x C2 x 2 C3 x3
Apply boundary conditions one by one:
From 1st boundary condition y(0) = 0, we get

0 C0 0 0 0
C0 0

y C1 x C2 x 2 C3 x3
From 2nd boundary condition y(1) = 0, we get

0 C1 C2 C3
C1 C2 C3
Rewrite the approximate solution as

y C2 C3 x C2 x 2 C3 x3
y C2 x 2 x C3 x3 x
y ' C2 2 x 1 C3 3x2 1

y " 2C2 6 xC3

L.H.S. of the given differential equation is


2C2 6 xC3 64 C2 x 2 x C3 x3 x 10 0

MECHANICAL eryc GATEMENTOR

1-8 Finite Element Methods


The solution is approximate
L.H .S. R 0

Rearranging the terms, we get

R C2 2 64 x 64 x2 C3 6 x 64 x 64 x3 10
C2 2 64 x 64 x 2 C3 70 x 64 x3 10
The weighted integral form is given by
1

0 wi R dx
0

0 wi C2 2 64 x 64 x 2 C3 70 x 64 x3 10 dx
0

0 C2 wi 2 64 x 64 x 2 dx C3 wi 70 x 64 x3 10 wi dx
Galerkin Method

wi Coefficients of Ci in y

i.e. w1 Coefficient of C2 x 2 x
w2 Coefficient of C3 x3 x

for i 1, we get
1

0 C2 x 2 x 2 64 x 64 x 2 dx C3 x 2 x 70 x 64 x3 10 x 2 x dx
2.4667C2 3.7C3 1.667 0
2.4667C2 3.7C3 1.667

(i)

for i 2,
1

0 C2 x3 x 2 64 x 64 x 2 dx C3 x3 x 70 x 64 x3 10 x3 x dx
3.7C2 5.6762 C3 2.5 0
3.7C2 5.6762 C3 2.5
Solving equation (i) and (ii), we get

C2 0.6819 and C3 3.692 103


Substituting these values in y, we get

y 0.6813 x2 x 0.003692 x3 x

y 0.25 0.1268, y 0.5 0.1689 and y 0.75 0.1265


Q.4

Solve the following differential equation using Galerkin method:


d 2u
u x 0; 0 x 1
dx 2

u 0 u 1 0
Sol. Given differential equation is

u " u x 0

MECHANICAL eryc GATEMENTOR

(ii)

Finite Element Formulation Starting from Governing Differential Equations 1-9


Let the approximate solution be

u C0 C1 x C2 x 2 C3 x3

(i)

Apply boundary conditions

u 0 0 C0 0
u 1 0 0 C1 C3 C1 C2 C3

Solution given in (i) becomes


u C2 C3 x C2 x2 C3 x3
u C2 x 2 x C3 x3 x

(ii)

u ' C2 2 x 1 C3 3x 2 1

u " 2C2 6 xC3

Residue R becomes
R 2C2 6 xC3 C2 x 2 x C3 x3 x x
C2 2 x 2 x C3 6 x x3 x x
C2 2 x x 2 C3 5x x3 x
Galerkin Method

wi Coefficients of Ci inu

w1 Coeffcient of C2 x2 x
w2 Coefficient of C3 x3 x
for i 1, we get
1

0 C2 x 2 x 2 x x 2 dx C3 x 2 x 5x x3 x 2 x x dx
0 0.3C2 0.45C3 0.08333
0.3C2 0.45C3 0.08333 (i)
for i 2,
1

0 C2 x3 x 2 x x 2 dx C3 x3 x 5x x3 x3 x x dx
0 0.45C2 0.72381C3 0.1333
0 0.45C2 0.72381C3 0.1333
Solving equation (i) and (ii), w get

C2 0.0225 and C3 0.17


Substituting these values in y, we get

u 0.0225 x 2 x 0.17 x3 x

MECHANICAL eryc GATEMENTOR

(ii)

1-10 Finite Element Methods


Q.5

Give a one parameter Galerkin solution of the following equation, for the domain shown in the figure 1.1 below:
(0,1)

u=0

(1,1)
u=0

u=0
(0,0)

(1,0)

u=0

Figure 1.1

2u 2u
2 2 1
y
x
Sol. The given differential equation is

2u 2u
2 2 1
y
x

R 1

2u 2u

0
x 2 y 2

Equations of 4 sides are given as

y
(0,1)
D
u=0
A
(0,0)

u=0

u=0

(1,1)
C
u=0
B
(1,0)

Figure 1.2

AB x 0

BC x 1 i.e. x 1 0
CD y 1 i.e. y 1 0
DA y 0

We can write approximate solution as


u x, y Cxy x 1 y 1 which satisfies u = 0 on all sides.

u
Cy y 1 2 x 1
x

2u
2Cy y 1
x 2

Similarly

2u
2Cx x 1
y 2
R 1 2C x x 1 y y 1

Weighted integral form is given by


1 1

0 wR dx dy
0 0

Where w is the weight function, w xy x 1 y 1

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-11


1 1

0 xy x 1 y 1 1 2C x x 1 y y 1 dx dy
0 0

1 1

1 1

0 0

0 0

0 xy x 1 y 1 dx dy 2C xy x 1 y 1 x x 1 y y 1 dx dy
Consider

1st

integral
1

1
x3 x 2
xy
x

1
y

1
dx
dy

0 0
0 y y 1 3 2 dy
0
1 1

1
1
1 y3 y 2
1
y
y

1
dy


6 0
6 3
2 0 36

Consider 2nd integral


1 1

2C xy x 1 y 1 x x 1 y y 1 dx dy
0 0

1 1

2
2
2C x 2 y x 1 y 1 dx dy xy 2 x 1 y 1 dx dy
0 0
0 0

1 1

1
1
1
1

x5 2 x 4 x3
y5 2 y 4 y3
2C y y 1
dy x x 1
dy
4
3 0
4
3 0
0
5
5
0

1 y 3 y 2 1 1 x3 x 2 1
2
C
2C 2C

2 0 30 3 2 0
180
45
30 3

Substituting we get
0

1 C
45 5

i.e. C

36 45
36 4

u x, y
Q.6

5
xy x 1 y 1
4

Give one parameter Galerkin solution of the following equation, for the domain shown in the figure 1.3.

600

600

600

Figure 1.3

2u 2u
2 2 1
y
x
Sol. Given differential equation is

2u 2u
2 2 1
y
x
i.e. residue R 1

2u 2u

0
x 2 y 2

MECHANICAL eryc GATEMENTOR

1-12 Finite Element Methods


y

600

A
(0,0)

600

600

B
(1,0)

Figure 1.4

Let each side of this triangle be 1 unit. Considering point A as origin, write coordinates of vertices as

A 0,0
B 1,0
1 3
C ,

2 2

Equation of AB is y 0

Equation of AB is y 3x 3 i.e. y 3x 3 0
Equation of CA is y 3x

i.e. y 3x 0

We can write approximate solution as

u x, y Cy y 3x y 3x 3

Which satisfies u(x,y) = 0 on all sides.

u
Cy y 3x

3 y 3x 3 3

Cy 3 y 3x y 3x 3 3Cy 1 2 x

2u
6Cy
x 2

u
C y 2 3xy 1 y 3x 3 2 y 3x

2u
C 2 y 3 x 2 y 3x y 3x 3 2

y 2

C 2 y 3x 2 y 3x 2 y 2 3x 2 3

6Cy 2C 3
R 1

2u 2u

x 2 y 2

R 1 6Cy 6Cy 2C 3
1 2C 3

R is a constant, we can directly equate it to 0 to find C


1 2C 3 0

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-13


C
u x, y

Q.7

1
2 3

1
2 3

y y 3x y 3x 3

Solve the following differential equation by using Galerkin method:

du
du
d 2u
f c ; where the domain is changing from 0 x L and B.C.s of the problem:
0 0; L 0 .
dx
dx
dx 2
Sol. The given governing differential equation is
d 2u
fc ; 0 x L
dx 2

B.C.' s
du
dx

du
dx

0
x 0

0
xL

As order of differential equation is 2, we have a polynomial of degree 3.

Let u C0 C1 x C2 x 2 C3 x3

du
C1 2C2 x 3C3 x 2
dx

Using boundary condition number 1, we get

0 C1

du
2C2 x 3C3 x 2
dx

Using boundary condition number 2, we get

0 2C2 L 3C3 L2
3
C2 LC3
2
3
3

u C0 LC3 x 2 C3 x3 C0 C3 x3 Lx 2
2
2

Now find the residue R

du
C3 3x 2 3Lx
dx
d 2u
3C3 2 x L
dx 2
R

d 2u
f c 0 3C3 2 x L f c
dx 2

Weighted residual form is


L

0 wi R dx wi 3C3 2 x L l f c dx
3
wi Coefficient of C3 x3 Lx 2
2

MECHANICAL eryc GATEMENTOR

1-14 Finite Element Methods


3
3

0 3C3 x3 Lx 2 2 x L dx x3 Lx 2 f c dx
2
2

0
0
L

x5
x 4 3 x3
x4
x 4 3 x3
0 3C3 2 3L L L2 f c L
4
4 2
3 0
5
4 2 3 0
L5 3L5 L5 L5
L4 L4
0 3C3 2
fc
4
4 2
5
4 2

2 L5
L4
0 3C3

f
c
20
2

5 fc
3L

C3

Solution of equation is given by


u C0

5 fc 3 3 2
x Lx
3L
2

Where C0 is any constant.


1.1.2 Trigonometric Function
Trigonometric approximate solution is given by

y C0 C1 sin
Q.8

x
2

C2 sin

3 x
5 x
(2n 1) x
C3 sin
...........Cn sin
2
2
2

Determine a two-parameter solution, using trigonometric function, for the differential equation

d 2u
cos x for 0 x 1
dx 2

Subject to boundary condition given by u 0 0; u 1 0 .


Use Galerkin Method.
Sol. Let the approximate solution by

u C0 Ci sin

2i 1 x

Now, u 0 0 by boundary condition no. 1, C0 0

u Ci sin

2i 1 x

C2 sin

3 x
5 x
C3 sin
2
2

0 C1 C2 C3

i.e.C2 C1 C3

C1 sin

u 1 0 by boundary condition no. 2

3 x
5 x
x
3 x
u C1 sin
sin
sin
C3 sin

2
2
2
2

u ' C1
u " C1

x
3 x
2
3 x
5 x
cos

3cos

C
5cos
3

3cos

2
2
2
4
2
2

x
3 x
2
3 x
5 x
9sin
25sin
sin
C3
9sin

4
2
2
4
2
2

MECHANICAL eryc GATEMENTOR

(i)

Finite Element Formulation Starting from Governing Differential Equations 1-15


Residue R is given by
R u " cos x 0

3 x
3 x
5 x
x

C1 sin
9sin
25sin
C3 9sin
cos x

4
2
2
2
2

Weighted integral form is given by

w Rdx 0
i

For Galerkin method wi coefficients of Ci in u

For i 1,
w1 sin

2 1
4

sin 2 x sin
0

3
2

x sin

3

x C1 sin x 9sin
2
2

3

0 C1 sin x sin
2
2

0
1

3

C3 sin x sin
2
2
0
1

3
x
2

3
5

x C3 9sin
x 25sin
2
2

3

x sin x 9sin
2
2

3
5

x 9sin
x 25sin
2
2

x cos x dx

x dx

x dx

3
4

sin x sin
x cos xdx. 2
2
2

0
1

0 5C1 2.84C3 0.069


0.5C1 2.84C3 0.069

(i)

For i 2,

w2 sin

3
5
x sin
x
2
2

Weighted integral form is given by


1

0 w2 R dx
0

2 1

sin
0

3
5
x sin
2
2

3

x C1 sin x 9sin
2
2

3
5

x C3 9sin
x 25sin
2
2

x cos x dx

5
3
5
3
0 C1 sin
x sin
x 9sin
x 25sin
x dx
2
2
2
2
0
1

5
3
sin
x sin
2
2
0
1

x cos xdx. 2

3.9C1 14.75C3 0.207


Solving equations (i) and (ii), we get

C1 0.0069 and C3 0.0122


3 x
5 x
x
3 x
u 0.0069 sin
sin
sin
0.0122 sin

2
2
2
2

MECHANICAL eryc GATEMENTOR

(ii)

1-16 Finite Element Methods

1.2 Weak Form of Weighted Residual Method


Weak form means that the order of the differential equation is reduced by half. If the differential equation is of 2 nd order,
then we reduce the same to 1st order differential equation.
This is method involes integration by parts. As this is the most important step in weak formulation, the method of integration
by parts is briefly described below.
If u and v are two different functions of x, then we have

u dv (u v) v du
Example: Given differential equation
d2y
dy
dy
3x 6 y 0; 0 x 1 ; y 0 1 ; 1 0.1
dx
dx
dx 2

Find y(0.2) by using weak form method.


Sol.
Step 1 Write the weighted residual statement
1

w Rdx 0
i

Put R = (L.H.S.-R.H.S.) of the differential equation


R

d2y
dy
3x 6 y
dx
dx 2

d2 y

dy
w
i
0 dx2 3x dx 6 y dx 0
1

1
1
d2 y
dy
w
dx

3
w
x
dx

6
i
i

0 dx2
0 dx
0 wi y dx 0
1

(i)

Step 2 Reducing the order of the differential equation by using integration by parts
The order of the differential equation is 2. To reduce the order by half i.e. 1, we will consider only first term and solve it
by using integration by parts.
1
d2 y
I wi 2 dx
dx
0

d dy
dy
I wi
dx wi d

dx dx
dx
0
0
1

u dv (u v) v du
Comparing our integral with above equation,

u wi and v

dy
dx

1
1
dy 1 1
dw dy
dy dy
I wi
dwi wi
i
dx
dx dx 0 0 dx dx
dx 0 0

Substituting this in equation (i) , we get


1
dy 1 1 dwi dy 1
dy

dx 3 wi x dx 6 wi yldx 0
wi
dx
dx 0 0 dx dx 0
0

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-17


wi

1
1
1 dw dy 1
dy
dy
i
dx 3 wi x dx 6 wi y dx
dx 0 0 dx dx 0
dx
0

(ii)

The above equation is the weak form of the initial differential equation mentioned in the problem.
Step 3 Solving the weak form differential equation
Now will assume a trial solution for y. As the order of our differential equation is now reduced, we can consider a
polynomial of lesser order as a trial function.

y C0 C1 x C2 x 2
Here a very important point to understand is that our trial function does not need to satisfy the natural boundary
dy
1 0.1 ). It only needs to satisfy the essential boundary condition (i.e. y 0 1 ). The reason is that
condition (i.e. dx
1

the natural boundary conditions will be automatically satisfied by the weak form equation it self ( wi

y C0 C1 x C2 x 2
Using boundary condition y(0) = 1, we get

1 C0 0 0 C0 1

y 1 C1 x C2 x 2

dy
C1 2C2 x
dx

Also, weight functions wi are given by coefficients of Ci in y

w1 x and w2 x 2

For i 1 , w1 x and

dw1
1 . Equation (ii) becomes
dx
1

dy
1 C1 2C2 x dx 3 x 2 C1 2C2 x dx 6 x 1 C1 x C2 x 2 dx
dx 0 0
0
0

Using boundary condition no. 2, i.e.

dy
1 0.1 , we get
dx
1

1
x3
x2
x4
x3
x4
0.1 C1 x C2 x 2 3 C1 C2 6 C1 C2
0
2 0
3
4 0
3
2

3
3
C1 C2 C2 3 2C1 C2
2
2
2C1 C2 2.9
Similarly for i 2 , w2 x 2 and
1

x2

(iii)

dw2
2 x . Equation (ii) becomes
dx
1

dy
2 x C1 2C2 x dx 3 x3 C1 2C2 x dx 6 x 2 1 C1 x C2 x 2 dx
dx 0 0
0
0

3 C 2
1 C C

0.1 C1 C2 3 1 C2 6 1 2
2 3 5
5

3 4
1.75C1 1.33C2 1.9

(iv)

Solving equation (iii) and (iv), we get

MECHANICAL eryc GATEMENTOR

dy
dx 0 ).

1-18 Finite Element Methods


C1 2.145 and C2 1.29

y 1 2.145x 1.29 x2

y 0.2 0.6226
Q.9

Given differential equation


d2y
dy
3x 6 y 0; 0 x 1; y 0 1; y ' 1 0.1
dx
dx 2

Find y(0.2) by using weak form of weighted residual method.


1

Sol.

w Rdx 0
i

We directly equate residue R to the right hand side of the differential equation. Thus, we can write above integral as

d2 y

dy
w
0 i dx2 3x dx 6 y dx 0
1

1
1
d2 y
dy
dx 3 wi x dx 6 wi y dx 0
2
dx

0
0

w dx
i

(i)

Now, we consider only first term and solve it by using integration by parts,
1
d2 y
I wi 2 dx
dx
0
1

dw dy
dy
I wi i
dx
dx 0 0 dx dx
1

Substituting this in equation (i), we get


1

dwi dy
dy
dy
wi dx dx dx dx 3 wi x dx dx 6 wi yldx 0

0 0
0
0
1

1
1
1 dw dy 1
dy
dy
wi
i
dx 3 wi x dx 6 wi y dx
dx 0 0 dx dx 0
dx
0

For weak form method, approximate function y needs to satisfy only essential boundary conditions. Since only one
essential boundary condition is given in problem viz. y(0) = 1, we can have approximate solution y as

y C0 C1 x C2 x 2
Using boundary condition y(0) = 1, we get

1 C0 0 0 i.e.C0 1

y C0 C1 x C2 x 2

dy
C1 2C2 x
dx

Also, weight functions wi are given by coefficients of Ci in y

w1 x and w2 x 2
For i 1 , equation (ii) becomes
1

dy
dy

C1 2C2 x dx 3 x 2 C1 2C2 x dx 6 x 1 C1 x C2 x 2 dx
dx 0 0 dx
0
0

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-19


Using boundary condition no. 2, i.e. y(1) = 0.1, to evaluate R.H.S., we get
1

x3
x2
x4
x3
x4
0.1 C1 x C2 x 3 C1 C2 6 C1 C2
0
2 0
3
4 0
3
2
2 1

3
3
0.1 C1 C2 C2 3 2C1 C2
2
2
2C1 C2 2.9

(iii)

Similarly for i 2 equation (ii) becomes


1

x2

dy
2 x C1 2C2 x dx 3 x3 C1 2C2 x dx 6 x 2 1 C1 x C2 x 2 dx
dx 0 0
0
0

3 C 2
1 C C

0.1 C1 C2 3 1 C2 6 1 2
2
3
5
5

3 4
1.75C1 1.33C2 1.9

(iv)

Solving equation (iii) and (iv), we get

C1 2.145 and C2 1.29

y 1 2.145x 1.29 x2

y 0.2 0.6226
Q.10 Solve the following differential equation ,
d2y
10 x 2 5;0 x 1
dx 2

y(0) = y(1) = 0
using weak form method, mapped over entire domain, using one parameter method.
Sol. Since only one parameter is to be used the polynomial will be of order 2.

Approximate solution will be taken as


y C0 C1 x C2 x 2

(i)

Applying boundary conditions one by one,

y 0 0 0 C0 0 0 C0 0
y C1 x C2 x 2

y 1 0

0 C1 C2 C1 C2

y C1 x C1 x 2 C1 x x 2
The given differential equation is

y " 10 x2 5 i.e. y " 10 x2 5 0

Solution is approximate,
y " 10 x 2 5 0 R
Weighted integral form is given by
1

w Rdx 0
i

1
d2y

i.e. w 2 10 x 2 5 dx 0
dx

i 1 only, wi w1 w

MECHANICAL eryc GATEMENTOR

(iii)

1-20 Finite Element Methods


1

w
0

d2y
dx 10 wx 2 dx 5 wdx 0
dx
0
0

(iii)

Now w = coefficient of C1 x x 2
Integrating 1st integral by parts to convert into weak form, we get equation (iii) as
1

Now w x x 2

dy
dw dy

dx 10 w x 2 dx 5 wdx 0
dx 0 0 dx dx
0
0

dw
1 2x
dx

Also y C1 x x 2

dy
dy
C1 1 2 x and w 0
dx
dx 0

( Primary variable y is specified in B.C.)

Equation (iv) becomes


1

1 2 x C1 1 2 x dx 10 x x 2 x 2 dx 5 x x 2 dx 0
0.333C1 0.5 0.833 0 C1 4
y 4 x x 2

y 0.25 0.75, y 0.5 1 and y 0.75 0.75


Q.11 Develop the weak form and find the solution
q0

M
L

Figure 1.5

EI

d 4v
q0 0
dx 4

v 0 0;

dv
0 0
dx

EI

d 2v
l M ,
dx 2

EI

d 3v
l P
dx3

Sol. Weighted Residual statement


L

w Rdx 0
i

d 4v

w
x

EI 4 qo 0
0
dx

w x
0

d d3x
EI
dx w x qo dx
dx dx3
0
L

MECHANICAL eryc GATEMENTOR

(iv)

Finite Element Formulation Starting from Governing Differential Equations 1-21


d 3v L
w
x
d

EI 3 w x q0 dx
0
dx 0
L

Integrating by parts, we get

L
1

d 3v
d
d 3vdx
w x EI 3 w x EI

0 w x q0 dx
dx 0 0 dx
dx3

Integrating the second term by parts again


L
L
2
L
L
2

d 3v
d 2v d w x
dw x d v

w x EI 3
EI 2 EI 2 .
dx

w x q0 dx
dx 0 dx
dx 0 0
dx
dx 2

(i)

Lets assume a trial function

v Co C1 x C2 x 2
Applying essential boundary conditions
at x 0, v 0

0 Co

v C1 x C2 x 2
dv
C1 2C2 x
dx
At x 0,

dv
0
dx
0 C1

v C2 x 2

w x x 2 [coefficient of C2 in equation of y]
dw
2x
dx
d 2w
2
dx 2

Substituting values of w x ,

d 2v
dw d 2 w
, 2 and natural boundary conditions, i.e. EI 2
dx dx
dx

M dx and EI
xL

equation (i), we get


2
L
L

d 2 y d w x

L2 .P 0 2 L.M 0 EI 2
,
dx

w x qo dx
dx
dx 2

PL

2ML EI
0

2
d 2v d w x
dx
2
dx
dx 2

wq dx
0

PL

2ML EI .2C2 .2 dx
0

MECHANICAL eryc GATEMENTOR

d 3v
dx3

P in
X L

1-22 Finite Element Methods


L

x 2 qo dx
0

PL

2ML 4C2 EIL

PL

2ML

C2

PL 2M
4 EI

C2

L3
qo
3

L3
qo 4C2 EIL
3

qo L2 3 PL 2M qo L

12 EI
12 EI

3 PL 2M qo L2
12 EI

3 PL 2M qo L2 2
v
x
12 EI

Q.12 A steel rod of diameter D = 2 cm, length L = 25 cm and thermal conductivity K = 50 W/m 0C is exposed to ambient air at
Ta 200 C with a heat transfer coefficient h 64W / m2 0C. Left end of the rod is maintained at temperature To 1200 C
and the other end is exposed to ambient temperature. Determine temperature distribution in the rod by weak form of
weighted residual method using a 2 parameter solution. Governing differential equation is given by

d 2
C 0 for 0 x 25 cm
dx 2

where T Ta and C

hP
.
AK

Boundary conditions are

0 To Ta 120 20 100
d

K dx h 0

L
Sol. (i) Governing differential equation is

d
d 2
C 0 with boundary condition (i) 0 100 (ii)
dx
dx 2

(ii) Residue R

d 2
C 0
dx 2

xL

h
L 0
K

L Ta Ta 0

( Solution is approximate)

(iii) Weighted integral form is given by


L

0 wi R dx
0

d 2

0 wi 2 C dx
dx

0
L

(iv) Weak form may be written as


0 wi

d
dx

L
dwi d
dx wi C dx
dx dx
0
0

(iv) For weak form method, only essential boundary conditions need be satisfied.

Let approximate solution be

C0 C1 x C2 x2

MECHANICAL eryc GATEMENTOR

..(i)

Finite Element Formulation Starting from Governing Differential Equations 1-23


Boundary condition 0 100 , we have

100 C1 x C2 x2
d
C1 2 xC2
dx

(vi) wi i i.e. coefficients of Ci in and from boundary condition no. 2, we have


wi

d
dx

i
0

d
dx

for i 1i.e.1 x

and i 2 2 x 2

equation (i) becomes


L
di
C1 2 xC2 dx C i 100 C1 x C2 x 2 dx
dx
0
0

0
For i 1;1 x

d1
1
dx

0 C1 2 xC2 dx C x 100 C1 x C2 x 2 dx

L3
L4
C1 L L2C2 C 50L2 C1 C2
3
4

2 CL4
CL3
2
C1 L
C2 L
50CL
3
4

For i 2;2 x2

d2
2x
dx

0 2 x C1 2 xC2 dx C x 2 100 C1 x C2 x 2 dx
C1 L2 C2

100 L3
4 L3
L4
L5
C
C1 C2
3
4
5
3

CL4
C1 L2
4

Putting L 0.25 m

4 L3 CL5
100CL3

C2

5
3

1
m
4
C

hP
h D
4h
4 64

256
KA K D 2 KD 50 0.02
4

Equation (ii) and (iii) becomes

19
5
C1 C2 800,
12
16

5
17
400
C1
C2
16
240
3

Solving the equations, we get

C1 1034.73 and C2 2682.63

Temperature distribution along the rod is given by

100 1034.73x 2682.63x2

MECHANICAL eryc GATEMENTOR

1-24 Finite Element Methods

1.3 Piecewise Continuous Trial Function


Till now we have assumed a single trial solution y C0 C1 x C2 x 2 to solve the differential equations. These solutions will
be fairly accurate as long as the domain of the problem eg. 0 x 1 is simple. But in case of complex domains, it is not
possible to assume a trial solution which is continuous over the entire domain. Most of the problems that we come across in
engineering involve complex domain (eg. varying cross section, transient heat transfer etc.). In order to solve these
problems, instead of assuming a trial solution for the entire domain, we divide the domain into finite number of pieces and
assume a trial function which is continuous for a small element. Thus it is called piecewise continues trial function. This is
the basis of Finite Element Method.
To understand this, let us assume a simple cantilever bar with a force P acting at the free end. We need to determine the axial
deflection u of the bar.

Figure 1.6

In order to solve this problem using piecewise continuous trial function, we first need to divide the domain into pieces. The
domain here is the length of the bar.

3
2

1
1

2
Figure 1.7

Here we have divided the domain i.e. the area of the bar, into two pieces. Now we will assume a trial function which will be
contiguous only for a single piece of the bar.

u u1 N1 u2 N2

(i)

Where u1 and u2 are the values of u at point 1 and 2 and N1 and N 2 are the parameters called interpolation functions or
Shape Functions. If we know the values of u at 1 and 2 i.e. u1 and u2 we can find the value of u at any point between 1 and 2
using these functions.

u2

u1
Figure 1.8

Let the variation of u between 1 and 2 be linear as shown in the above figure 1.8. Hence function of u will be a straight line.

u ax b

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-25


Now lets apply the boundary conditions .
At x 0, u u1

u1 b
At x l , u u2

u2 al u1
u2 u1
l

a
Substituting the values of a and b, we get

u2 u1
x u1
l
u
u
u 2 x 1 x u1
l
l
1 x
x
u u1
u2
l

l
u

Comparing above equation with equation (i), we get


1 x
x
N1
and N 2
l
l

1.3.1 Formulation of 1-D Bar Element using Weak Form of


Weighted Residual Method
Consider a uniform bar of length L subjected to a uniform axial load q0 as shown in figure 1.9.
q0

X
Figure 1.9

Governing differential equation will be


EA

d 2u
q0 0
dX 2

Step 1 : Discretization
For simplicity we shall divide the domain in two equal parts or two elements of equal length as shown in figure 1.10.
2

q0

1
2

1
Figure 1.10

Step 2 : Development of Element Matrix Equation


(i) Take any general element and set the local coordinate system and its relation with the global coordinate.

P2e

P1e
x

Figure 1.11

MECHANICAL eryc GATEMENTOR

1-26 Finite Element Methods


Convert the governing differential equation in global coordinate system to governing differential equation in local
coordinates by changing the variable X by x . Write the boundary conditions for the governing differential equation for
the element.
The governing differential equation in local coordinates is written as
EA

d 2u
q0 0 dX dx
dx 2
d du
EA qo 0
dx
dx

With boundary conditions

du
du
e
e
EA dx P1 and EA dx P2

x 0

x l
(ii) Since the solution is approximate, the equation (4,4) becomes
d du
EA q0 R 0
dx
dx

Where R is the residue not equal to zero.


(iii) Weighted integral form of this equation is given as
l

w Rdx 0
i

du

w dx EA dx q 0
i

(iv) Weak Formulation: Solving the integral by parts we get


l

dw
du
0 wi EA i
dx 0 0 dx
l

du
EA dx dx wi q0

0
l

dw
du
du
0 wi l EA wi 0 EA i
dx l
dx 0 0 dx

du
EA dx dx wi q0

0
l

(v) Let the approximate solution for u be given by

u u1 N1 u2 N2
Where u1 and u2 are deflections at point 1 and 2, and N1 and N2 are known as interpolation functions.
(vi) The interpolation functions for a linear element are given by

N1 1

x
x
and N 2
l
l

u u
du d x
x
u1 1 u2 1 2
dx dx l
l
l
l
(vii) We have weight function wi Coefficient of ui Ni
Therefore above equation becomes
For i 1, w1 N1 1

x
l
l
d x u1 u2
x
1 dx 1 q0 dx
dx
l
l
l
l

0
0
l

0 0 1 P1e EA

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-27


l

P1e
x2
1 u u
q0 x 1 2
EA
2l 0 0 l l
l

l
P1e
l
u u
q0 21 22
EA
2 0l
l

dx

dx

C1 C2 P1e
l

q0
l
l
EA
2

For i 2, w2 N 2

(i)

x
l
l
d x u1 u2
x

dx


1 q0 dx

dx l l
l
l
0
0
l

0 P2e 0 EA

P2e
x2
1 u u
q0 x 1 2 dx
EA
2
l
l

0 0 l l
l
P2e
l
u u
q0 21 22 dx
EA
2 0 l
l

Thus equation will be given by

u1 u2 P2e
l

+q0
l
l
EA
2

(ii)

Thus putting both the equations (i) and (ii) together and simplifying, we get

EA
l
u1 u2 P1e q0
l
2
EA
l
u1 u2 P2e q0
l
2
(viii) Putting these equations in matrix form, we get

q
e
EA 1 1 u1 P1 0

l 1 1 u2 P2e
q
0

l
2
l
2

1.4 Rayleigh Ritz Method


Rayleigh Ritz method is based on the principal of minimum potential energy. According to this principal Among all the
admissible displacement fields, the equilibrium configuration of the system is that, which makes the total potential of the
system stationary with respect to small, admissible variations of displacement.
The total potential energy of a system is

p Internal strain energy in the structure + Potential of external forces


For a general multi degree of freedom system, if 1 , 2 , 3 ,.........., n are the displacements, then according to the principal of
minimum potential energy

p
i

for i=1, 2, 3, .., n

Now let us understand how this principal is used in Rayleigh Ritz method using an example.
Consider a simply supported beam of length l with a uniformly distributed load q0 on its entire span.

MECHANICAL eryc GATEMENTOR

1-28 Finite Element Methods


q0

x0

xl

x
Figure 1.12

We need to find the deflection v( x) .


Step 1 Find the total potential energy
Internal strain energy of the beam
2

l
1 d 2v
U EI 2 dx
2 dx
0

Potential energy due to external force,


l

V q0 vdx
0

Hence the total potential energy,

p U V
2

l
l
1 d 2v
p EI 2 dx q0 vdx
2 dx
0
0

Step 2 Assume a trial solution


Let`s assume a trial solution for v( x) ,

v( x) C0 C1 x C2 x 2
Applying boundary conditions,
At x 0, v(0) 0

0 C0
At x l , v(l ) 0

0 C1l C2l 2
C1 C2 l

v( x) C2lx C2 x 2 C2 ( x 2 lx)
Step 3 Put the value of trial function in the equation of p
2

l
l
1 d 2v
p EI 2 dx q0 vdx
2 dx
0
0

d 2v
2C2
dx 2

dv
C2 (2 x l ),
dx
l

1
p EI 2C2 dx q0 C2 ( x 2 lx ) dx
0 2
0
l3 l3
p 2 EIC2 2 l q0C2
3 2
l3
p 2 EIC2 2 l q0 C2
6

MECHANICAL eryc GATEMENTOR

Finite Element Formulation Starting from Governing Differential Equations 1-29


Step 4 Apply principal of minimum potential energy
From the principal of minimum potential energy

p
Ci

Here we only have one parameter to find i.e. C2 . So

p
C2

C2

l 3
2
2 EIC2 l q0C2 0
6

l3
4 EIC2 l q0 0
6
C2

q0 l 3
24 EIl

Hence the displacement v( x) v( x)

q0l 3
( x 2 lx)
24 EIl

1.4.2 Formulation of 1-D Bar Element using Rayleigh Ritz Method


Consider a uniform bar of length L subjected to a uniform axial load q0 as shown in figure 1.13.
q0

X
Figure 1.13

Governing differential equation will be


EA

d 2u
q0 0
dX 2

Step 1 : Discretization
For simplicity we shall divide the domain in two equal parts or two elements of equal length as shown in figure 1.14.
2

q0

1
2

1
Figure 1.14

Step 2 : Development of Element Matrix Equation


(i) Take any general element and set the local coordinate system and its relation with the global coordinates.

P2e

P1e
x

Figure 1.15

MECHANICAL eryc GATEMENTOR

1-30 Finite Element Methods


Convert the governing differential equation in global coordinate system to governing differential equation in local
coordinates by changing the variable X by x . Write the boundary conditions for the governing differential equation for the
element.
The governing differential equation in local coordinates is written as
EA

d 2u
q0 0 dX dx
dx 2
d du
EA qo 0
dx
dx

With boundary conditions

du
du
e
e
EA dx P1 and EA dx P2

x 0

x l
The strain energy within the element is given by
l

Ue
0

AE du
dx
2 dx

Potential energy due to external forces is given by


l

V e q0 udx Pu
1 1 P2 u2
0

Total potential energy for the element is given by


2

AE du
U V
1 1 P2 u2
dx q0udx Pu
2 dx
0
0
l

e
p

Let the approximate solution for u be given by

u u1 N1 u2 N2
Where u1 and u2 are deflections at point 1 and 2, and N1 and N2 are known as interpolation functions.
The interpolation functions for a linear element are given by

N1 1

x
x
and N 2
l
l

u u
du d x
x
u1 1 u2 1 2
dx dx l
l
l
l
Substituting these values in equation (i), we will get
2

l
AE u1 u2
x
x

dx q0 u1 1 u2 dx Pu
1 1 P2 u2

2 l
l
l
l
0
0
l

e
p

ep
0

ep

l
u1u2
AE u12 u22
x
2 2 2 2 dx q0 u1 1 u2
2 l
l
l
l
0

u22
uu
AE u12
x

x 2 12 2

2 l2
l2
l

x2
x2
x q0 u1 x u2 Pu
1 1 P2 u2
2l
l 0
0

AE u2 u1
l
q0 u1 u2 Pu
1 1 P2 u2
2
l
2
2

ep

x
dx Pu
1 1 P2 u2
l

From Rayleigh Ritz method


ep
ui

MECHANICAL eryc GATEMENTOR

(i)

Finite Element Formulation Starting from Governing Differential Equations 1-31


For i=1,
ep
u1

2
AE u2 u1
l

q0 u1 u2 Pu
1 1 P2 u2

u1 2
l
2

AE 2u1 2u2
l
q0 P1 0
2
l
2

AE
l
u1 u2 q0 P1
l
2

(ii)

For i=2,
ep
u2

2
AE u2 u1
l

q0 u1 u2 Pu
1 1 P2 u2
u2 2
l
2

AE 2u2 2u1
l
q0 P2 0
2
l
2

AE
l
u2 u1 q0 P2
l
2

(i)

From equations (ii) and (iii), we get

q
e
EA 1 1 u1 P1 0

l 1 1 u2 P2e
q
0

l
2
l
2

1.4.2 Formulation of 1-D Heat Transfer Element using Rayleigh


Ritz Method
Consider a typical 1-D heat transfer element as shown in figure 1.16 with two nodes. The governing functional is given by

T1

T2

x=0

x=l

x
Figure 1.16
2

1 dT
p k
dx q0Tdx Q1T1 Q2T2
2 0 dx
0
l

We can use the same interpolation function as used in the formulation of bar element
x
x
T x 1 T1 T2
l

MECHANICAL eryc GATEMENTOR

(i)

1-32 Finite Element Methods

T T
dT
1 2
dx
l
l

Substituting above values in equation (i), we get


2

l
1
1 T1 T2
x
x
k

dx

0 q0 1 l T1 l T2 dx Q1T1 Q2T2
2 0 l
l

T2
2T T
T x2 T x2
1 T 2
k 12 x 22 x 12 2 x q0 T1 x 1 2 Q1T1 Q2T2
2 l
2l
2l 0
l
l
0

ql
1k
2
e T2 T1 0 (T1 T2 ) Q1T1 Q2T2
2 l
2

From Rayleigh Ritz method,

0
Ti
For i 1 ,

0
T1

q0l
1 k

2
(T1 T2 ) Q1T1 Q2T2 0
T2 T1

T1 2 l
2

ql
1k
(2T1 2T2 ) 0 Q1 0
2l
2
ql
k
(T1 T2 ) 0 Q1
l
2

(ii)

For i 2 ,

0
T2

T2

q0l
1 k

2
2 l T2 T1 2 (T1 T2 ) Q1T1 Q2T2 0

ql
1k
(2T2 2T1 ) 0 Q2 0
2l
2
ql
k
(T1 T2 ) 0 Q2
l
2
Writing equation (ii) and (iii) in matrix form, we get

k
l

q0 l
1 1 T1 2 Q1
1 1 T q l Q

2 0 2
2

MECHANICAL eryc GATEMENTOR

(iii)

You might also like