Author: tlinnet Date: Mon May 5 20:18:43 2014 New Revision: 22978 URL: http://svn.gna.org/viewcvs/relax?rev=22978&view=rev Log: Replaced numpy.XX functions, with just the function. 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=22978&r1=22977&r2=22978&view=diff ============================================================================== --- trunk/lib/dispersion/b14.py (original) +++ trunk/lib/dispersion/b14.py Mon May 5 20:18:43 2014 @@ -99,7 +99,7 @@ # Python module imports. import numpy -from math import cos,sin, sqrt +from numpy import arccosh, cos, cosh, log, sin, sinh, sqrt def r2eff_B14(r20a=None, r20b=None, pA=None, dw=None, kex=None, power=None, relax_time=None, tcp=None, back_calc=None, num_points=None): @@ -191,16 +191,16 @@ E1 = (complex(g3, -g4)) * tcp # Real. - ex0b = (f0 * numpy.cosh(E0) - f2 * numpy.cos(E2)) + ex0b = (f0 * cosh(E0) - f2 * cos(E2)) # Complex. - ex0c = (f0 * numpy.sinh(E0) - f2 * numpy.sin(E2) * complex(0, 1.0)) + ex0c = (f0 * sinh(E0) - f2 * sin(E2) * complex(0, 1.0)) # Complex. - ex1c = numpy.sinh(E1) + ex1c = sinh(E1) # Exact result for v2v3. - v3 = numpy.sqrt(ex0b**2 - 1) + v3 = sqrt(ex0b**2 - 1) y = numpy.power((ex0b - v3) / (ex0b + v3), ncyc) @@ -209,7 +209,7 @@ Tog = (((1 + y)/2 + (1 - y)/(2 * v3) * v2pPdN / N)) # Estimate R2eff. - Minty = Rpre - ncyc/(Trel) * numpy.arccosh((ex0b).real) - 1/Trel * numpy.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):