Solution
The equation in question is y''(r)+V(r)y(r)=E y(r). The idea behind the matrix way of solving a differential equation is to consider the left hand side of this equation as an operator acting on the function y, i.e. L[y]=E y, and then transform the operator into matrix form with the method of finite differences. Then we have a matrix eigenvalue equation, denoted by M Y=E Y, which is easy to solve using a computer mathematics program. The eigenvectors of M, i.e. the vectors Y, are vectors with the values of the function y as their elements, i.e.
. The second derivative of y is transformed as
y''(
)=
=
,
so Schrödinger's equation in finite difference form looks like

The idea is to form this equation at each of the points {
}. Then we have a set of n linear equations for the variables
, which can be written as M Y = E Y, and the elements of the matrix M are
="the coefficient of
in the i:th equation". For example
=-
,
=
+
. Most of the elements of M are zero. In fact, only the diagonal and the adjacent bands contain non-zero elements:
M=(
).
![]()
![]()
0
0
0
![]()
![]()
![]()
0
0
0
![]()
![]()
![]()
0
0
0
![]()
![]()
![]()
0
0
0
![]()
![]()
First, define the interval [
,
] in which to search for the solution, and the spacing of the points {
=
,
=
+h,
=
+2h,...,
=
} on this interval:
In[29]:=
The potential is of the form V(r)=
+ε
, with ε=0.1. Calculate its values in points {
}:
In[33]:=
Then, construct the matrix M. The only non-zero elements for the ith row are
,
and
.
In[36]:=
Now, the solutions of the equation M Y=E Y, the eigenvalues E and the corresponding eigenvectors Y can be calculated:
In[37]:=
Then, we can plot the eigenfunctions, which can be obtained by means of interpolation.
In[39]:=
| Created by Mathematica (April 10, 2007) |