Computational Physics - Department of Physics

(Axel Boer) #1

6.4 Linear Systems 169


We subdivide our intervalx∈(a,b)intonsubintervals by settingxi=a+ih, withi= 0 , 1 ,...,n+ 1.
The step size is then given byh= (b−a)/(n+ 1 )withn∈N. For the internal grid points
i= 1 , 2 ,...nwe replace the differential operator with the above formularesulting in


u′′(xi)≈
u(xi+h)− 2 u(xi)+u(xi−h)
h^2

,

which we rewrite as
u′′i≈ui+^1 −^2 ui+ui−i
h^2


.

We can rewrite our original differential equation in terms of a discretized equation with ap-
proximations to the derivatives as



ui+ 1 − 2 ui+ui−i
h^2
=f(xi,u(xi)),

withi= 1 , 2 ,...,n. We need to add to this system the two boundary conditionsu(a) =u 0 and
u(b) =un+ 1. If we define a matrix


A=^1

h^2









2 − 1

−1 2 − 1

−1 2 − 1

... ... ... ... ...

−1 2 − 1

−1 2









and the corresponding vectorsu= (u 1 ,u 2 ,...,un)Tandf(u) =f(x 1 ,x 2 ,...,xn,u 1 ,u 2 ,...,un)Twe
can rewrite the differential equation including the boundary conditions as a system of linear
equations with a large number of unknowns


Au=f(u). (6.14)

We assume that the solutionuexists and is unique for the exact differential equation, viz that
the boundary value problem has a solution. But the discretization of the above differential
equation leads to several questions, such as how well does the approximate solution resemble
the exact one ash→ 0 , or does a given small value ofhallow us to establish existence and
uniqueness of the solution.
Here we specialize to two particular cases. Assume first thatthe functionfdoes not depend
onu(x). Then our linear equation reduces to


Au=f, (6.15)

which is nothing but a simple linear equation with a tridiagonal matrixA. We will solve such
a system of equations in subsection 6.4.3.
If we assume that our boundary value problem is that of a quantum mechanical particle
confined by a harmonic oscillator potential, then our functionf takes the form (assuming
that all constantsm= ̄h=ω= 1 )f(xi,u(xi)) =−x^2 iu(xi) + 2 λu(xi)withλbeing the eigenvalue.
Inserting this into our equation, we define first a new matrixAas

Free download pdf