Author: tlinnet Date: Tue Jul 22 16:51:53 2014 New Revision: 24634 URL: http://svn.gna.org/viewcvs/relax?rev=24634&view=rev Log: Code validation of lib/dispersion/tap03.py. Task #7807 (https://gna.org/task/index.php?7807): Speed-up of dispersion models for Clustered analysis. Modified: branches/disp_spin_speed/lib/dispersion/tap03.py Modified: branches/disp_spin_speed/lib/dispersion/tap03.py URL: http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/tap03.py?rev=24634&r1=24633&r2=24634&view=diff ============================================================================== --- branches/disp_spin_speed/lib/dispersion/tap03.py (original) +++ branches/disp_spin_speed/lib/dispersion/tap03.py Tue Jul 22 16:51:53 2014 @@ -101,19 +101,28 @@ pB = 1.0 - pA # Repetitive calculations (to speed up calculations). - Wa = omega # Larmor frequency [s^-1]. - Wb = omega + dw # Larmor frequency [s^-1]. kex2 = kex**2 - W = pA*Wa + pB*Wb # Pop-averaged Larmor frequency [s^-1]. + + # Larmor frequency [s^-1]. + Wa = omega + Wb = omega + dw + + # Pop-averaged Larmor frequency [s^-1]. + W = pA*Wa + pB*Wb # The numerator. phi_ex = pA * pB * dw**2 numer = phi_ex * kex # The factors. - da = Wa - offset # Offset of spin-lock from A. - db = Wb - offset # Offset of spin-lock from B. - d = W - offset # Offset of spin-lock from pop-average. + # Offset of spin-lock from A. + da = Wa - offset + + # Offset of spin-lock from B. + db = Wb - offset + + # Offset of spin-lock from pop-average. + d = W - offset # The gamma factor. sigma = pB*da + pA*db @@ -128,9 +137,15 @@ gamma[mask_gamma_neg] = 0.0 # Special omega values. - waeff2 = gamma*spin_lock_fields2 + da**2 # Effective field at A. - wbeff2 = gamma*spin_lock_fields2 + db**2 # Effective field at B. - weff2 = gamma*spin_lock_fields2 + d**2 # Effective field at pop-average. + + # Effective field at A. + waeff2 = gamma*spin_lock_fields2 + da**2 + + # Effective field at B. + wbeff2 = gamma*spin_lock_fields2 + db**2 + + # Effective field at pop-average. + weff2 = gamma*spin_lock_fields2 + d**2 # The rotating frame flip angle. theta = arctan2(spin_lock_fields, d) @@ -150,7 +165,7 @@ # Denominator. denom = waeff2*wbeff2/weff2 + kex2 - 2.0*hat_sin_theta2*phi_ex + (1.0 - gamma)*spin_lock_fields2 - + # R1rho calculation. back_calc[:] = R1_cos_theta2 + R1rho_prime_sin_theta2 + hat_sin_theta2 * numer / denom / gamma