You are on page 1of 1

Computational Physics – Assignment 3

Submission date: June 07, 2021

1. Roots of an equation (Quantum states in a square well – Eigenvalue problem)


Probably the most standard problem in quantum mechanics is to solve for the energies of a
particle of mass m bound within a 1-D square well of radius a:

As shown in quantum mechanics texts [Gottfried, K. (1966), Quantum Mechanics,


Benjamin, New York], the energies of the bound states within this well are
solutions of the transcendental equations
(even)
(odd)
where even and odd refer to the symmetry of the wave function. Here we have chosen
units such that and . These results
(1)
(2)
Your problem is to write a program that implements the bisection, Newton-Raphson and
secant algorithm and to find several bound state energies for even and odd wave
functions, that is, the solution of equations (1) and (2).
a) The first step in implementing any search algorithm is to get an idea of what your
function looks like. For the present problem you do this by making a plot of
versus .
Note from your plot some approximate values at which . Your program
should be able to find more exact values for these zeros.
b) Again, notice that the 10 in this equation is proportional to the strength of the potential
that causes the binding. See if making the potential deeper, say, by changing the 10 to a
20 or a 30, produces more or deeper bound states.

2. Numerical Differentiation
Use the forward-difference, central-difference, and extrapolated-difference algorithms to
differentiate the function at
a) Print out the derivative and its relative error as functions of . Reduce the step size
until it equals machine precision .
b) Plot and check whether the number of decimal places obtained
agrees with the estimates in our lecture note. If it doesn’t agree explain why?
c) See if you can identify regions where truncation error dominates at large and round-
off error at small in your plot.

3. Numerical Integration
Write a FORTRAN program to calculate

using the trapezoid and Simpson rule and investigate its accuracy for various values of N (5,
7, 9 , 11, 21, 51,101). Present your data in the tabular form. (Hint: Split the range of
integration into two parts and make a different change of variable in each integral to handle
the singularities.)

You might also like