pyPRISM.potential.HardSphere module

class pyPRISM.potential.HardSphere.HardSphere(sigma=None, high_value=1000000.0)[source]

Bases: pyPRISM.potential.Potential.Potential

Simple hard sphere potential

Mathematical Definition

\[U_{\alpha,\beta}(r>\sigma_{\alpha,\beta}) = 0.0\]
\[U_{\alpha,\beta}(r\leq\sigma_{\alpha,\beta}) = C^{high}\]

Variable Definitions

\(\sigma_{\alpha,\beta}\)
Length scale of interaction between sites \(\alpha\) and \(\beta\).
\(r\)
Distance between sites.
\(C^{high}\)
High value used to approximate an infinite potential due to overlap

Description

This potential models the simiple hard-sphere fluid, in which sites have hard-core repulsion and no interactions outside their contact distance.

Example

import pyPRISM

#Define a PRISM system and set the A-B interaction potential
sys = pyPRISM.System(['A','B'],kT=1.0)
sys.domain = pyPRISM.Domain(dr=0.1,length=1024)
sys.potential['A','B'] = pyPRISM.potential.HardSphere(sigma=1.0,high_value=10**6)

Warning

If sigma is specified such that it does not fall on the solution grid of the Domain object specified in System, then the sigma will effectively be rounded. A warning should be emitted during the construction of a PRISM object if this occurs.

__init__(sigma=None, high_value=1000000.0)[source]

Constructor

Parameters:
  • sigma (float, optional) – Contact distance. If not specified, sigma will be calculated from the diameters specified in the System object.
  • high_value (float, optional) – High value used to approximate an infinite potential due to overlap
calculate(r)[source]

Calculate value of potential

r

Array of pair distances at which to calculate potential values

Type:float np.ndarray