% Calculates the Lennard Jones energy between 2 identical particles separated by a distance r.
% Includes the effect of the cutoff radius rc. Does not include a correction for the tail.
function LJE = LJEnergy(r, energy_cutoff);
r6 = r^6;
dE = 4/(r6*r6) - 4/r6 + energy_cutoff;
LJE = dE;