Author: bugman Date: Tue Jun 4 15:47:28 2013 New Revision: 19859 URL: http://svn.gna.org/viewcvs/relax?rev=19859&view=rev Log: Added the M61 model equations to the relax library. This is for the Meiboom 1961 2-site fast exchange model for R1rho-type experiments. Added: branches/relax_disp/lib/dispersion/m61.py - copied, changed from r19858, branches/relax_disp/lib/dispersion/lm63.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=19859&r1=19858&r2=19859&view=diff ============================================================================== --- branches/relax_disp/lib/dispersion/__init__.py (original) +++ branches/relax_disp/lib/dispersion/__init__.py Tue Jun 4 15:47:28 2013 @@ -26,4 +26,5 @@ 'cr72', 'equations', 'lm63' + 'm61' ] Copied: branches/relax_disp/lib/dispersion/m61.py (from r19858, branches/relax_disp/lib/dispersion/lm63.py) URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/m61.py?p2=branches/relax_disp/lib/dispersion/m61.py&p1=branches/relax_disp/lib/dispersion/lm63.py&r1=19858&r2=19859&rev=19859&view=diff ============================================================================== --- branches/relax_disp/lib/dispersion/lm63.py (original) +++ branches/relax_disp/lib/dispersion/m61.py Tue Jun 4 15:47:28 2013 @@ -21,41 +21,43 @@ ############################################################################### # Module docstring. -"""The Luz and Meiboom (1963) 2-site fast exchange model. +"""The Meiboom (1961) 2-site fast exchange R1rho model. -This module is for the function, gradient and Hessian of the LM63 model. The model is named after the reference: +This module is for the function, gradient and Hessian of the M61 model. The model is named after the reference: - Luz, S. and Meiboom S., (1963) Nuclear Magnetic Resonance study of protolysis of trimethylammonium ion in aqueous solution - order of reaction with respect to solvent, J. Chem. Phys. 39, 366-370 (U{DOI: 10.1063/1.1734254<http://dx.doi.org/10.1063/1.1734254>}). + Meiboom S. (1961). Nuclear magnetic resonance study of the proton transfer in water. J. Chem. Phys., 34, 375-388. (U{DOI: 10.1063/1.1700960<http://dx.doi.org/10.1063/1.1700960>}). The equation used is: - phi_ex / 4 * nu_cpmg / kex \ \ - R2eff = R20 + ------ * | 1 - ----------- * tanh | ----------- | | , - kex \ kex \ 4 * nu_cpmg / / + phi_ex * kex + R1rho = R1rho' + sin^2(theta) * ----------------- , + kex^2 + omega_e^2 -where: +where R1rho' is the R1rho value in the absence of exchange, theta is the rotating frame tilt angle, phi_ex = pA * pB * delta_omega^2 , -kex is the chemical exchange rate constant, pA and pB are the populations of states A and B, and delta_omega is the chemical shift difference between the two states. +kex is the chemical exchange rate constant, pA and pB are the populations of states A and B, delta_omega is the chemical shift difference between the two states, and omega_e is the effective field in the rotating frame. """ # Python module imports. -from math import tanh +from math import pi, sin -def r2eff_LM63(r20=None, phi_ex=None, kex=None, cpmg_frqs=None, back_calc=None, num_points=None): - """Calculate the R2eff values for the LM63 model. +def r2eff_M61(r1rho0=None, phi_ex=None, kex=None, theta=pi/2, cpmg_frqs=None, back_calc=None, num_points=None): + """Calculate the R2eff values for the M61 model. See the module docstring for details. - @keyword r20: The R20 parameter value (R2 with no exchange). - @type r20: float + @keyword r1rho0: The R1rho0 parameter value (R1rho with no exchange). + @type r1rho0: float @keyword phi_ex: The phi_ex parameter value (pA * pB * delta_omega^2). @type phi_ex: float @keyword kex: The kex parameter value (the exchange rate in rad/s). @type kex: float + @keyword theta: The rotating frame tilt angle. + @type theta: float @keyword cpmg_frqs: The CPMG nu1 frequencies. @type cpmg_frqs: numpy rank-1 float array @keyword back_calc: The array for holding the back calculated R2eff values. Each element corresponds to one of the CPMG nu1 frequencies. @@ -66,14 +68,14 @@ # Loop over the time points, back calculating the R2eff values. for i in range(num_points): - # Catch zeros. - if phi_ex == 0.0: + # Catch zeros (to avoid pointless mathematical operations). + if phi_ex == 0.0 or kex == 0.0: back_calc[i] = r20 # Avoid divide by zero. - elif kex == 0.0: + elif kex == 0.0 and cpmg_frqs[i] == 0.0: back_calc[i] = 1e100 # The full formula. else: - back_calc[i] = r20 + phi_ex / kex * (1.0 - (4.0 * cpmg_frqs[i] / kex) * tanh(kex / (4 * cpmg_frqs[i]))) + back_calc[i] = r1rho0 + sin(theta) * phi_ex * kex / (kex**2 + cpmg_frqs[i]**2)