Author: tlinnet Date: Mon May 5 20:19:02 2014 New Revision: 22988 URL: http://svn.gna.org/viewcvs/relax?rev=22988&view=rev Log: Speed-up, by removing repetitive calculations of g3**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=22988&r1=22987&r2=22988&view=diff ============================================================================== --- trunk/lib/dispersion/b14.py (original) +++ trunk/lib/dispersion/b14.py Mon May 5 20:19:02 2014 @@ -151,14 +151,18 @@ g3 = 1/sqrt(2) * sqrt(g2 + sqrt(g1**2 + g2**2)) #trig faster than square roots g4 = 1/sqrt(2) * sqrt(-g2 + sqrt(g1**2 + g2**2)) #trig faster than square roots ######################################################################### + # Repetitive calculations (to speed up calculations). + g32 = g3**2 + + #Time independent factors. #N = oG + oE. N = complex(g3, g4) - NNc = g3**2 + g4**2 + NNc = g32 + g4**2 # f0. - f0 = (dw2 + g3**2) / NNc + f0 = (dw2 + g32) / NNc # f2. f2 = (dw2 - g4**2) / NNc