Centered 7 point numerical
second derivative approximation
Assume the following:
|
|
(1.1)
|
Where the 2 superscript after f denotes the second derivative.
Define the Taylor series for each of 7 points
|
|
(1.2)
|
Using the coefficients of equation (1.1) in equations (1.2) we get:
|
For n=0 which is f0(x)
term:
|
(1.3)
|
For n=1 which is f1(x) we have (1.4)
|
For n=2 which are the f2(x)
(i.e. f’’(x)) coefficients we have
|
(1.5)
|
For n=3 which is f3(x) coefficients we have
|
For each other n we have:
|
(1.6)
|
We therefore have the matrix equation:
|
|
(1.7)
|
We can simplify this if we multiply both sides by 1/h2
and drop all references to h in the matrix:
|
|
(1.8)
|
The results for c with 7 points are:
C7=1/h2{1/90,-3/20,3/2,-49/18,3/2,-3/20,1/90}
On the other hand, the results with 5 points are:
C5=1/h2{-1/12,4/3,-5/2,4/3,-1/12}
And the results for 3 points are
C3=1/h2{1,-2,1}
One sees that there are significant differences between 7
and 5 points approximations for the second derivative. The computational cost of using 7 points Vs.
using 5 points is just 7/5 larger for the 7 point result. That is a very worthwhile tradeoff for
an oscillatory wave packet of the Schrodinger
equation.
For your convenience here is a Mathematica Notebook that can
compute the coefficients for any number of points:
A[j_,i_,n_]=If[i==0 && n-j==0,1,(j-n)^i/i!]
v[i_]=If[i==2,1,0]
p=8
mp=Table[A[j,i,p/2],{I,0,p},{j,0,p}]
bp=Table[v[i],{i,0,p}]
ci=LinearSolve[mp,bp]