Unit 5
Unit 5
5.1 Introduction
Finite element method is the numerical technique to solve the boundary value problems. The
basic idea behind the finite element method is to replace a continuous function by means of
piecewise polynomial. Such an approximation, called the piecewise polynomial
approximation. These are used in the numerical solution of practical problems where the
exact functions are difficult to obtain. In this study, we discuss two important methods of
approximation viz, the Rayleigh -Ritz method and the Galerkin Technique. Rayleigh
developed the method to solve certain vibration problems and Ritz provided a mathematical
basis for it and also applied it to more general problems. Whereas Rayleigh-Ritz method is
based on the existence of functional, the Galerkin Technique uses the governing equations of
the problem and the minimizes the error of the approximate solution. A disadvantage of both
these methods is that higher order polynomials have to be used to obtain reasonable accuracy.
In the finite element method, the domain of integration is subdivided into a number of smaller
regions called elements and over each of these elements the continuous function is
approximated by a suitable piecewise polynomial. To obtain the better approximation one
need not use higher-order polynomials but only use a finer subdivision, ie increase the
number of elements.
In practice, several types of elements are in use, the type used being largely dependent upon
the geometrical shape of the region under consideration. In two-dimensional problems, the
elements used are triangles, rectangles and quadrilaterals. For three-dimensional problems,
tetrahedra, hexahedra and parallelepiped elements are used.
Functional:
The concept of a functional is required to understand the Rayleigh-Ritz method. This concept
arises in the study of variational principles, which occur widely in physical and problems.
Mathematically, a variational principle consists in determining the extreme value of the
integral of a typical function, say 𝑓(𝑥, 𝑦, 𝑦 ′ ). Here the integrand is a function of coordinates
and their derivatives and the integration is performed over a region. Consider, for example,
the integral defined by
𝑏
𝐼(𝑦) = ∫𝑎 𝑓(𝑥, 𝑦, 𝑦 ′ )𝑑𝑥 , where 𝑦(𝑥) satisfies the boundary conditions 𝑦(𝑎) = 𝑦(𝑏) = 0.
Many problems arising in physics and engineering are modelled by boundary value problems
and initial boundary value problems. Frequently, these equations are equivalent to the
problem to the minimization of a functional which can be interpreted in terms of total energy
of the given system. In any physical situation, therefore, the functional is obtained from a
consideration of the total energy explicitly. Mathematically, it would be useful to be able to
determine the functional from the governing differential equation itself.
Example 1
𝑑2 𝑦
Find the functional for the boundary value problem defined by = 𝑓(𝑥),
𝑑𝑥 2
𝑦(𝑎) = 𝑦(𝑏) = 0
Solution:
Let 𝑣(𝑥) be a function satisfying the essential boundary conditions, viz, 𝑣(𝑎) = 𝑣(𝑏) = 0.
Multiply the differential equation written in the form
−𝑦 ′′ + 𝑓(𝑥) = 0 by 𝑣 and integrate with respect to x, we obtain,
𝑏 𝑏
− ∫𝑎 𝑣𝑦 ′′ 𝑑𝑥 + ∫𝑎 𝑣𝑓(𝑥)𝑑𝑥 = 0
Using by parts,
𝑏 𝑏
[−𝑣𝑦 ′ ]𝑏𝑎 + ∫𝑎 𝑣 ′ 𝑦 ′ 𝑑𝑥 + ∫𝑎 𝑣𝑓𝑑𝑥 = 0
𝑏 𝑏
−[𝑣(𝑏)𝑦 ′ (𝑏) − 𝑣(𝑎)𝑦 ′ (𝑎)] + ∫𝑎 𝑣 ′ 𝑦 ′ 𝑑𝑥 + ∫𝑎 𝑣𝑓𝑑𝑥 = 0
Since, 𝑣(𝑎) = 𝑣(𝑏) = 0
𝑏 𝑏
∫𝑎 𝑣 ′ 𝑦 ′ 𝑑𝑥 + ∫𝑎 𝑣𝑓𝑑𝑥 = 0
𝑏
∫𝑎 (𝑣 ′ 𝑦 ′ + 𝑣𝑓) 𝑑𝑥 = 0
Finally, substitute 𝑦 = 𝑣 in the above and multiply the bilinear terms by ½.
We obtain the required functional
𝑏
1
𝐼(𝑣) = ∫ [ 𝑣 ′2 + 𝑣𝑓]𝑑𝑥
𝑎 2
Example 2
𝑑2 𝑦 𝑑𝑦
Find the functional 𝑑𝑥 2 + 𝑘𝑦 = 𝑥 2 , 0 < 𝑥 < 1, 𝑦(0) = 0, (𝑑𝑥 ) = 1.
𝑥=1
Solution:
Let 𝑣(𝑥) be a function satisfying the essential boundary conditions, viz, 𝑣(0) = 0,
𝑣 ′ (1) = 1.
Multiply the differential equation written in the form
−𝑦 ′′ − 𝑘𝑦 + 𝑥 2 = 0 by 𝑣 and integrate with respect to x, we obtain,
1 1 1
− ∫0 𝑣𝑦 ′′ 𝑑𝑥 − ∫0 𝑘𝑣𝑑𝑥 + ∫0 𝑣𝑥 2 𝑑𝑥 = 0
Using by parts,
1 1 1
[−𝑣𝑦 ′ ]10 + ∫0 𝑣 ′ 𝑦 ′ 𝑑𝑥 − ∫0 𝑘𝑣𝑦𝑑𝑥 + ∫0 𝑣𝑥 2 𝑑𝑥 = 0
1
−[𝑣(1)𝑦 ′ (1) − 𝑣(0)𝑦 ′ (0)] + ∫0 (𝑣 ′ 𝑦 ′ − 𝑘𝑣𝑦 + 𝑣𝑥 2 )𝑑𝑥 = 0
Since, 𝑣(0) = 0, 𝑣 ′ (1) = 1
1
−[𝑣(1). 1 − 0] + ∫0 (𝑣 ′ 𝑦 ′ − 𝑘𝑣𝑦 + 𝑣𝑥 2 )𝑑𝑥 = 0
1
∫0 (𝑣 ′ 𝑦 ′ − 𝑘𝑣𝑦 + 𝑣𝑥 2 ) 𝑑𝑥 = 𝑣(1)
Finally, substitute 𝑦 = 𝑣 in the above and multiply the bilinear terms by ½.
We obtain the required functional
1 1 2
𝐼(𝑣) = 2 ∫0 (𝑣 ′ − 𝑘𝑣 2 + 2𝑣𝑥 2 ) 𝑑𝑥 − 𝑣(1)
Example 3
Find the functional 𝑥 2 𝑦 ′′ + 2𝑥𝑦 ′ = 𝑓(𝑥), 𝑎 < 𝑥 < 𝑏, 𝑦(𝑎) = 0, 𝑦(𝑏) = 0.
Solution:
Let 𝑣(𝑥) be a function satisfying the essential boundary conditions, viz, 𝑣(𝑎) = 0,
𝑣(𝑏) = 0.
Multiply the differential equation written in the form
−𝑥 2 𝑦 ′′ − 2𝑥𝑦 ′ + 𝑓(𝑥) = 0, by 𝑣 and integrate with respect to x, we obtain,
𝑏 𝑏 𝑏
− ∫𝑎 𝑣𝑥 2 𝑦 ′′ 𝑑𝑥 − ∫𝑎 2𝑣𝑥𝑦 ′ 𝑑𝑥 + ∫𝑎 𝑣𝑓(𝑥)𝑑𝑥 = 0
Using by parts,
𝑏 𝑏
∫𝑎 −𝑣(𝑥 2 𝑦 ′′ + 2𝑥𝑦 ′ )𝑑𝑥 + ∫𝑎 𝑣𝑓(𝑥)𝑑𝑥 = 0
𝑏 𝑑
∫𝑎 (𝑣[𝑓(𝑥) − 𝑑𝑥 (𝑥 2 𝑦 ′ )] 𝑑𝑥 = 0
𝑏 1 𝑑
∫𝑎 (𝑣[𝑓(𝑥) − 2 𝑑𝑥 (𝑥 2 𝑣 ′ )] 𝑑𝑥 = 0
𝑏 𝑑
𝐼(𝑣) = ∫𝑎 𝑣[2𝑓 − 𝑑𝑥 (𝑣 ′ 𝑥 2 )]𝑑𝑥
Example 4
Solve ∇2 𝑢 = 0, 𝑢 = 0 on the boundary C of R.
Solution:
𝜕 2𝑢 𝜕 2𝑢
+ =0
𝜕𝑥 2 𝜕𝑦 2
𝜕 2𝑢 𝜕 2𝑢
− − =0
𝜕𝑥 2 𝜕𝑦 2
𝜕 2𝑢 𝜕 2𝑢
− ∬ 𝑣(𝑥, 𝑦) 𝑑𝑥𝑑𝑦 − ∬ 𝑣(𝑥, 𝑦) 𝑑𝑥𝑑𝑦 = 0
𝑅 𝜕𝑥 2 𝜕𝑦 2
𝜕𝑢 𝜕𝑣 𝜕𝑢 𝜕𝑢 𝜕𝑣 𝜕𝑢
− [𝑣 ]+∬ 𝑑𝑥𝑑𝑦 − [𝑣 ] + ∬ . 𝑑𝑥𝑑𝑦 = 0
𝜕𝑥 𝜕𝑥 𝜕𝑥 𝜕𝑦 𝜕𝑦 𝜕𝑦
Using boundary condition 𝑣 = 0
1 𝜕𝑣 2 𝜕𝑣 2
∬[(𝜕𝑥) + (𝜕𝑦) ]𝑑𝑥𝑑𝑦 = 𝐼(𝑣)
2
Example 5
Solve ∇2 𝑢 = −𝑓, 𝑢 = 0 on the boundary C of R.
Ans
1 𝜕𝑣 2 𝜕𝑣 2
𝐼(𝑣) = ∬ *( ) + ( ) + 𝑑𝑥𝑑𝑦 − ∬ 𝑢𝑓𝑑𝑥𝑑𝑦
2 𝜕𝑥 𝜕𝑦
Example 6
𝑑4 𝑦 𝑑2 𝑦
Solve 𝐸𝐼 𝑑𝑥 4 + 𝑘𝑦 = 𝑓(𝑥), 0 < 𝑥 < 𝑙 𝑦 = 0, =0 at 𝑥 = 0, 𝑥 = 𝑙
𝑑𝑥 2
𝑑4 𝑦
Ans −EIv 𝑑𝑥 4 − 𝑘𝑣𝑦 + 𝑣𝑓(𝑥) = 0
𝑙 𝑑4 𝑦 𝑙 𝑙
−EI ∫0 𝑣 𝑑𝑥 4 𝑑𝑥 − 𝑘 ∫0 𝑣𝑦 𝑑𝑥 + ∫0 𝑣𝑓(𝑥) 𝑑𝑥 = 0
𝑙
𝑑3 𝑦 𝑙 𝑑𝑣 𝑑3 𝑦 𝑙 𝑙
−EI v *𝑑𝑥 3 + + 𝐸𝐼 ∫0 𝑑𝑥 . 𝑑𝑥 3 𝑑𝑥 − ∫0 𝑣𝑦𝑑𝑥 + ∫0 𝑣𝑓(𝑥)𝑑𝑥 = 0
0
Since 𝑦(0) = 0, 𝑦(𝑙) = 0
𝑣(0) = 0, 𝑣(𝑙) = 0
𝑙
𝑑𝑣 𝑑2 𝑦 𝑙 𝑑2 𝑣 𝑑2 𝑦 𝑙 𝑙
−𝐸𝐼[0] + 𝐸𝐼 *𝑑𝑥 . 𝑑𝑥 2 + − 𝐸𝐼 ∫0 (𝑑𝑥 2 . 𝑑𝑥 2 ) 𝑑𝑥 + ∫0 𝑣𝑓(𝑥)𝑑𝑥 − 𝑘 ∫0 𝑣 2 𝑑𝑥 = 0
0
Substituting 𝑦 = 𝑣
𝑙 2
1 𝑑2 𝑣
−𝐸𝐼 ∫ [ ( 2 ) + 𝑘𝑣 2 − 2𝑣𝑓(𝑥)] 𝑑𝑥 = 0
0 2 𝑑𝑥
Shape Function:
Suppose we wish to approximate a real valued function f(x) over a finite interval [𝑎, 𝑏].
Interval [𝑎, 𝑏] is divided into a number of subintervals [𝑥𝑖 , 𝑥𝑖+1 ], 𝑖 = 0, 1, 2, … … . . 𝑛 − 1,
where 𝑥0 = 𝑎 and 𝑥𝑛 = 𝑏 and interpolate linearly between the values of 𝑓(𝑥) at the end
points of each intervals. In [𝑥𝑖 , 𝑥𝑖+1 ], the linear approximating function is given by
𝑥𝑖+1 − 𝑥 𝑥 − 𝑥𝑖
𝑙𝑖 (𝑥) = [ 𝑓𝑖 + 𝑓 ]
𝑥𝑖+1 − 𝑥𝑖 𝑥𝑖+1 − 𝑥𝑖 𝑖+1
1
= [(𝑥𝑖+1 − 𝑥)𝑓𝑖 + (𝑥 − 𝑥𝑖 )𝑓𝑖+1 ]
𝑖
where 𝑖 = 𝑥𝑖+1 − 𝑥𝑖
{ Lagrange form
𝑥 −𝑥 𝑥−𝑥𝑖
𝑙𝑖 (𝑥) = *𝑥 𝑖+1−𝑥 𝑓𝑖 + 𝑥 𝑓𝑖+1 + }
𝑖+1 𝑖 𝑖+1 −𝑥𝑖
From this we construct the piecewise linear interpolating function over [𝑥0 , 𝑥𝑛 ] by the
formula
𝑛
𝑃𝑖 (𝑥) = ∑ ∅𝑖 (𝑥)𝑓𝑖
𝑖=0
𝑥1 −𝑥
Where ∅0 (𝑥) = , 𝑥0 ≤ 𝑥 ≤ 𝑥1
ℎ0
= 0, 𝑥1 ≤ 𝑥 ≤ 𝑥2
𝑥−𝑥𝑖
∅𝑖 (𝑥) = , 𝑥𝑖−1 ≤ 𝑥 ≤ 𝑥𝑖
ℎ𝑖−1
𝑥𝑖+1 −𝑥
= , 𝑥𝑖 ≤ 𝑥 ≤ 𝑥𝑖+1
ℎ𝑖
= 0, 𝑥 > 𝑥𝑖+1
∅𝑛 (𝑥) = 0, 𝑥0 ≤ 𝑥 ≤ 𝑥𝑛−1
𝑥−𝑥𝑛−1
= , 𝑥𝑛−1 ≤ 𝑥 ≤ 𝑥𝑛
ℎ𝑛
Therefore,
𝑛
𝑥1 −𝑥
∅0 (𝑥) = , 𝑥0 ≤ 𝑥 ≤ 𝑥1
ℎ0
𝑥−𝑥1
= , 𝑥0 ≤ 𝑥 ≤ 𝑥1
ℎ1
𝑥2 −𝑥
= 𝑥1 ≤ 𝑥 ≤ 𝑥2
ℎ1
The function ∅𝑖 (𝑥), 𝑖 = 1, 2,3, … … … are called base or shape function. It is easily seen
that the shape function ∅𝑖 (𝑥) are identically zero except for the range [𝑥𝑖−1 , 𝑥𝑖+1 ] with
∅𝑖 (𝑥) = 1,
Rayleigh-Ritz method
In this method we do not obtain the actual minimum but only an approximate solution 𝑎0
nearer the actual solution as the shape function allow. To obtain a good approximation, the
choice of the shape function is important and to improve the approximation, the number of
shape functions should be increased.
Consider second order boundary value problem
From the definition of the functional, we know that if 𝑦(𝑥), the solution of the equation (1),
is substituted in equation (2), then the integral I will be minimum. Since we do not know the
solution of equation (1), we try with an approximate solution and determine the parameters of
approximation so that the integral is minimum. This is the central idea of Rayleigh-Ritz
method.
Let 𝑣(𝑥) = ∑𝑛𝑖=1 𝛼𝑖 ∅𝑖 (𝑥) be an approximate solution.
Where the shape function ∅𝑖 (𝑥), are linearly independent and satisfy the boundary
conditions
∅𝑖 (𝑎) = 0 and ∅𝑖 (𝑏) = 0.
Substituting for 𝑣 in equation (2)
𝑏 2 2
𝑑
𝐼(𝛼1 , 𝛼2 , … … . 𝛼𝑛 ) = ∫ ,[ ∑ 𝛼𝑖 ∅𝑖 (𝑥)] − 𝑝 *∑ 𝛼𝑖 ∅𝑖 (𝑥)+ − 2𝑞 *∑ 𝛼𝑖 ∅𝑖 (𝑥)+- 𝑑𝑥
𝑎 𝑑𝑥
For minimum,
𝜕𝐼 𝜕𝐼 𝜕𝐼
𝛿𝛼1 + 𝛿𝛼2 + ⋯ … … … . . 𝛿𝛼 = 0
𝜕𝛼1 𝜕𝛼2 𝜕𝛼𝑛 𝑛
Since 𝛿𝛼𝑖 are arbitrary,
𝜕𝐼
= 0, 𝑖 = 1, 2, 3, … … … … … … … 𝑛.
𝜕𝛼𝑖
𝑑𝑦
If 𝐼 is the quadratic function for 𝑦 and 𝑑𝑥 , then above equation will be linear in 𝛼𝑖 and can
be solved easily.
We state that the Rayleigh-Ritz method converges to the actual solution of the problem
provided that the function ∅𝑖 are linearly independent and satisfy atleast the essential
boundary conditions of the problem. The following examples illustrate the method of
procedure.
Example 1
Solve the boundary value problem defined by 𝑦 ′′ + 𝑥 = 0, 0 < 𝑥 < 1, 𝑦(0) = 𝑦(1) = 0
using Rayleigh-Ritz method.
Solution:
To find functional
1
𝐼(𝑣) = − ∫0 [∑𝑛𝑖=1 𝛼𝑖 ∅𝑖 (𝑥)][2𝑥 + ∑𝑛𝑗=1 𝛼𝑗 ∅𝑗 ′′ (𝑥)] 𝑑𝑥
1 1
= − ∫0 ∑𝑛𝑖=1 2𝛼𝑖 ∅𝑖 𝑥 − ∫0 ∑𝑛𝑖=1 ∑𝑛𝑗=1 𝛼𝑖 𝛼𝑗 ∅𝑖 ∅′′
𝑗 (3)
For convenience, we set
1
𝑝𝑖 = ∫0 𝑥∅𝑖 (𝑥)𝑑𝑥 (4)
1
𝑞𝑖𝑗 = ∫ ∅𝑖 (𝑥) ∅′′
𝑗 (𝑥)𝑑𝑥 (5)
0
1 1
= [∅𝑖 (𝑥)∅′𝑗 (𝑥)] − ∫0 ∅′𝑖 (𝑥)∅′𝑗 (𝑥)𝑑𝑥 (Integrating by parts)
0
From (6),
1
𝑞11 = − ∫0 ∅1′ (𝑥) ∅1′ (𝑥)𝑑𝑥 (∵ ∅1′ (𝑥) = 1 − 2𝑥 , ∅′2 (𝑥) = 2𝑥 − 3𝑥 2 )
1 1 1
= − ∫0 (1 − 2𝑥)2 𝑑𝑥 = − ∫0 (1 − 4𝑥 + 4𝑥 2 )𝑑𝑥 = − 3
1 1
𝑞12 = − ∫0 (1 − 2𝑥)(2𝑥 − 3𝑥 2 )𝑑𝑥 = − 6 = 𝑞21
1 2
𝑞22 = − ∫0 (2𝑥 − 3𝑥 2 )2 𝑑𝑥 = − 15
Solution:
To find functional
Let 𝑣(𝑥) = ∑𝑛𝑖=1 𝛼𝑖 ∅𝑖 (𝑥) where ∅𝑖 (0) = 0 and ∅𝑖 (1) = 0 for all i. (2)
Substituting (2) in (1),
1
𝐼(𝑣) = − ∫0 (𝑣𝑣 ′′ + 𝑣 2 + 2𝑣𝑥) 𝑑𝑥
1
𝐼(𝑣) = − ∫0 [∑𝑛𝑖=1 𝛼𝑖 ∅𝑖 (𝑥)][2𝑥 + ∑𝑛𝑗=1 𝛼𝑗 ∅𝑗 ′′ (𝑥) + ∑𝑛𝑖=1 𝛼𝑖 ∅𝑖 (𝑥)] 𝑑𝑥
1
𝑝𝑖 = ∫0 𝑥∅𝑖 (𝑥)𝑑𝑥 (4)
1
𝑞𝑖𝑗 = ∫ ∅𝑖 (𝑥) ∅′′
𝑗 (𝑥)𝑑𝑥 (5)
0
1 1
= [∅𝑖 (𝑥)∅′𝑗 (𝑥)] − ∫0 ∅′𝑖 (𝑥)∅′𝑗 (𝑥)𝑑𝑥 (Integrating by parts)
0
From (6),
1
𝑞11 = − ∫0 ∅1′ (𝑥) ∅1′ (𝑥)𝑑𝑥 (∵ ∅1′ (𝑥) = 1 − 2𝑥 , ∅′2 (𝑥) = 2𝑥 − 3𝑥 2 )
1 1 1
= − ∫0 (1 − 2𝑥)2 𝑑𝑥 = − ∫0 (1 − 4𝑥 + 4𝑥 2 )𝑑𝑥 = − 3
1 1
𝑞12 = − ∫0 (1 − 2𝑥)(2𝑥 − 3𝑥 2 )𝑑𝑥 = − 6 = 𝑞21
1 2
𝑞22 = − ∫0 (2𝑥 − 3𝑥 2 )2 𝑑𝑥 = − 15
1 1 1
𝑟11 = 30 , 𝑟12 = 60, 𝑟22 = 105
Galerkin’s method:
The Rayleigh-Ritz method is a powerful technique for the solution of boundary value
problem. It has the disadvantage of requiring the existence of a functional which is not
always possible to obtain. In fact, not all differential equations have a variational principle.
Most engineering problems are expressed in terms of certain governing equations and
boundary conditions, and not in terms of a functional.
Galerkin’s method belongs to a wider class of methods called the weighted residual methods.
In this method, an approximating function called the trial function (which satisfies all
boundary conditions) is substituted in the given differential equation and the result is called
the residual. (the result will not be zero since we have substituted an approximating function).
Let the boundary value problem be defined by
𝑦 ′′ + 𝑝(𝑥)𝑦 ′ + 𝑞(𝑥)𝑦 = 𝑓(𝑥), 𝑎<𝑥<𝑏 (1)
with the boundary conditions.
𝑝0 𝑦(𝑎) + 𝑞0 𝑦 ′ (𝑎) = 𝑟0
𝑝1 𝑦(𝑏) + 𝑞1 𝑦 ′ (𝑏) = 𝑟1
Let the approximate solution be given by
𝑡(𝑥) = ∑𝑛𝑖=1 𝛼𝑖 ∅𝑖 (𝑥) (2)
Where ∅(𝑥) are called shape functions.
Substituting for 𝑡(𝑥) in (1), we obtain a residual, Denoting this residual by 𝑅(𝑡).
We obtain
𝑅(𝑡) = 𝑡 ′′ + 𝑝(𝑥)𝑡 ′ + 𝑞(𝑥)𝑡 − 𝑓(𝑥)
Usually the shape functions ∅𝑖 (𝑥) are chosen as weight functions. We have
𝑏
𝐼 = ∫ ∅1 (𝑥)𝑅(𝑡)𝑑𝑥 = 0 (3)
𝑎
Which yields a system of equations for the parameters 𝛼𝑖 , when 𝛼𝑖 are known, 𝑡(𝑥) can be
calculated from (2).
Example 1
Solve the boundary value problem defined by 𝑦 ′′ + 𝑦 + 𝑥 = 0, 0 < 𝑥 < 1,
sin 𝑥
𝑦(0) = 𝑦(1) = 0 using Galerkin’s method. The exact solution is 𝑦(𝑥) = − 𝑥. Find error
𝑠𝑖𝑛1
at 𝑥 = 0.5.
Solution
Let 𝑡(𝑥) = 𝛼1 ∅1 (𝑥)
Since both the boundary conditions must be satisfied by 𝑡(𝑥), we choose ∅1 (𝑥) = 𝑥(1 − 𝑥)
Substituting for 𝑡(𝑥) in the given differential equation, we obtain
𝑅(𝑡) = 𝑡 ′′ + 𝑡 + 𝑥
Hence we have
1
𝐼 = ∫0 ∅1 (𝑥)𝑅(𝑡)𝑑𝑥 = 0
1
∫0 𝛼1 𝑥(1 − 𝑥)(𝑡 ′′ + 𝑡 + 𝑥)𝑑𝑥 = 0
Now,
1 1 1
∫0 𝛼1 𝑡 ′′ 𝑥(1 − 𝑥)𝑑𝑥 + ∫0 𝛼1 𝑡𝑥(1 − 𝑥)𝑑𝑥 + ∫0 𝛼1 𝑥 2 (1 − 𝑥)𝑑𝑥 = 0
Integrating by parts,
1 1 1
[𝛼1 𝑥(1 − 𝑥)𝑡 ′ ]10 − ∫ 𝛼1 (1 − 2𝑥)𝑡 𝑑𝑥 + ∫ 𝛼1 𝑡𝑥(1 − 𝑥)𝑑𝑥 + ∫ 𝛼1 𝑥 2 (1 − 𝑥)𝑑𝑥 = 0
′
0 0 0
1 1 1
0 − 𝛼1 [(1 − 2𝑥)𝑡]10 + ∫ 𝛼1 (−2)𝑡𝑑𝑥 + ∫ 𝛼1 𝑡𝑥(1 − 𝑥)𝑑𝑥 + ∫ 𝛼1 𝑥 2 (1 − 𝑥)𝑑𝑥 = 0
0 0 0
𝑡 = 0 when 𝑥 = 0, 𝑥 = 1
1 1 1
∫0 𝛼1 (−2)𝑡𝑑𝑥 + ∫0 𝛼1 𝑡𝑥(1 − 𝑥)𝑑𝑥 + ∫0 𝛼1 𝑥 2 (1 − 𝑥)𝑑𝑥 = 0
1 1 1
−2 ∫0 𝛼1 𝑥(1 − 𝑥)𝑑𝑥 + ∫0 𝛼1 𝑥 2 (1 − 𝑥)2 𝑑𝑥 + ∫0 𝛼1 𝑥 2 (1 − 𝑥)𝑑𝑥 = 0
1 1 1
−2 ∫0 𝛼1 𝑥(1 − 𝑥)𝑑𝑥 + ∫0 𝛼1 𝑥 2 (1 − 𝑥)2 𝑑𝑥 + ∫0 𝛼1 𝑥 2 (1 − 𝑥)𝑑𝑥 = 0
1 1 1
𝑥2 𝑥3 𝑥3 𝑥4
−2𝛼1 * − + + 𝛼1 ∫ 𝑥 2 (1 − 2𝑥 + 𝑥 2 )𝑑𝑥 + * − + = 0
2 3 0 0 3 4 0
5
𝛼1 = 18 = 0.2778
Example 2
Solve the boundary value problem defined by 𝑦 ′′ + 𝑦 = 𝑥 2 , 0 < 𝑥 < 1,
𝑦(0) = 𝑦(1) = 0 using Galerkin’s method.
Ans 𝒚(𝟎. 𝟓) = −𝟎. 𝟎𝟒𝟏𝟔𝟔𝟓
Finite Element method for one dimensional problem
Consider two point boundary value problem
𝑑2 𝑦 𝑑𝑦
= −𝑓(𝑥), 0 < 𝑥 < 1 with boundary conditions 𝑦(0) = 0, (𝑑𝑥 ) =0
𝑑𝑥 2 𝑥=1
Solution
Step I: (Discretization of the region):
The region of given problem is the x axis from 𝑥 = 0 to 𝑥 = 1. Suppose that this is
divided into a set of subintervals, called elements, the intersection points are called nodes.
Let these be given by 𝑥0 , 𝑥1 , 𝑥2 … … … . , 𝑥𝑛, where 𝑥0 = 0, 𝑥𝑛 = 1. The elements are
numbered as (1), (2),……..(n), a typical element being the 𝑒 𝑡ℎ element of length 𝑒 , from
node 𝑒 − 1 to node 𝑒.
Let 𝑥𝑒−1 and 𝑥𝑒 be the values of 𝑥 at the nodes 𝑒 − 1 and 𝑒, and let 𝑦 (𝑒−1) and 𝑦 (𝑒) be
the value of y at these nodes.
Example 1
𝑑2 𝑦 𝑑𝑦
Solve = −2, 0 < 𝑥 < 1 with boundary conditions 𝑦(0) = 0, (𝑑𝑥 ) = 0 using
𝑑𝑥 2 𝑥=1
𝑥 1 2 1
𝐾12 = ∫𝑥 𝑒 [∅1′ (𝑥)]2 𝑑𝑥 = ∫ − (ℎ ) 𝑑𝑥 = ℎ = −2
𝑒−1 𝑒 𝑒
𝑥 1 2 1
𝐾21 = ∫𝑥 𝑒 [∅1′ (𝑥)]2 𝑑𝑥 = ∫ − (ℎ ) 𝑑𝑥 = ℎ = −2
𝑒−1 𝑒 𝑒
𝑥 1 2 1
𝐾22 = ∫𝑥 𝑒 [∅1′ (𝑥)]2 𝑑𝑥 = ∫ (− ℎ ) 𝑑𝑥 = ℎ = 2
𝑒−1 𝑒 𝑒
𝐾11 𝐾12 2 −2
𝐾 (1) = [ ]=* +
𝐾21 𝐾22 −2 2
𝑥
Now 𝐹𝑖𝑒 = ∫𝑥 𝑒 𝑓∅𝑖 (𝑥) 𝑑𝑥 + ∅𝑖 (𝑥𝑒 )𝐷2𝑒 + ∅𝑖 (𝑥𝑒−1 )
𝑒−1
𝑥 𝑥𝑒 −𝑥
𝐹2𝑒 = 2 ∫𝑥 𝑒 𝑑𝑥 + 𝐷2𝑒
𝑒−1 𝑥𝑒 −𝑥𝑒−1
𝑥𝑒
2 𝑥2 1
= ℎ *𝑥𝑒 𝑥 − + + 𝐷1𝑒 = 2 + 𝐷2𝑒
𝑒 2 𝑥𝑒−1
1 1
+ 𝐷1𝑒 + 𝐷11
𝐹 (1)
= [12 ]= [12 ]
+ 𝐷2𝑒 + 𝐷21
2 2
boundary conditions.)
3
𝑌2 = 4 , 𝑌3 = 1
(1) (2) 1
= 𝑌2 ∅1 (𝑥) + 𝑌3 ∅2 (𝑥), ≤𝑥≤1 (2)
2
3 𝑥−𝑥𝑒−1 1
=4 0<𝑥<2
ℎ𝑒
3
𝑦(𝑥) = × 2 × (𝑥 − 0)
4
3
= 2 𝑥, 0 ≤ 𝑥 ≤ 1/2
Exercise
1. Obtain functionals for the following boundary value problems
𝑑2 𝑦
a) = 𝑔(𝑥), 𝑦(0) = 𝑦(1) = 0
𝑑𝑥 2
𝑑2 𝑦 𝑑𝑦
b) + 𝑘𝑦 = 𝑥 3 , 𝑦(𝑎) = 0, (𝑑𝑥 ) = 1.
𝑑𝑥 2 𝑥=𝑏
Answer
𝑏 1
1. a) 𝐼(𝑣) = ∫𝑎 [2 𝑣 ′2 + 𝑣𝑔]𝑑𝑥
1 2
b) 𝐼(𝑣) = ∫0 (𝑣 ′ − 𝑘𝑣 2 + 2𝑣𝑥 3 ) 𝑑𝑥 − 𝑣(𝑏)
𝑏 𝑑
c) 𝐼(𝑣) = ∫𝑎 𝑣[2𝑔 − 𝑑𝑥 (𝑥 2 𝑣 ′ )] 𝑑𝑥
1 2
2. a) 𝐼(𝑣) = ∫0 (𝑣 ′ − 𝑣 2 + 2𝑣𝑥 2 ) 𝑑𝑥
10 7
𝑦(𝑥) = 𝑣(𝑥) = − 121 𝑥(1 − 𝑥) − 41 𝑥 2 (1 − 𝑥)
1 2
b) 𝐼(𝑣) = ∫0 (𝑣 ′ − 4𝑣𝑥) 𝑑𝑥
1
𝑦(𝑥) = 𝑣(𝑥) = 3 𝑥 2 (𝑥 − 𝑥 3 )
25
d) 𝑦(𝑥) = 𝑣(𝑥) = 37 𝑥(1 − 𝑥)
10 7
2. a) 𝑦(𝑥) = 𝑣(𝑥) = − 123 𝑥(1 − 𝑥) − 41 𝑥 2 (1 − 𝑥)
25
b) 𝑦(𝑥) = 𝑣(𝑥) = 37 𝑥(1 − 𝑥)
Bibliography
Balagurusamy, E., Numerical Methods, McGraw Hill, New Delhi, 1999.
Hildebrand, F. B., Introduction of Numerical Analysis, McGraw Hill, New York, 1956.
Jain M. K., Iyengar S. R. and Jain R. K., Numerical Methods for Scientific and Engineering
Computation, Wiley Eastern Limited, New Delhi, 1985.
Levy, H. and Baggott, E. A., Numerical Solution of Differential Equations, Dover, New York,
1950.
Sastry, S. S., Engineering Mathematics, 3rd eds., Vols., 1 and 2, Prentice-Hall of India, New
Delhi, 2004.
Sastry, S. S., Introductory Methods of Numerical Analysis, PHI, Fifth Edition, New Delhi,
2012.
Scheid, Francis, Theory and Problems of Numerical Analysis, Schaum Series, McGraw Hill,
New York, 1968.
G. Haribaskaran, Numerical methods, Laxmi Publications (P) LTD, New Delhi, Boston,
USA, 2006.