The Newton-Raphson Method#
An alternative method for finding the minimum of a function is the Newton-Raphson Method (also called Newton’s Method).
The central idea here is that if we zoom in on any function, then we can approximate the local shape of that function as quadratic, i.e.
over some small range of \(x\).
If \(f(x)\) has a minimum, then at that point
and, if we know the coefficients \(a\) and \(b\), then we can directly calculate the value of \(x\) that minimises our function.
To find the value of the coefficients \(a\) and \(b\), we use the property that any function can be expanded as a Taylor series (see, e.g., Chapter 6 in Foundations of Science Mathematics).
If we are at some point \(x_0\), then we can approximate our function locally as a polynomial in \((x-x_0)\):
And, if we remain close to \(x_0\), where the higher order terms in \((x-x_0)\) are small, we have the approximation that
i.e., we approximate \(f(x)\) as quadratic.
Differentiating this approximate expression with respect to \(x\)gives:
and setting this to zero allows us to solve for \(x\):
In the context of finding the minimum of a potential energy surface, this looks like:
Starting at an initial guess, \(r_n\), calculate the first and second derivatives of \(U(r_n)\) at that point.
Use the Newton-Raphson equation \(r_{n+1} = r_n - U^\prime(r_n) / U^{\prime\prime}(r_n)\) to predict the position of the minimum.
In reality, our potential energy surface is never exactly quadratic (except for the special case of a harmonic potential), so step 2. only gives us an approximate guess for the minimum position. We then repeat steps 1. and 2. as an iterative process, until we (hopefully) converge on the energy minimum.
Exercise#
Write a function to calculate the second derivative of a harmonic potential:
Show that the Newton-Raphson method finds the optimal bond length for your harmonic potential in one step, irrespective of your starting point.