MATLAB: Fitting Lennard-Jones to Morse

curve fittingCurve Fitting Toolbox

k=1.3807E-23;
D=93.4*k;
r0=4.43E-10;
alpha=1.166E10;
% These are my variables for Morse equation
r=1E-10:1E-12:1E-9;
V=D*(1-exp(-alpha*(r-r0))).^2;
plot(r,V)
axis([3.5E-10 9E-10 -1.0E-22 4.5E-21])
xlabel('Atomic Speration in meters')
ylabel('Potential Energy in Joules')
%This is the plot of the Morse Equation
I'm trying to fit this plot to Lennard-Jones(12-6). D(((r0/r)^12)-2*(r0/r)^6) is the Lennard-Jones(12-6). I want to fit it to this, but I don't know how since I don't have any coefficients.

Best Answer

First you need to make these potentials comparable - now your LJ12-6 has the dissociation-energy as the zero-level, while your Morse-potential has the minimum-energy as zero-level (which makes its dissociation energy D):
LJ12_6 = @(D,r0,E0,r)D*(((r0./r).^12)-2*(r0./r).^6)+D;
Then when you plot over all your values of r, you will see that the two potentials diverge "quite a bit" for small values, whether this is relevant or not you should think about (my understanding is that you shouldn't bother much about energies more than ~3 times (or some such small factor) the dissociation energy since that would correspond to vibrational energies way larger than a molecule can have, and correspondingly small amplitudes of the wave-function). Once you've zoomed in you will see that the potentials overlap rather well for r larger than r0 but diverge for smaller values - therefore fitting makes little sense. But you can do that fitting like this:
Morse_E = @(D,alpha,r0,r)D*(1-exp(-alpha*(r-r0))).^2
LJ12_6 = @(D,r0,r)D*(((r0./r).^12)-2*(r0./r).^6)+D
pot_diff = @(p,r) sum(( LJ12_6(p(1),p(2),r) - Morse_E(D,alpha,r0,r)).^2);
[par_LJ2,out2,out3] = fminsearch(@(p) pot_diff(p,r),[D,r0]);
plot(r,[LJ12_6(D,r0,r);Morse_E(D,alpha,r0,r);LJ12_6(par_LJ2(1),par_LJ2(2),r)])
The main problem you'll have is that the two potentials model different physical systems, Morse model vibrational states in di-atmic molecules and LJ models other interactions between atoms and molecules.
HTH
Related Question