mailr24627 - /branches/disp_spin_speed/lib/dispersion/mp05.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on July 22, 2014 - 16:51:
Author: tlinnet
Date: Tue Jul 22 16:51:40 2014
New Revision: 24627

URL: http://svn.gna.org/viewcvs/relax?rev=24627&view=rev
Log:
Code validation of lib/dispersion/mp05.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/mp05.py

Modified: branches/disp_spin_speed/lib/dispersion/mp05.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/dispersion/mp05.py?rev=24627&r1=24626&r2=24627&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/dispersion/mp05.py     (original)
+++ branches/disp_spin_speed/lib/dispersion/mp05.py     Tue Jul 22 16:51:40 
2014
@@ -100,22 +100,37 @@
     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
+
+    # Larmor frequency [s^-1].
+    Wa = omega
+    Wb = omega + dw
 
     # The numerator.
     phi_ex = pA * pB * dw**2
     numer = phi_ex * kex
 
     # We assume that A resonates at 0 [s^-1], without loss of generality.
-    W = pA*Wa + pB*Wb                           # Pop-averaged Larmor 
frequency [s^-1].
-    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.
-    waeff2 = spin_lock_fields2 + da**2       # Effective field at A.
-    wbeff2 = spin_lock_fields2 + db**2       # Effective field at B.
-    weff2 = spin_lock_fields2 + d**2         # Effective field at 
pop-average.
+    # Pop-averaged Larmor frequency [s^-1].
+    W = pA*Wa + pB*Wb
+
+    # 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
+
+    # Effective field at A.
+    waeff2 = spin_lock_fields2 + da**2
+
+    # Effective field at B.
+    wbeff2 = spin_lock_fields2 + db**2
+
+    # Effective field at pop-average.
+    weff2 = spin_lock_fields2 + d**2
 
     # The rotating frame flip angle.
     theta = arctan2(spin_lock_fields, d)
@@ -137,7 +152,7 @@
 
     fact = 1.0 + 2.0*kex2*(pA*waeff2 + pB*wbeff2) / fact_denom
     denom = waeff2_wbeff2/weff2 + kex2 - sin_theta2*phi_ex*(fact)
- 
+
     # R1rho calculation.
     back_calc[:] = R1_cos_theta2 + R1rho_prime_sin_theta2 + sin_theta2 * 
numer / denom
 




Related Messages


Powered by MHonArc, Updated Tue Jul 22 17:00:02 2014