Author: bugman Date: Wed Mar 27 17:49:33 2013 New Revision: 19265 URL: http://svn.gna.org/viewcvs/relax?rev=19265&view=rev Log: Created the lib.dispersion.equations module. This is a translation of Sebastien Morin's C code in the old relax_disp branch. The old C files can be checked out with the command: svn co http://svn.gna.org/svn/relax/branches/relax_disp/maths_fns/dispersion.c@r18123 svn co http://svn.gna.org/svn/relax/branches/relax_disp/maths_fns/dispersion.h@r18123 Added: branches/relax_disp/lib/dispersion/equations.py Modified: branches/relax_disp/lib/dispersion/__init__.py Modified: branches/relax_disp/lib/dispersion/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/__init__.py?rev=19265&r1=19264&r2=19265&view=diff ============================================================================== --- branches/relax_disp/lib/dispersion/__init__.py (original) +++ branches/relax_disp/lib/dispersion/__init__.py Wed Mar 27 17:49:33 2013 @@ -23,5 +23,5 @@ """The relax-lib NMR package - a library of functions for relaxation dispersion.""" __all__ = [ - '' + 'equations' ] Added: branches/relax_disp/lib/dispersion/equations.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/equations.py?rev=19265&view=auto ============================================================================== --- branches/relax_disp/lib/dispersion/equations.py (added) +++ branches/relax_disp/lib/dispersion/equations.py Wed Mar 27 17:49:33 2013 @@ -1,0 +1,45 @@ +############################################################################### +# # +# Copyright (C) 2009 Sebastien Morin # +# Copyright (C) 2013 Edward d'Auvergne # +# # +# This file is part of the program relax (http://www.nmr-relax.com). # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see <http://www.gnu.org/licenses/>. # +# # +############################################################################### + +# Module docstring. +"""The relaxation dispersion equations.""" + +# Python module imports. +from math import tanh + + +def fast_2site(params=None, cpmg_frqs=None, back_calc=None, num_times=None): + """Back calculate the effective transversal relaxation rate (R2eff). + + The currently supported equation is that for CPMG relaxation dispersion in the fast exchange limit: + + - Millet et al., JACS, 2000, 122, 2867-2877 (equation 19) + - Kovrigin et al., J. Mag. Res., 2006, 180, 93-104 (equation 1) + + In the future, back-calculation should be available for CPMG relaxation dispersion in the slow exchange limit: + - Tollinger et al., JACS, 2001, 123, 11341-11352 (equation 2) + """ + + # Loop over the time points. + for i in range(num_times): + # Back calculate. + back_calc[i] = params[0] + params[1] * (1 - 2 * tanh(params[2] / (2 * 4 * cpmg_frqs[i])) * ((4 * cpmg_frqs[i] ) / params[2]))