Author: tlinnet Date: Mon May 5 20:18:47 2014 New Revision: 22980 URL: http://svn.gna.org/viewcvs/relax?rev=22980&view=rev Log: Pretty up code, removing multiple "(" and ")". 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=22980&r1=22979&r2=22980&view=diff ============================================================================== --- trunk/lib/dispersion/b14.py (original) +++ trunk/lib/dispersion/b14.py Mon May 5 20:18:47 2014 @@ -157,7 +157,7 @@ #N = oG + oE. N = complex(kge + g3 - kge, g4) - NNc = (g3**2 + g4**2) + NNc = g3**2 + g4**2 # f0. f0 = (dw**2 + g3**2) / NNc @@ -168,13 +168,13 @@ # t1 = (-dw + g4) * (complex(-dw, -g3)) / NNc #t1. # t2. - t2 = (dw + g4) * (complex(dw, -g3)) / NNc + t2 = (dw + g4) * complex(dw, -g3) / NNc # t1 + t2. - t1pt2 = complex(2 * dw**2,g1)/ NNc + t1pt2 = complex(2 * dw**2,g1) / NNc # -2 * oG * t2. - oGt2 = complex((-alpha_m - g3), (dw - g4)) * t2 + oGt2 = complex(-alpha_m - g3, dw - g4) * t2 # -1/Trel * log(LpreDyn). Rpre = (r20a + r20b + kex) / 2.0 @@ -187,13 +187,13 @@ E2 = 2.0 * tcp * g4 # Mixed term (complex) (E0 - iE2)/2. - E1 = (complex(g3, -g4)) * tcp + E1 = complex(g3, -g4) * tcp # Real. - ex0b = (f0 * cosh(E0) - f2 * cos(E2)) + ex0b = f0 * cosh(E0) - f2 * cos(E2) # Complex. - ex0c = (f0 * sinh(E0) - f2 * sin(E2) * complex(0, 1.0)) + ex0c = f0 * sinh(E0) - f2 * sin(E2) * complex(0, 1.0) # Complex. ex1c = sinh(E1) @@ -201,14 +201,15 @@ # Exact result for v2v3. v3 = sqrt(ex0b**2 - 1) - y = power((ex0b - v3) / (ex0b + v3), ncyc) + y = power( (ex0b - v3) / (ex0b + v3), ncyc) # Off diagonal common factor. sinh fuctions. - v2pPdN = (( complex(-deltaR2 + kex, dw) ) * ex0c + (-oGt2 - kge * t1pt2) * 2 * ex1c) - Tog = (((1 + y)/2 + (1 - y)/(2 * v3) * v2pPdN / N)) + v2pPdN = complex(-deltaR2 + kex, dw) * ex0c + (-oGt2 - kge * t1pt2) * 2 * ex1c + + Tog = (1 + y) / 2 + (1 - y) / (2 * v3) * v2pPdN / N # Estimate R2eff. - Minty = Rpre - ncyc/(Trel) * arccosh((ex0b).real) - 1/Trel * log((Tog.real)) + Minty = Rpre - ncyc/Trel * arccosh(ex0b.real) - 1/Trel * log(Tog.real) # Loop over the time points, back calculating the R2eff values. for i in range(num_points):