Exercises 601
Exercises
A.1 [C] Write routines for generating the spherical Bessel functionsjlandnlaccording to
the method described in Appendix A2. Forjl, downward recursion is necessary to
obtain accurate results.
The upper valueLmaxfrom which the downward recursion must start must be
sufficiently large. In this problem, we take the following value forN:
Lmax=max
{[
3 [x]
2
]
+20,l+ 20
}
where[x]is the largest integer smaller thanxandlis the value we want the spherical
Bessel function for.
Write a function that yieldsjl(x). Check the result using the following values:
j 5 (1.5)=6.696 205 96· 10 −^4
n 5 (1.5)=−94.236 110 1.
A.2 Check the statements (i)–(v) given on page 565. In all cases, proofs by induction can
be given. The following hints may be useful:
(i) Use (A.22a) and (A.23a).
(ii) Use (A.22a), (A.22b) and (A.23b).
(iii) Use (A.22a) and (A.22b).
The last two items are proven together. Equations (A.22a) and (A.22b), and statement
(i) are used in the proof.
A.3 [C] Consider the Verlet algorithm:
xn+ 1 = 2 xn−xn− 1 +h^2 F[xn,n]+O(h^4 )
wherexn=x(t+nh). TheO(h^4 )means that the deviation of the exact solution from
the numerical one is smaller thanαnh^4 , whereαnare finite numbers that are
nonvanishing forh→0. We write the exact solution of the differential equation at
timesnhasx ̃n, and the numerical solutionxndeviates from the latter by an amountδn:
xn= ̃xn+δn.
(a) Write down an equation forδnand show that integration over an interval of finite
width using a number of steps of sizeh, yields an error in the final result which, in
the absence of divergences in the force (or the solution), is at mostO(h^2 ).
(b) Carry out a similar analysis for the Numerov algorithm, showing that the final
accuracy is at mostO(h^4 ).
(c) Discuss when the ‘worst case’ error (O(h^2 )for Verlet andO(h^4 )for Numerov) is
found.
(d) [C] Check the results of (a), (b) and (c) by writing routines for the two algorithms.
A.4 [C] Consider the Schrödinger equation in one dimension for a particle moving in the
Morse potential:
[
−
d^2
dx^2
+V 0 (e−^2 x−2e−x)
]
ψ(x)=Eψ(x).