Problem
Approximate the solution of the 2nd-order linear ordinary differential equation
subject to the boundary conditions
y(b) = yb
Assumptions
The functions ci(t) are appropriately continuous.
Tools
We will use the centred divided-difference formula for the derivative and linear algebra.
Process
Divide the interval [a, b] into n sub-intervals by defining h = (b − a)/n, setting ti = a + ih for i = 0, 1, 2, ..., n. Let yi represent the approximation of y(ti), and therefore
yn = yb
Rewrite the differential equation
as
We can simplify this by multiplying by 2h2 and collecting on the y's:
Evaluate this equation at each of the points i = 1, 2, ..., n − 1.
This defines a system of n − 1 linear equations and n − 1 unknowns. Thus, this can be written in the form My = g.
Special Case
In the special case where the coefficients are constant, that is, the differential equation is of the form:
and therefore the ODE simplifies to
Now define:
l = 2c2 − hc1
d = 2h2c0 − 4c2
u = 2c2 + hc1
v = 2h2g
and solve the system of linear equations:
Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.