relentless.model.potential.RyckaertBellemansDihedral#
- class relentless.model.potential.RyckaertBellemansDihedral(types, name=None)#
Ryckaert-Bellemans dihedral potential.
\[u(\phi) = c_0 + c_1 (\cos (\phi - \pi)) + c_2 (\cos (\phi - \pi))^2 + c_3 (\cos (\phi - \pi))^3 + c_4 (\cos (\phi - \pi))^4 + c_5 (\cos (\phi - \pi))^5\]where \(\phi\) is the dihedral between four bonded particles. The potential is described in Ryckaert and Bellemans. The parameters for each type are:
Parameter
Description
c_0First fitting coefficient \(c_0\).
c_1Second fitting coefficient \(c_1\).
c_2Third fitting coefficient \(c_2\).
c_3Fourth fitting coefficient \(c_3\).
c_4Fifth fitting coefficient \(c_4\).
c_5Sixth fitting coefficient \(c_5\).
- Parameters:
- coeff#
Parameters of the potential for each type.
- Type:
Examples
Ryckaert-Bellemans Dihedral for \(\rm{CH}_2\rm{CH}_2\rm{CH}_2\rm{CH}_2\) and \(\rm{CH}_2\rm{CH}_2\rm{CH}_2\rm{CH}_3\) (van Buuren et al.):
>>> u = relentless.potential.dihedral.RyckaertBellemansDihedral(("A",)) >>> u.coeff["A"].update({ 'c0': 9.28, 'c1': 12.16, 'c2': -13.12, 'c3': -3.06, 'c4': 26.24, 'c5': -31.5 })
Methods
derivative(type_, var, phi)Evaluate derivative with respect to a variable.
energy(type_, phi)Evaluate dihedral energy.
force(type_, phi)Evaluate dihedral force.
from_file(filename[, name])Create potential from a JSON file.
from_json(data[, name])Create potential from JSON data.
save(filename)Save the potential to file as JSON data.
to_json()Export potential to a JSON-compatible dictionary.
Attributes
countnames- derivative(type_, var, phi)#
Evaluate derivative with respect to a variable.
The derivative is evaluated using the
_derivative()function for all \(u_{0,\lambda}(phi)\).The derivative will be carried out with respect to
varfor allVariableparameters. The appropriate chain rules are handled automatically. If the potential does not depend onvar, the derivative will be zero by definition.- Parameters:
- Returns:
The dihedral derivative evaluated at
phi. The return type is consistent withphi.- Return type:
- Raises:
ValueError – If any value in
phiis not between -pi and pi.TypeError – If the parameter with respect to which to take the derivative is not a
Variable.
- energy(type_, phi)#
Evaluate dihedral energy.
- force(type_, phi)#
Evaluate dihedral force.
- classmethod from_file(filename, name=None)#
Create potential from a JSON file.
It is assumed that the JSON file is compatible with the potential type.
- Parameters:
filename (str) – JSON file to load.
name (str or bool or None) – Name of the potential. If a
str,nameoverrides the value in the file. IfTrue, the name in the file is always preserved. IfFalse, the name in the file is always ignored, and a default name is created. IfNone, the value in the file is used if it is not taken and does not match the default name pattern; otherwise, a new default name is generated.
- classmethod from_json(data, name=None)#
Create potential from JSON data.
It is assumed that the data is compatible with the pair potential.
- Parameters:
data (dict) – JSON data for potential.
name (str or bool or None) – Name of the potential. If a
str,nameoverrides the value in the JSON data. IfTrue, the name in the JSON data is always preserved. IfFalse, the name in the JSON data is always ignored, and a default name is created. IfNone, the value in the JSON data is used if it is not taken and does not match the default name pattern; otherwise, a new default name is generated.