

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Section 11.3, Problem 3(b): Write the discretization of the following boundary value
problem
y
′′ = −
x
y
′
x^2
y −
x^2
log x,
1 ≤ x ≤ 2 ,
y(1) = −
, y(2) = log 2,
in matrix-vector notation Aw = b.
Solution: At the interior points xi, for i = 1, 2 ,... , N , the differential equation to be
approximated is
y
′′ (xi) = −
xi
y
′ (xi) +
x
2 i
y(xi) −
x
2 i
log xi. (1)
Since
y
′′ (xi) =
y(xi+1) − 2 y(xi) + y(xi− 1 )
h^2
h
2
y
(4) (ξi),
y
′ (xi) =
y(xi+1) − y(xi− 1 )
2 h
h
2
y
′′′ (ηi),
we can write the numerical approximation to (1) as
wi+1 − 2 wi + wi− 1
h^2
xi
wi+1 − wi− 1
2 h
x^2 i
wi = −
x^2 i
log xi. (2)
Multiplying both sides of (2) by −h
2 gives
−(wi+1 − 2 wi + wi− 1 ) −
2 h
xi
(wi+1 − wi− 1 ) +
2 h
2
x^2 i
wi =
2 h
2
x^2 i
log xi.
Collecting wi− 1 , wi, and wi+1 terms, we obtain
2 h
xi
wi− 1 +
2 h
2
x
2 i
wi −
2 h
xi
wi+1 =
2 h
2
x
2 i
log xi. (3)
The resulting system of equations can be expressed in the tridiagonal N × N matrix form
Aw = b, where
2 h
2
x
2 1
2 h
x 1
2 h
x 2
2 h
2
x^2 2
2 h
x 2
2 h
xN − 1
2 h
xN
2 h
2
x
2 N
w =
w 1
w 2
. . .
wN − 1
wN
, and b =
2 h
2
x
2 1
log x 1 +
2 h
x 1
w 0
2 h
2
x
2 2
log x 2
2 h
2
x
2 N − 1
log xN − 1
2 h
2
x^2 N
log xN +
2 h
xN
wN +
In order to see that this system satisfies (3), look at a couple of rows of matrix A, for
example, the second row:
2 h
x 2
w 1 +
2 h
2
x^22
w 2 −
2 h
x 2
w 3 =
2 h
2
x^22
log x 2.
Also, first and last elements of b might be a little daunting. However, if we look at the
first row (for example), we see that
2 h
2
x^2 1
w 1 −
2 h
x 1
w 2 =
2 h
2
x^2 1
log x 1 +
2 h
x 1
w 0 ,
or
2 h
x 1
w 0 +
2 h
2
x^21
w 1 −
2 h
x 1
w 2 =
2 h
2
x^21
log x 1 ,
which satisfies equation (3).
Also, note that the book considers the general second-order boundary value problem:
y
′′ (x) = p(x)y
′ (x) + q(x)y(x) + r(x).
For our problem, p(x) = −
x
, q(x) =
x^2
, and r(x) = −
x^2
log x. Plugging these values
into the formulas in the book, we can verify whether our calculations are correct.