You are on page 1of 13

Mathematica: Lennard Jones

Define a Lennard-Jones potential function: note


the underscore after the variables and parameters
on the left-hand side and the :=
Plot the Lennard-Jones potential for r values
ranging from 0.2 to 1.0
Manipulate allows us to vary the parameters
epsilon and sigma to see their effect
The parameter sigma controls the
position (r –value) of the minimum

The parameter epsilon controls the


depth of the minimum (its y axis value).
Because the scale of the graph also
continuously changes, this effect is
difficult to see.
Fixing the range using PlotRange

I did not type an → rather I typed -> and it got


converted into an arrow
Mathematica (as a symbolic manipulation
program) can be used to take a derivative
We can plot and manipulate the Output of
taking the derivative
Comparing plots
Just confirming that when the original function had a negative slope,
the derivative function is negative and when the original function
has a positive slope the derivative is positive
Solving when the derivation equals 0 –
finding the minimum
N[%] – N[] means get the numerical value
and % refers to the previous item
Note of the six solutions , the
first is negative, and the last
four are complex – note the i
(square root of -1). So if r
corresponds to the distance
between two particles, then
only the second solution r 
1.12245 sig) makes sense
We can select out the one desired solution
Now that we know the location of the minimum
(its x value) we can determine its y value by
substituting the previous result into the function
In conclusion
• We have seen that the Lennard-
Jones potential function is a
minimum at r = 1.12246 σ and
that the function is equal to – ε
at that minimum

You might also like