3 Models the FENE potential, which is given by
4 \f[ V_{\textrm{FENE}}(r) = - 0.5 K R^2 \log (1 - (\frac{r - l_0}{R})^2) \f]
12 Throws if `K`, `l_0`, or `R` are neither `int` nor `float`.
14 Throws if `R` is `0` or negative.
17 The \f$ K \f$ potential parameter.
19 The \f$ l_0 \f$ potential parameter.
21 The \f$ R \f$ potential parameter, which must be positive.
24 for var
in [K, l_0, R]:
25 if not isinstance(var, (int, float)):
33 self.
_l_0 = float(l_0)
39 Returns the \f$ K \f$ potential parameter as a `float`.
47 Returns the \f$ l_0 \f$ potential parameter as a `float`.
55 Returns the \f$ R \f$ potential parameter as a `float`.
63 Returns the potential for an input value of \f$ r \f$.
66 Throws if `r` is neither `int` nor `float` or `Vector3DReal`.
68 Throws if `r` is negative.
70 Throws if `r` is such that, in combination with the used
71 potential parameters, the result is undefined.
74 The input value. It may be either an `int` or `float`, in
75 which case it must be non-negative. Alternatively, it may be
76 of type `Vector3DReal`, which is then euqivalent to calling
77 `getPotential(r.getLength())` instead.
81 if isinstance(r, Vector3DReal):
84 if not isinstance(r, (int, float)):
90 prefactor = -0.5 * self.
getK() * R * R
99 return prefactor * math.log(1 - frac2)