This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,10 @@
|
||||
// LennardJonesForce: the force between two particles at distance R under
|
||||
// the Lennard-Jones potential, F(R) = -dV/dR
|
||||
// = 24 Epsilon / R (2 (Sigma / R)^12 - (Sigma / R)^6).
|
||||
// Positive pushes the particles apart; it is 0 at the bottom of the well.
|
||||
FUNCTION LennardJonesForce(R : FLOAT, Epsilon : FLOAT, Sigma : FLOAT) RETURNS FLOAT
|
||||
REQUIRE R > 0.0
|
||||
DECLARE S2 : FLOAT <- (Sigma / R) * (Sigma / R)
|
||||
DECLARE S6 : FLOAT <- S2 * S2 * S2
|
||||
RETURN 24.0 * Epsilon * (2.0 * S6 * S6 - S6) / R
|
||||
ENDFUNCTION
|
||||
Reference in new issue
Block a user