Boundary Value Problems in ODEs
Boundary Value Problems in ODEs
Usually, in physical problems, the initial conditions for derivatives of certain order
are not know, but instead of that the initial and final values for the unknown
or derivatives of some order can be known. Such type of problems are called as
the boundary-value problems. this occurs more frequently with partial differential
equations.
The difference between the IVP and BVP is depicted in the following table
Initial Value Problem (IVP) Boundary Value Problem (BVP)
The initial conditions are given The boundary conditions are given
at the same point of the independent at two different points of the
variable independent variable
Example of IVP Example of BVP
aÿ(t) + bẏ(t) + cy(t) = d(t) aÿ(t) + bẏ(t) + cy(t) = d(t)
y(t0 ) = α and ẏ(t0 ) = β y(tl ) = α and y(tr ) = γ
In the case of IVP with given y(t0 ) and t˙0 , there is a theorem of existence and
uniqueness of the solution. But in the case of IVP the existence and uniqueness
theorem is not available. Therefore, the BVP may have no solutions or may have
non-unique solutions even when the problem is of the order N and N conditions
are available.
178
Name of condition Value specified Examples
Dirichlet condition The value of y(t) is specified at two particular locations of y(0) = 2 and
the independent variable y(a) = 3
Neumann condition The derivative of y(t) is specified at two points ẏ(0) = 5 and
ẏ(b) = 7
Mixed condition Both, the value of y(t) and its derivative ẏ(t) ẏ(c) = 2 and
are specified y(a) = −3
3. solve IVP,
5. if necessary modify the guess and solve problem again and jump to the third
point.
Example 13 ♥
Solve BVP for the second order ODE
z̈(t) − 4z(t) + 4t = 0
with the boundary conditions z(0) = 0 and z(1) = 2. The problem can be con-
verted to a system of the first order ODEs
" # " # " # " #
ż1 z2 z1 (0) 0
= , =
ż2 4(z2 − t) z2 (0) ?
and solved by the RK2 method with h = 0.01 for various values of z2 (0) until
the function z(t) at t = 1 will satisfy the condition z(1) = 2. The following table
(according to [1]) shows the guesses and results
guess ż(0) z(1)
1 0 -0.7688
2 1 0.9900
This table gives coordinates of two points in the space of z(0) and ż(1) and it is
easy to fit a straight line through these points (see Fig. Al Amer Unit 7 Lesson 8
179
page 19). The third guess is less intuitive because of the simple geometry: choosing
the ordinate z(1) = 2, which is the solution to the BVP, correspond to abscissa
ż(0) = 1.5743, which is the third and the final best guess.
♠
The shooting method can be ineffective for higher order BVP when boundary
conditions for more than one variable should be invented.
for y(t), where t ∈ [0, 1], with Neumann boundary conditions: y(0) = 0 and
ẏ(1) = −1. The procedure to solve this BVP with the finite difference method
consists the following steps:
• set up the system of linear algebraic equations, called shortly: the linear
system,
The domain t ∈ [0, 1] must be staggered about the boundary and therefore, for
the Neumann’s conditions it should be split into (n − 2) subintervals by n discrete
1
points with the step h = n−2 . Then the discretization of t is such that ti = h(i− 32 ).
For the Dirichlet conditions it should be split into (n − 1) subintervals with the
1
step h = n−1 .
180
Approximation of ODE
The Eq.8.1 can be approximated by the finite-differences and express in the form
1
(yi−1 − 2yi + yi+1 − yi ) = 0 (8.2)
h
Following the approximation of ODE, the boundary conditions must be also ap-
proximated. Because the grid is staggered, the values of y1 and y2 are given at
t1 = − h2 and t2 = h2 and therefore, the value y at t = 0 can be defined by interpo-
lation between y1 and y2 . Therefore, using the central interpolation at the point
t1+ 1
2
y1 + y2
y1+ 1 = + O(h2 ) = 0
2 2
and solving for y1 and neglecting the error of the finite-difference scheme, we obtain
y1 = −y2 .
dy yn − yn−1
|i=n− 1 = + O(h2 ) = −1.
dt 2 h
taken at ti=n− 1 . From where, neglecting the discretization error, we can obtain
2
yn = yn−1 − h.
181
Embedding of boundary conditions
The approximation of ODE can be used only to find the solution at points i ∈
[2, 3, . . . , n − 1] and therefore, the boundary conditions must be embedded in the
range of those points. Writing the approximation of ODE at i = 2 and i = n − 2
a2 y1 + b2 y2 + c2 y3 = d2 ,
an−1 yn−2 + bn−1 yn−1 + cn−1 yn = dn−1
y1 = −y2
yn = yn−1 − h
results in two required equations embedded in the linear system for the ODE
(b2 + a2 )y2 + c2 y3 = d2
an−1 yn−2 + (bn−1 − cn−1 )yn−1 = dn−1 + cn−1 h. (8.4)
(b2 − a2 )y2 + c2 y3 = d2
a3 y2 + b3 y3 + c3 y4 = d3
a4 y3 + b4 y4 + c4 y5 = d4 (8.5)
.. ..
. .
an−2 yn−3 + bn−2 yn−2 + cn−2 yn−1 = dn−2
an−1 yn−2 + (bn−1 − cn−1 )yn−1 = dn−1 + cn−1 h
3 b3
a c3
y3
d3
a4 b4 c4 y4 d4
.. .. .. .. ..
. . .
=
(8.6)
. .
an−3 bn−3 cn−3 y
n−3
dn−3
an−2 bn−2 cn−2 yn−2 dn−2
an−1 b̂n−1 yn−1 dˆn−1
182
where the following substitutions have been applied
b̂2 = b2 − a2 ,
b̂n−1 = bn−1 + cn−1 ,
dˆn−1 = dn−1 + hcn−1 .
A·y =d (8.7)
and one of the solvers appropriate for a tridiagonal system can be applied. The
solution y is loaded by the error of the first-order accurate in h that is worse in
comparison with the second order accurate shooting method with the predictor-
corrector method.
with boundary conditions on ∂Ω. One of the possible forms of the differential
operator is
d2
Dy = ( + k 2 )y = 0 for 0 < t < 1. (8.9)
dx2
n
X
y(t) ≈ v(t) = cj ϕj (t) (8.10)
j=1
where the so called trial space is spanned on vectors {ϕj }nj=1 . Therefore, the
functions v(t) are called the trial functions. Since vectors ϕj (t) are known, the
goal of MWR is to find n scalars {cj }nj=1 that can be done by minimizing so called
residuals
183
where r is the residual. The minimization of the residual is performed in the sense
of the following integral relation defined over the entire domain Ω:
Z
r(t)wi (t)dt = 0 for each i, (8.12)
Ω
where {wi }mi=1 are called the test functions or weights. The number of weight
functions and the number of base functions for the trial space are related. There
are many possibilities for the selection of these base functions. One of choices is
related to the Lagrange polynomials which we already discussed in one of former
chapters. The set of (n − 1) degree polynomials related to tj , j = 1, 2, . . . , n
n
Y t − ti
pj (t) = (8.13)
i=1,i6=j
tj − ti
forms the basis of the finite-dimensional linear space. Therefore, the trial functions
can be expressed as
n
X
v(t) = vj pj (t), (8.14)
j=1
polynomials pj (t) are equal to zero only in a finite number of nodal points and
otherwise are nonzero, and moreover, pj (t) ∈ C ∞ .
The other set of base polynomials which could be chosen is the set of piecewise
polynomials.
184
y(0) = 1 and y(1) = 0.
Choose h = 0.5 and then calculate the solution at three nodes: t = 0, t = 0.5,
t = 1. Hence, the trial function consists of three base functions ϕj (t) of the trial
space , i.e.
3
X
v(t) = vj ϕj (t), (8.17)
j=1
with values v1 and v3 = 0 obtained from the boundary conditions. Therefore, the
only unknown value of v(0.5) correspond to the second node:
Z 1Ã 2 !
d v 2
+ k v ϕ2 (t)dt = 0 (8.18)
0 dt2
The last step can be done by minimizing the residual and enforcing it to assume
the zero value at a finite number of collocation points. Assuming the test functions
wi (t) in the form
185
the residual, defined by Eq. 8.12, is expressed by
Z
r(t)a(t − tci )dt = r(tci ) = 0 (8.21)
Ω
n
X dvj
v(t) = vj ϕ0j (t) + ϕ1j (t) (8.23)
j=1
dt
Then the second order ODE requires two collocation points per one segment of the
domain called as the element. For example, taking n = 2, gives two nodes located
at ends of the domain, i.e. t = 0 and t = 1. In this case there are 2n unknowns
with totally 2n equations generated from the ODE and two boundary conditions.
The accuracy of calculations of the order O(h4 ) can be achieved by choosing the
collocation points as the Gauss quadrature points:
1 √
tc1 = (3 − 3),
6
c 1 √
t2 = (3 + 3).
6
186
Two Eqs. 8.24 and two boundary conditions compose the system than can be
written in the matrix form
1 0 0 0 v1 1
dv1
b21 b22 b23 b24
dt
0
= , (8.25)
b31 b32 b33 b34
dv2 0
dt
0 0 0 1 v2 0
8.6.1 Preliminaries
Sobolev spaces
187
Name Definition
Lebesgue A set which can be assigned a volume is called the
measurable set measurable set.
Lebesgue The Lebesgue norm is based on the Lebesgue integral
norm interpreted as the area under a curve.
Lebesgue The Lebesgue spaces are defined by
spaces Lp (Ω) := {f (t) : kf kLp (Ω) < ∞} for f (t) is a real-
valued functions given on the domain Ω, where
1
kf kLp (Ω) := ( Ω f p dt) p for 1 ≤ p ≤ ∞.
R
188
Name Definition
Support The support of a function u ∈ C defined on the domain
Ω ⊂ Rn is the closure of the open set {t : u(t) 6= 0}.
The function u has a compact support if such set is
compact and is the interior of Ω.
Functions with Denote D(Ω) = C0∞ (Ω) ⊂ C ∞ where C ∞ is the set
compact support of functions with compact support in Ω ⊂ Rn ,
Locally integrable The set of locally integrable functions is denoted by
functions L1loc := {f : f ∈ L1 (K)} for compact ∀K ⊂ Ω
Weak derivative The function f ∈ L1loc has a weak derivative Dw αf,
1
provided that a function g ∈ Lloc (Ω) exists and fulfils
the following relation
|α| (α) (t)dt for ∀ϕ ∈ D(Ω),
R R
Ω g(t)ϕ(t)dt = (−1) Ω f (t)ϕ
where ϕ(α) means α derivative of ϕ.
Then Dw α f = g and g is called the weak derivative of f .
189
Name Definition
Examples of V = Rn , (x, y) := ni=1 xi yi ,
P
is a weak derivative of the absolute value function f (t) = |t| such that f : [−1, 1] →
[0, 1] that is not differentiable at t = 0. It should be emphasized here that it is not
the only weak derivative that can be assigned to f (t), because any function p(t)
that is equal to g(t) almost everywhere is also a weak derivative for f (t). ♠
Example 15 ♥
Show that the function g(t) given by
(
1, if t < 0,
g(t) :=
−1, if t > 0,
is a weak derivative of the function f (t) = 1 − |t|, for t ∈ Ω = [−1, 1]. Note that
f (t) is continuous at 0.
Solution
Apply the formula given by the first definition of the weak derivative in above table
and break the interval [−1, 1] into two parts where f (t) is smooth and integrate
by parts:
190
Z 1 Z 0 Z 1
f (t)ϕ̇(t)dt = f (t)ϕ̇(t)dt + f (t)ϕ̇(t)dt
−1 −1 0
Z 0 Z 1
= f ϕ|0−1 − (+1)ϕ(t)dt + f ϕ|10 − (−1)ϕ(t)dt
−1 0
Z 1
= − f (t)ϕ(t)dt − f (0+)ϕ(0+) + f (0−)ϕ(0−)
−1
Z 1
= − g(t)ϕ(t)dt.
−1
All second order ODE can be expressed as the LHS of the Sturm-Liouville (S-L)
form called also the self-adjoint form. This observation is very useful because each
BVP based of this kind of equation has a unique solution.
The classical S-L form for the real second order ODE is
d dy(t)
· ¸
− p(t) + q(t)y(t) = λr(t)y(t) (8.26)
dx dt
where q(t) and r(t) ∈ C[a, b], p(t) ∈ C 1 [a, b], y(t) ∈ C 2 [a, b], and moreover
p(t) > 0 and q(t) > 0 on [a, b]. The value λ is not specified by Eq. 8.26, however
finding values of λ for which non-trivial solutions of BVP exist, is a part of the
S-L problem. The above can be written as
where
d dy(t)
· ¸
Dy(t) = − p(t) + q(t)y(t). (8.28)
dx dt
D : C 2 [a, b] ⇒ C[a, b]
191
Following the first sentence of this section, each BVP for ODE with non-homogeneous
conditions can be written as
The final solution y(t) ∈ C 2 [a, b] = {y ∈ C 2 [a, b], y(a) = α, y(b) = β} of the problem
Eq. 8.29 can be done by solving at first the problem Eq. 8.30 for Z(t) ∈ C02 [a, b] =
{y ∈ C 2 [a, b], y(a) = y(b) = 0}. It is important to note from which spaces these
solutions are selected. Therefore, the problem Eq. 8.29 can be approximated by
the problem Eq. 8.30 replacing Z(t) by ŷ(t), i.e.
If ŷ solves the problem Eq. 8.31, then the first step to convert the problem into its
variational form is to select any smooth function v(t) which satisfies the homoge-
neous boundary conditions, i.e. v(a) = 0 and v(b) = 0. The second step is to refer
to one of quadratic functionals [11] defined in Sobolev spaces H 1 (a, b), e.g. inner
product. Suppose that Dŷ(t) is expressed in simpler form: Dŷ(t) = ÿ(t).ˆ Then
the problem expressed by Eq 8.31 and boundary conditions can be written as
Z b Z b
r(t)v(t)dt = ˆ
ÿ(t)v(t)dt. (8.32)
a a
192
Both sides of Eq. 8.32 are the inner products in a Hilbert space.
The third step is to replace the infinite dimensional linear problem (IDLP)
Z b
Find ŷ ∈ H01 such that ∀v ∈ H01 , −ϕ(ŷ) = r(t)v(t)dt (8.34)
a
where H 1 (0, 1) and Ĥ 1 (0, 1) are the Sobolev spaces specified as follows:
These spaces provide the unique solution for the weak formulation of the second
order BVP.
The weak form of Eq. 8.37 can be expressed as
Find y ∈ Y such that
where
Z 1
a(y, v) = (ẏ v̇ + bẏv + cyv)dt (8.40)
0
Z 1
(f, v) = f vdt.
0
193
8.7 Reyleigh-Ritz method
Our idea for this section is to follow the magnificent paper by R. Courant published
in 1943 [11] with the presentation of the Rayleigh-Ritz (R-R) method. Courant’s
paper is fundamental for the development of the finite element method called by
him as the finite difference method with some generalizations. The paper was
one of the fundamental papers for the development of applied mathematics and
computational mechanics.
where d is the lower bound of the functional L(φi ). The problem lies in the
construction of the minimization sequence and the recipe for such construction is
given by the Ritz procedure:
194
2. Then L(φn ) becomes a function F (a1 , a2 , . . . , an ) of n parameters ai
that can be evaluated form the minimum problem
L(φn ) = F (a1 , a2 , . . . , an ) = min, (8.43)
3. Because L(φn ) is quadratic or bilinear functional, Eq.8.43 leads to a
system of n linear equations for n parameters ai and therefore the
minimizing sequence φi is found.
Courant made the important remark regarding the convergence of the minimizing
sequence:
The better convergence in the R-R method can be assured by modifying the orig-
inal variational problem by adding higher order terms which vanish for the actual
solution u. From the theoretical point of view, the R-R method consists in the
construction of the minimizing sequence but the main difficulty is to find suitable
coordinate functions and to estimate the accuracy of the final result. The functions
should be chosen considering two objectives:
The completeness of the sequence φi is not important because only few of the
coordinate functions are accounted in time. To achieve the successful evaluation
of u the initial function should be fairly good approximation of u and in addition,
the functions φi should be sufficiently different so that by increasing number of
terms the quality of approximation could be increased. The choice of polynomials
as coordinate functions leads to better results.
Referring that our original problem can be written in the form: L(u) = f , very
useful method for the selection of coordinate functions consists of the following
idea:
195
• then define ω2 = L(ω1 ),
This idea results in the system of equations for ai comparatively simple. Unfortu-
nately, this selection of functions lead to some complications at boundaries because
of higher derivatives.
196