Skip to content

Commit

Permalink
Merge pull request #63 from maximillian-dolan/master
Browse files Browse the repository at this point in the history
correcting LJ sigma epsilon energy
  • Loading branch information
arm61 authored Jun 17, 2024
2 parents 749ec02 + cce68d8 commit 04d3ef9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pylj/forcefields.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def lennard_jones_sigma_epsilon(dr, constants, force=False):
dr, -13) - (24 * constants[1] * np.power(
constants[0], 6) * np.power(dr, -7))
else:
return 4 * constants[1] * np.power(dr, -12) - (
return 4 * constants[1] * np.power(constants[0], 12) * np.power(dr, -12) - (
4 * constants[1] * np.power(constants[0], 6) * np.power(dr, -6))


Expand Down
2 changes: 1 addition & 1 deletion pylj/tests/test_forcefields.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_lennard_jones_sigma_epsilon_energy(self):
assert_almost_equal(b, [-0.015380859, 0])
c = forcefields.lennard_jones_sigma_epsilon(
[2.0, 1.0, 1.5], [0.5, 0.75])
assert_almost_equal(c, [0, 2.953125, 0.0190068])
assert_almost_equal(c, [-0.0007322, -0.0461425, -0.0041095])
d = forcefields.lennard_jones_sigma_epsilon(
[400.0, 500.0, 600.0], [5e-10, 9e-9])
assert_almost_equal(d, [0, 0, 0])
Expand Down

0 comments on commit 04d3ef9

Please sign in to comment.