The aim of my project is straightforward: to generate the potential curve for a molecule given only its first-order spectroscopic constants (and other basic information about the molecule). The spectroscopic constants determine the functional form for the molecule's allowed energies and can be determined by fitting a polynomial of order 2 or greater to the molecule's emission spectrum.
Example config file structure for the ground state of carbon monoxide in the ground state, CO-X1S. Spectroscopic constants are given in the NIST handbook for carbon monoxide.
The program reads input data from a config spreadsheet formatted according to the figure (option names on the left, values on the right. The values shown correspond to the ground state of carbon monoxide). In addition to requiring the first- and second-order spectroscopic constants, which are not pictured, the following options are necessary:
name: the name of the molecule being analyzed. Used in output filenames only.
state: the electronic state of the molecule being analyzed. Used in output filenames only.
kaiser: '0' or '1'. Determines whether to apply the mathematical "Kaiser correction" to the Klein integrals, which is appropriate when the potential curve is not correctly filled in below v=0.
intmethod: You may have noticed that at the upper limit of the Klein integrals, the denominator of the integrand is 0 - this is known as a non-integrable singularity and requires a fix. Two fixes are offered, named according to the researcher who derived them: Watson and Fleming.
Watson's correction to the Klein integrals. This is the best correction, but fails if the second-order spectroscopic constants are not given.
Fleming's correction to the Klein integrals. This functions for any input order.
vmax: the highest vibrational level for which to calculate the turning points
space: the increment by which to space individual turning point calculations. For example, for a space of 2, the program will calculate for v=0, v=2, v=4,...
ladderspace: sets how often horizontal lines are overlaid onto the output graphs. Visual only.
errortol: sets the tolerance of the MATLAB integration function used to solve the Klein integrals.
mass1: the mass of the first isotope in the molecule in amu.
mass2: the mass of the second isotope in the molecule in amu.
netcharge: the net charge of the molecule in Coulombs.
we through 6we - the first through 10th-order vibrational spectroscopic constants
Be through 2e - the first through 5th-order rotational spectroscopic constants
Te, De, ke, re - optional parameters for when the electronic energy, dissociation energy, bond strength, and equilibrium internuclear distance (respectively) are known. From these, a precise potential energy curve is generated for visual comparison with the RKR result.
It turns out we already have everything we need to compute the turning points - and thus to compute the potential. To this end, the program loops through values of v from vmin (usually -0.5 unless we apply the Kaiser correction) to vmax in increments of space. This is fully accomplished by the above code snippet. As the turning points are calculated, they (and their associated energy) are added to an ever-expanding list.
The above figure presents the raw output of iteratively applying the RKR method on carbon monoxide up to a maximum vibrational level of 80 in increments of 2. Each cross represents a single computed turning point, while the lines connecting them are the result of simple linear interpolation. In any application of this program, we would use a much smaller value for 'space' (so the computed turning points are much denser, which is more useful for subsequent calculations). However, it is instructive to use 2 here (so the discrete turning points can be directly observed).
There are a couple of problems here: on the left-hand side, where the potential should go to infinity (see the molecular potential diagram on the homepage), it instead doubles back - a known problem with the RKR method, as the approximations used to make it valid break down for high vibrational levels. A little trickier to spot is that the dissociation energy is too high - the potential should level out much sooner than we observe here. So, some corrections are in order.
The program performs a spline interpolation on the (ideally very dense) array of turning points, producing a highly accurate piecewise function which "fills in" the points on the potential curve that we didn't explicitly calculate.
Using the resultant spline object, as well as its first and second derivatives, the program performs a simple search to locate downwards curvature on the inner portion of the curve and the location of the potential minimum.
If the program is able to identify negative concavity before the well minimum, it recognizes that the raw RKR data is in need of a correction. Previous work by Robert J. LeRoy suggested that an inverse-power fit of the form (A/r^n + B) suffices for this kind of correction. To obtain this fit, the program computes the best value of n for each turning point near the problematic region, averages them out, then selects A and B to overlap the last two valid turning points.
The first equation above gives the best value for n for a given r. The second and third give the exact values for A and B given that v1 and v2 are the last two valid vibrational levels to be fitted to.
Given the potential energy curve for a molecule (which at this point we have an accurate approximation of), there are several parameters which are easy to extract.
The first, the molecular bond length, is just the equilibrium internuclear distance - which we obtained when finding the bottom of the potential well. So, this value can be reported immediately!
The second is the molecular bond strength - which is the second derivative of the potential energy at the bottom of the well. This is also easy to calculate with our spline objects.
Finally, we can output a Morse potential corresponding to this molecule - a special kind of potential energy function that makes many approximations, but is easy to work with mathematically. The Morse potential allows us to reach the molecule's dissociation energy very quickly.
This is the result of applying the smoothing procedure discussed above to the raw RKR data. Nonphysical results have been completely weeded out, but dissociation still occurs at too high an energy. This is, unfortunately, unavoidable to the best of my knowledge- the inner portion of the curve can be smoothed, but the outer portion cannot be corrected. Thus the result here is most accurate near the bottom of the well.
This is the Morse potential curve fitted directly to the smoothed RKR data. It is from this curve that the dissociation energy is reported. Note that if only the bottom of the potential is generated by the RKR method, the outputted Morse potential will have a better prediction of the dissociation energy, since the bad behavior of the RKR method for high vibrational levels propagates error into the Morse fitting algorithm.
This graph simply compares the computed Morse potential, RKR raw data, and smoothed RKR data. As can be seen, the three are in great agreement near the bottom of the well, with increasing deviance moving away from the equilibrium internuclear distance.
To get an idea of how accurate the program is in generating the ground potential energy curve for carbon monoxide with the parameters discussed above (keeping in mind that the accuracy of the program is reduced by the large value of 'space'), here are its outputs compared against the National Institute of Standards and Technology accepted values.
ZERO-POINT ENERGY
NIST: 1081.59 cm^-1
THIS WORK: 1081.7816 cm^-1
PERCENT ERROR: 0.0177
EQUILIBRIUM DISTANCE
NIST: 1.128322 Angstrom
THIS WORK: 1.1282 Angstrom
PERCENT ERROR: 0.0108
BOND FORCE CONSTANT
NIST: 19.0179 x 10^5 dyn/cm
THIS WORK: 18.37308 x 10^5 dyn/cm
PERCENT ERROR: 3.664
DISSOCIATION ENERGY
NIST: 90542 cm^-1
THIS WORK: 93760.2636 cm^-1
PERCENT ERROR: 3.554