Solving boundary value problems using the Galerkin's method. This is a weighted residual method, studied as an introduction to the Finite Element Method.
This is a part of a series on Advanced Numerical Methods.
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
FEM Introduction: Solving ODE-BVP using the Galerkin's Method
1. Solving ODE-BVP through Galerkin’s Method
FEM: Introduction
Suddhasheel Ghosh, PhD
Department of Civil Engineering
Jawaharlal Nehru Engineering College
N-6 CIDCO, 431003
Series on Advanced Numerical Methods
shudh (JNEC) Concepts MEStru2k1617 1 / 14
2. DiffEq1
Introduction to terminology
Given a differential equation
Ψ
d2
y
dx2
,
dy
dx
,y,x = 0, (1)
and the initial conditions,
F1
dy
dx
,y,x = a = 0 F2
dy
dx
,y,x = b = 0
So, given the points a and b, it is desired to find the solution of the
differential equation using the Galerkin’s Method.
shudh (JNEC) Concepts MEStru2k1617 2 / 14
3. DiffEq1
A second-order Boundary Value Problem
A boundary value problem is given as follows:
d2
y
dx2
+ P(x)
dx
dy
+ Q(x)y = R(x)
along with the conditions
y(x = a) = A, y(x = b) = B
shudh (JNEC) Concepts MEStru2k1617 3 / 14
4. GM
Concept of Linear Independence
In Vector Algebra, n vectors, namely v1,v2,...,vn are linearly independent,
when
n
i=1
aivi = 0 ⇐⇒ ai = 0,∀i = 1,...,n
Linear independence means that no vector can be expressed as a linear
combination of other vectors.
This concept of linear independence is not only limited to vectors, but has
also been extended to the area of functions and various algebraic
polynomials.
shudh (JNEC) Concepts MEStru2k1617 4 / 14
5. GM
Galerkin’s method I
Formulation
The Galerkin’s Method is a “weighted-residual” method. We will try to
solve the following differential equation:
d2
y
dx2
+ P(x)
dy
dx
+ Q(x)y = R(x)
with the following boundary conditions y(x = a) = A and y(x = b) = B.
Let us assume that the solution is in the form
y = α0 + α1x + α2x2
+ ··· + αnxn
=
n
i=0
αixi
shudh (JNEC) Concepts MEStru2k1617 5 / 14
6. GM
Galerkin’s method II
Formulation
Differentiating the above form, with respect to x, we have:
dy
dx
=
n
i=0
iαixi−1
(2)
d2
y
dx2
=
n
i=0
i(i − 1)αixi−2
(3)
Substituting, these into the differential equation we have:
n
i=0
αi i(i − 1)xi−2
+ iP(x)xi−1
+ Q(x)xi
= R(x) (4)
shudh (JNEC) Concepts MEStru2k1617 6 / 14
7. GM
Galerkin’s method III
Formulation
From the boundary conditions, we have
n
i=0
αiai
= A, (5)
n
i=0
αibi
= B (6)
We work out the residual function as follows:
(x) =
n
i=0
αi i(i − 1)xi−2
+ iP(x)xi−1
+ Q(x)xi
− R(x) (7)
If there are n − 1 unknowns, then there should be n − 1 linearly
independent polynomials chosen to be multiplied as weights to the
shudh (JNEC) Concepts MEStru2k1617 7 / 14
8. GM
Galerkin’s method IV
Formulation
residual function. Therefore, for each j = 1,...,n − 1, we should have
n − 1 equations
b
a
Nj(x) (x)dx = 0 (8)
where Nj(x) denotes the jth polynomial.
These equations are solved using linear algebra to obtain the values of
αi, i = 0,...,n
shudh (JNEC) Concepts MEStru2k1617 8 / 14
9. GM
Example I
Galerkin’s Method
Problem: Use the Galerkin’s method to solve the following differential
equation:
d2
y
dx2
− y = x
Use the boundary conditions y(x = 0) = 0 and y(x = 1) = 0. (Desai, Eldho,
Shah)
Solution: Let us assume that the solution to the given differential
equation is in the following form, where there are four unknowns:
y = α0 + α1x + α2x2
+ α3x3
shudh (JNEC) Concepts MEStru2k1617 9 / 14
10. GM
Example II
Galerkin’s Method
From the boundary conditions given, we have
α0 + α1(0) + α2(02
) + α3(03
) = 0 =⇒ α0 = 0
α0 + α1(1) + α2(12
) + α3(13
) = 0 =⇒ α1 + α2 + α3 = 0(or)α3 = −(α1 + α2
We calculate the derivatives as follows:
dy
dx
= α1 + 2α2x + 3α3x2
d2
y
dx2
= 2α2 + 6α3x
Substituting these into the differential equation, we have the following:
α1x + α2(2 − x2
) + α3(6x − x3
) = x
shudh (JNEC) Concepts MEStru2k1617 10 / 14
11. GM
Example III
Galerkin’s Method
Since α3 = −(α1 + α2), we will have
−α1x + α2(2 − x2
) + (α1 + α2)(x3
− 6x) = x
=⇒ α1(x3
− 7x) + α2(x3
− x2
− 6x + 2) = x (9)
We can therefore formulate
(x) = α1(x3
− 7x) + α2(x3
− x2
− 6x + 2) − x (10)
shudh (JNEC) Concepts MEStru2k1617 11 / 14
12. GM
Example IV
Galerkin’s Method
Since there are two unknown parameters here, we will consider two
functions N1(x) = x − x2
, and N2(x) = x2
− x3
, as weighting functions.
Therefore,
1
0
N1(x) (x)dx = 0 =⇒ −0.5500α1 − 0.1833α2 = 0.0833
1
0
N2(x) (x)dx = 0 =⇒ −0.3262α1 − 0.1429α2 = 0.0500
We will have this system
−0.5500 −0.1833
−03262 −0.1429
α1
α2
=
0.0833
0.0500
(11)
shudh (JNEC) Concepts MEStru2k1617 12 / 14
13. GM
Example V
Galerkin’s Method
Using this, the relations α3 = −(α1 + α2), and α0 = 0, we have
α0 = 0,α1 = −0.1456,α2 = −0.01743,α3 = 0.1631
Therefore, we can say that for our differential equation, we have the
following solution:
y = −0.1456x − 0.01743x2
+ 0.1631x3
shudh (JNEC) Concepts MEStru2k1617 13 / 14