Skip to content

Commit

Permalink
Updated SurvivalProbabilty docs (#4248)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclark5 authored Aug 22, 2023
1 parent 9032eb0 commit 8923c4a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 3 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The rules for this file:
* release numbers follow "Semantic Versioning" http://semver.org

------------------------------------------------------------------------------
??/??/?? IAlibay, hmacdope, pillose
??/??/?? IAlibay, hmacdope, pillose, jaclark5

* 2.7.0

Expand All @@ -23,6 +23,8 @@ Fixes
Enhancements

Changes
* Update documentation for SurvivalProbabilty to be more clear
(Issue #4247)
* Cython DEF statments have been replaced with compile time integer constants
as DEF is deprecated as of Cython>=3.0 (Issue #4237, PR #4246)

Expand Down
19 changes: 12 additions & 7 deletions package/MDAnalysis/analysis/waterdynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,17 @@ def run(self, **kwargs):

class SurvivalProbability(object):
r"""
Survival Probability (SP) gives the probability for a group of particles to remain in a certain region.
The SP is given by:
Survival Probability (SP) gives the probability for a group of particles to remain
in a certain region. The SP is given by:
.. math::
P(\tau) = \frac1T \sum_{t=1}^T \frac{N(t,t+\tau)}{N(t)}
P(\tau) = \langle \frac{ N(t, t + \tau )} { N(t) }\rangle
where :math:`T` is the maximum time of simulation, :math:`\tau` is the
timestep, :math:`N(t)` the number of particles at time :math:`t`, and
:math:`N(t, t+\tau)` is the number of particles at every frame from :math:`t` to `\tau`.
where :math:`\tau` is the timestep, :math:`N(t)` the number of particles at time
:math:`t`, and :math:`N(t, t+\tau)` is the number of particles at every frame from
:math:`t` to :math:`t + \tau`. The angular brackets represent an average over all time
origins, :math:`t`. See :func:`MDAnalysis.lib.correlations.autocorrelation` for
technical details.
Parameters
Expand All @@ -902,7 +904,8 @@ class SurvivalProbability(object):
Universe object
select : str
Selection string; any selection is allowed. With this selection you
define the region/zone where to analyze, e.g.: "resname SOL and around 5 (resid 10)". See `SP-examples`_.
define the region/zone where to analyze, e.g.: "resname SOL and around 5
(resid 10)". See `SP-examples`_.
verbose : Boolean, optional
When True, prints progress and comments to the console.
Expand All @@ -928,6 +931,8 @@ class SurvivalProbability(object):
The `stop` keyword as passed to :meth:`SurvivalProbability.run` has now
changed behaviour and will act in an `exclusive` manner (instead of it's
previous `inclusive` behaviour),
.. versionchanged:: 2.7.0
Updated docs to align with discrete autocorrelation function.
"""

def __init__(self, universe, select, verbose=False):
Expand Down

0 comments on commit 8923c4a

Please sign in to comment.