Odes: Boundary-Value Problems: 1. Introduction and Background
Odes: Boundary-Value Problems: 1. Introduction and Background
Odes: Boundary-Value Problems: 1. Introduction and Background
Eq. (1) can be divided by the element’s volume (𝜋𝑟 2 ∆𝑥) to yield
𝑞 𝑥 − 𝑞 𝑥 + ∆𝑥 2ℎ
0= + 𝑇 −𝑇 … (2)
∆𝑥 𝑟 ∞
𝑑𝑞 2ℎ
0=− + 𝑇 −𝑇 … (3)
𝑑𝑥 𝑟 ∞
𝑑𝑇
Fourier’s Law: 𝑞 = −𝑘
𝑑𝑥
𝑑2 𝑇
0 = 2 + ℎ′ (𝑇∞ − 𝑇) … (4)
𝑑𝑥
2ℎ
where ℎ′ = = a bulk heat-transfer parameter reflecting the relative
𝑟𝑘
impacts of convection and conduction [m-2]
Equation (4) represents a mathematical model that can be used to compute the
temperature along the rod’s axial dimension. Because it is a second-order ODE,
two conditions are required to obtain a solution. These maybe fixed boundary
conditions or Dirichlet boundary condition:
𝑇(0) = 𝑇𝑎 𝑇(𝐿) = 𝑇𝑏
4
3. Finite-Difference Methods
The most common numerical methods, to solve this problems, are finite-
difference approaches.
Figure 3 In order to implement the finite-difference approach, the heated rod is divided
into a series of nodes.
Example 1. Use the finite-difference approach to solve Eq. (4) for a 10-m rod
with ℎ′ = 0.05 m-2, 𝑇∞ = 200 K, and the boundary conditions:
𝑇(0) = 300 K 𝑇(10) = 400 K
Use four interior nodes. With a segment length of ∆𝑥 = 2 m
T0 300 K T1 T2 T3 T4 T5 400 K
node 0 1 2 3 4 5
x 2 m
𝑇0
−1 2.2 −1 0 0 0 𝑇1 40
0 −1 2.2 −1 0 0 𝑇2 40
=
0 0 −1 2.2 −1 0 𝑇3 40
0 0 0 −1 2.2 −1 𝑇4 40
𝑇5
Substituting the boundary condition 𝑇0 = 𝑇(0) = 300 K and 𝑇5 = 𝑇(10) =
400 K gives
2.2 −1 0 0 𝑇1 40 + 𝑇0 340
−1 2.2 −1 0 𝑇2 40 40
= =
0 −1 2.2 −1 𝑇3 40 40
0 0 −1 2.2 𝑇4 40 + 𝑇5 440
Notice that the coefficient matrix is both tridiagonal and diagonally dominant.
Solve this system of equation and the solution gives
𝑇1 283.2660
𝑇2 283.1853
=
𝑇3 299.7416
𝑇4 336.2462
𝑇1 = 283.2660 K 𝑇2 = 283.1853 K
𝑇3 = 299.7416 K 𝑇4 = 336.2462 K Ans
Figure 4 A boundary node at the left end of a heated rod. To approximate the derivative
at the boundary, an imaginary node is located a distance x to the left of the rod’s end
Fig. 4 depicts the node (0) at the left edge of a heated plate for which the
derivative boundary condition applies. Write Eq. (6) for this node gives
−𝑇−1 + 2 + ℎ′ ∆𝑥 2 𝑇0 − 𝑇1 = ℎ′ ∆𝑥 2 𝑇∞ … (7)
The first derivative in the x dimension at (0) by the centered difference
𝑑𝑇 𝑇1 − 𝑇−1
=
𝑑𝑥 2∆𝑥
Which can be solved for
𝑑𝑇
𝑇−1 = 𝑇1 − 2∆𝑥
𝑑𝑥
Now we have a formula for 𝑇−1 that actually reflects the impact of the
derivative. It can be substituted into Eq. (7) to give
𝑑𝑇
2 + ℎ′ ∆𝑥 2 𝑇0 − 2𝑇1 = ℎ′ ∆𝑥 2 𝑇∞ − 2∆𝑥 … (8)
𝑑𝑥
Consequently, we have incorporated the derivative into the balance.
9
Example 2. Solve the same problem as in example 1. But use the boundary
condition as
𝑑𝑇
a) (0) = 𝑇′𝑎 = 0 and 𝑇(𝐿) = 𝑇𝑏 = 400
𝑑𝑥
𝑑𝑇
b) (0) = 𝑇′𝑎 = −20 and 𝑇(𝐿) = 𝑇𝑏 = 400
𝑑𝑥
Solution a)
T1 T0 T1 T2 T3 T4 T5 400 K
node -1 0 1 2 3 4 5
x 2 m
𝑑𝑇
2.2𝑇0 − 2𝑇1 = 40 − 4 …(E1)
𝑑𝑥
𝑑𝑇
Apply derivative boundary condition (0) = 0 gives
𝑑𝑥
2.2𝑇0 − 2𝑇1 = 40
The equations, for node 1 to 4, are same as the example 1. The final system of
equations can be assembled in matrix form as
10
𝑇0
2.2 −2 0 0 0 0 𝑇1 40
−1 2.2 −1 0 0 0 𝑇2 40
0 −1 2.2 −1 0 0 = 40
𝑇3
0 0 −1 2.2 −1 0 40
𝑇4
0 0 0 −1 2.2 −1 40
𝑇5
Substituting the fixed boundary condition 𝑇5 = 𝑇(10) = 400 K gives
2.2 −2 0 0 0 𝑇0 40 40
−1 2.2 −1 0 0 𝑇1 40 40
0 −1 2.2 −1 0 𝑇2 = 40 = 40
0 0 −1 2.2 −1 𝑇3 40 40
0 0 0 −1 2.2 𝑇4 40 + 𝑇5 440
These equations can be solved for
𝑇0 = 243.0278 K
𝑇1 = 247.3306 K
𝑇2 = 261.0994 K Ans.
𝑇3 = 287.0882 K
𝑇4 = 330.4946 K
𝑑𝑇
b) From Eq. (E1) Apply derivative boundary condition (0) = −20 gives
𝑑𝑥
𝑇0 = 328.2710 K
𝑇1 = 301.0981 K
𝑇2 = 294.1448 K Ans.
𝑇3 = 306.0204 K
𝑇4 = 339.1002 K
As in Fig. 5 the solution at x = 0 now curves downward due to the negative
derivative we imposed at the boundary.
Problem
Use the Finite-Difference approach to approximate the solution to the
following boundary value problems.
𝜋
a. 𝑦 ′′ = −3𝑦 ′ + 2𝑦 + cos 𝑥 , 0≤𝑥≤ , 𝑦 0 = −0.3,
2
𝜋 𝜋
𝑦 = −0.1; use ∆𝑥 = .
2 8
𝑦′ 2 ln 𝑥
b. 𝑦 ′′ = + 𝑦+ −1, 1 ≤ 𝑥 ≤ 2, 𝑦′ 1 = 0,
𝑥 𝑥2 𝑥
1
𝑦 2 = 0; use ∆𝑥 = .
3
Example 3 (Δ x = 0.01)
16
14 a)
b)
12
10
8
y
0
0 2 4 6 8 10 12 14 16 18 20
x