Author: bugman Date: Thu Aug 29 18:49:17 2013 New Revision: 20718 URL: http://svn.gna.org/viewcvs/relax?rev=20718&view=rev Log: Fixes for the DPL94 model to make it truly off-resonance. The tilt angles and R1 data are now used by the target function. Modified: branches/relax_disp/lib/dispersion/dpl94.py branches/relax_disp/target_functions/relax_disp.py Modified: branches/relax_disp/lib/dispersion/dpl94.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/dpl94.py?rev=20718&r1=20717&r2=20718&view=diff ============================================================================== --- branches/relax_disp/lib/dispersion/dpl94.py (original) +++ branches/relax_disp/lib/dispersion/dpl94.py Thu Aug 29 18:49:17 2013 @@ -29,15 +29,11 @@ The equation used is:: - phi_ex * kex - R1rho = R1rho' + sin^2(theta) * ------------------ , - kex^2 + omega_sl^2 + phi_ex * kex + R1rho = R1.cos^2(theta) + R1rho'.sin^2(theta) + sin^2(theta) * ------------------ , + kex^2 + omega_sl^2 -where R1rho' is the R1rho value in the absence of exchange equal to:: - - R1rho' = R1.cos^2(theta) + R2.sin^2(theta) , - -theta is the rotating frame tilt angle, and:: +where theta is the rotating frame tilt angle, and:: phi_ex = pA * pB * delta_omega^2 , @@ -48,7 +44,7 @@ from math import cos, pi, sin -def r1rho_DPL94(r1rho_prime=None, phi_ex=None, kex=None, theta=pi/2, R1=0.0, spin_lock_fields=None, back_calc=None, num_points=None): +def r1rho_DPL94(r1rho_prime=None, phi_ex=None, kex=None, theta=None, R1=0.0, spin_lock_fields=None, back_calc=None, num_points=None): """Calculate the R1rho values for the DPL94 model. See the module docstring for details. @@ -60,8 +56,8 @@ @type phi_ex: float @keyword kex: The kex parameter value (the exchange rate in rad/s). @type kex: float - @keyword theta: The rotating frame tilt angle. - @type theta: float + @keyword theta: The rotating frame tilt angles for each dispersion point. + @type theta: numpy rank-1 float array @keyword R1: The R1 relaxation rate. @type R1: float @keyword spin_lock_fields: The CPMG nu1 frequencies. @@ -74,14 +70,16 @@ # Repetitive calculations (to speed up calculations). kex2 = kex**2 - sin_theta2 = sin(theta)**2 - R1_R2 = R1 * cos(theta)**2 + r1rho_prime * sin(theta)**2 - - # The numerator. - numer = sin_theta2 * phi_ex * kex # Loop over the dispersion points, back calculating the R1rho values. for i in range(num_points): + # The non-Rex factors. + sin_theta2 = sin(theta[i])**2 + R1_R2 = R1 * cos(theta[i])**2 + r1rho_prime * sin_theta2 + + # The numerator. + numer = sin_theta2 * phi_ex * kex + # Catch zeros (to avoid pointless mathematical operations). if numer == 0.0: back_calc[i] = R1_R2 Modified: branches/relax_disp/target_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/target_functions/relax_disp.py?rev=20718&r1=20717&r2=20718&view=diff ============================================================================== --- branches/relax_disp/target_functions/relax_disp.py (original) +++ branches/relax_disp/target_functions/relax_disp.py Thu Aug 29 18:49:17 2013 @@ -481,7 +481,7 @@ phi_ex_scaled = phi_ex[spin_index] * self.frqs[spin_index, frq_index]**2 # Back calculate the R2eff values. - r1rho_DPL94(r1rho_prime=R20[r20_index], w=self.chemical_shifts[spin_index, frq_index], phi_ex=phi_ex_scaled, kex=kex, spin_lock_fields=self.spin_lock_nu1, back_calc=self.back_calc[spin_index, frq_index], num_points=self.num_disp_points) + r1rho_DPL94(r1rho_prime=R20[r20_index], phi_ex=phi_ex_scaled, kex=kex, theta=self.tilt_angles[spin_index, frq_index], R1=self.r1[spin_index, frq_index], spin_lock_fields=self.spin_lock_nu1, back_calc=self.back_calc[spin_index, frq_index], num_points=self.num_disp_points) # For all missing data points, set the back-calculated value to the measured values so that it has no effect on the chi-squared value. for point_index in range(self.num_disp_points):