1.0.0 • Published 6 years ago

@atomistics/lennard-jones-pairwise-js v1.0.0

Weekly downloads
-
License
Unlicense
Repository
-
Last release
6 years ago

lennard-jones-pairwise-js

Pairwise Lennard-Jones potential written in javascript.

API

const lennardJones = require('lennard-jones-pairwise-js');

const lj = lennardJones({
  depth: 1.0,
  length: 1.0,
  cutoff: undefined
});
OptionTypeDefaultDescription
depthfloat1.0The depth of the potential well.
lengthfloat1.0The distance at which the potential is the smallest value.
cutofffloatundefinedDisabled when undefined. When defined, is the distance at which the potential is forced to zero.

Returns a function that calculates the Lennard-Jones potential and force at a given distance:

const result = lj(distance);
ParameterTypeDescription
distancefloatThe distance at which to calculate the Lennard-Jones potential.

Returns an object containing the energy and force at the given distance:

NameTypeDescription
result.energyfloatThe energy of the potential at the given distance.
result.forcefloatThe force of the potential at the given distance.