Author: bugman Date: Thu Dec 8 09:46:24 2011 New Revision: 15054 URL: http://svn.gna.org/viewcvs/relax?rev=15054&view=rev Log: Shifted the multiplication by the PCS constant outside of the numerical integration. This multiplication now only happens N times per function call, where N is the number of spins with PCS values, rather than N times hundreds of thousands. Modified: branches/frame_order_testing/maths_fns/frame_order_matrix_ops.py Modified: branches/frame_order_testing/maths_fns/frame_order_matrix_ops.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/maths_fns/frame_order_matrix_ops.py?rev=15054&r1=15053&r2=15054&view=diff ============================================================================== --- branches/frame_order_testing/maths_fns/frame_order_matrix_ops.py (original) +++ branches/frame_order_testing/maths_fns/frame_order_matrix_ops.py Thu Dec 8 09:46:24 2011 @@ -1329,22 +1329,20 @@ Ri_prime[2, 2] = 1.0 # Perform numerical integration. - result = quad(pcs_pivot_motion_rotor, -sigma_max, sigma_max, args=(c, r_pivot_atom, r_ln_pivot, A, R_eigen, RT_eigen, Ri_prime)) + result = quad(pcs_pivot_motion_rotor, -sigma_max, sigma_max, args=(r_pivot_atom, r_ln_pivot, A, R_eigen, RT_eigen, Ri_prime)) # The surface area normalisation factor. SA = 2.0 * sigma_max # Return the value. - return result[0] / SA - - -def pcs_pivot_motion_rotor(sigma_i, c, r_pivot_atom, r_ln_pivot, A, R_eigen, RT_eigen, Ri_prime): + return c * result[0] / SA + + +def pcs_pivot_motion_rotor(sigma_i, r_pivot_atom, r_ln_pivot, A, R_eigen, RT_eigen, Ri_prime): """Calculate the PCS value after a pivoted motion for the rotor model. @param sigma_i: The rotor angle for state i. @type sigma_i: float - @param c: The PCS constant (without the interatomic distance and in Angstrom units). - @type c: float @param r_pivot_atom: The pivot point to atom vector. @type r_pivot_atom: numpy rank-1, 3D array @param r_ln_pivot: The lanthanide position to pivot point vector. @@ -1382,9 +1380,9 @@ proj = dot(vect, dot(A, vect)) # The PCS. - pcs = c / length**5 * proj - - # Return the value. + pcs = proj / length**5 + + # Return the PCS value (without the PCS constant). return pcs