mailRe: r23007 - /trunk/lib/dispersion/b14.py


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

Header


Content

Posted by Edward d'Auvergne on May 06, 2014 - 17:33:
This could also be reverted.  I hope there aren't too many more :(

Regards,

Edward


On 6 May 2014 17:23,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Tue May  6 17:23:33 2014
New Revision: 23007

URL: http://svn.gna.org/viewcvs/relax?rev=23007&view=rev
Log:
Speed-up. Made variable for the Repetitive calculations of zeta**2, and 
Psi**2.

sr #3154: (https://gna.org/support/?3154) Implementation of Baldwin (2014) 
B14 model - 2-site exact solution model for all time scales.

This follows the tutorial for adding relaxation dispersion models at:
http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#Debugging


Modified:
    trunk/lib/dispersion/b14.py

Modified: trunk/lib/dispersion/b14.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/dispersion/b14.py?rev=23007&r1=23006&r2=23007&view=diff
==============================================================================
--- trunk/lib/dispersion/b14.py (original)
+++ trunk/lib/dispersion/b14.py Tue May  6 17:23:33 2014
@@ -146,22 +146,19 @@

     # Repetitive calculations (to speed up calculations).
     dw2 = dw**2
-
-    
#########################################################################
-    ##### Baldwins code.
-    
#########################################################################
-
-    
#########################################################################
-    #get the real and imaginary components of the exchange induced shift
-    g3 = 1/sqrt(2) * sqrt(Psi + sqrt(zeta**2 + Psi**2))   #trig faster 
than square roots
-    g4 = 1/sqrt(2) * sqrt(-Psi + sqrt(zeta**2 + Psi**2))   #trig faster 
than square roots
-    
#########################################################################
+    zeta2 = zeta**2
+    Psi2 = Psi**2
+
+    # Get the real and imaginary components of the exchange induced shift.
+    g3 = 1/sqrt(2) * sqrt(Psi + sqrt(zeta2 + Psi2))
+    g4 = 1/sqrt(2) * sqrt(-Psi + sqrt(zeta2 + Psi2))
+
     # Repetitive calculations (to speed up calculations).
     g32 = g3**2
     g42 = g4**2

-    #Time independent factors.
-    #N = oG + oE.
+    # Time independent factors.
+    # N = oG + oE.
     N = complex(g3, g4)

     NNc = g32 + g42


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits



Related Messages


Powered by MHonArc, Updated Tue May 06 17:40:10 2014