Author: bugman Date: Mon Nov 18 13:26:01 2013 New Revision: 21500 URL: http://svn.gna.org/viewcvs/relax?rev=21500&view=rev Log: The r2eff_mmq_*() functions of lib.dispersion.mmq_2site now accept different R20A and R20B arguments. These are set to the same thing within the dispersion target function. Modified: branches/relax_disp/lib/dispersion/mmq_2site.py branches/relax_disp/target_functions/relax_disp.py Modified: branches/relax_disp/lib/dispersion/mmq_2site.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/dispersion/mmq_2site.py?rev=21500&r1=21499&r2=21500&view=diff ============================================================================== --- branches/relax_disp/lib/dispersion/mmq_2site.py (original) +++ branches/relax_disp/lib/dispersion/mmq_2site.py Mon Nov 18 13:26:01 2013 @@ -62,7 +62,7 @@ matrix[1, 1] = -k_BA + 1.j*dw - R20B -def r2eff_mmq_2site_mq(M0=None, m1=None, m2=None, r20=None, pA=None, pB=None, dw=None, dwH=None, k_AB=None, k_BA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, n=None): +def r2eff_mmq_2site_mq(M0=None, m1=None, m2=None, R20A=None, R20B=None, pA=None, pB=None, dw=None, dwH=None, k_AB=None, k_BA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, n=None): """The 2-site numerical solution to the Bloch-McConnell equation for MQ data. The notation used here comes from: @@ -84,8 +84,10 @@ @type m1: numpy rank-2, 2D complex64 array @keyword m2: A complex numpy matrix to be populated. @type m2: numpy rank-2, 2D complex64 array - @keyword r20: The R2 value in the absence of exchange. - @type r20: float + @keyword R20A: The transverse, spin-spin relaxation rate for state A. + @type R20A: float + @keyword R20B: The transverse, spin-spin relaxation rate for state B. + @type R20B: float @keyword pA: The population of state A. @type pA: float @keyword pB: The population of state B. @@ -111,8 +113,8 @@ """ # Populate the m1 and m2 matrices (only once per function call for speed). - populate_matrix(matrix=m1, R20A=r20, R20B=r20, dw=dw+dwH, k_AB=k_AB, k_BA=k_BA) # D+ matrix component. - populate_matrix(matrix=m2, R20A=r20, R20B=r20, dw=-dw+dwH, k_AB=k_AB, k_BA=k_BA) # Z- matrix component. + populate_matrix(matrix=m1, R20A=R20A, R20B=R20B, dw=dw+dwH, k_AB=k_AB, k_BA=k_BA) # D+ matrix component. + populate_matrix(matrix=m2, R20A=R20A, R20B=R20B, dw=-dw+dwH, k_AB=k_AB, k_BA=k_BA) # Z- matrix component. # Loop over the time points, back calculating the R2eff values. for i in range(num_points): @@ -183,7 +185,7 @@ back_calc[i]= -inv_tcpmg * log(Mx / pA) -def r2eff_mmq_2site_sq_dq_zq(M0=None, F_vector=array([1, 0], float64), m1=None, m2=None, r20=None, pA=None, pB=None, dwX=None, k_AB=None, k_BA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): +def r2eff_mmq_2site_sq_dq_zq(M0=None, F_vector=array([1, 0], float64), m1=None, m2=None, R20A=None, R20B=None, pA=None, pB=None, dwX=None, k_AB=None, k_BA=None, inv_tcpmg=None, tcp=None, back_calc=None, num_points=None, power=None): """The 2-site numerical solution to the Bloch-McConnell equation for SQ, ZQ, and DQ data. The notation used here comes from: @@ -201,8 +203,10 @@ @type m1: numpy rank-2, 2D complex64 array @keyword m2: A complex numpy matrix to be populated. @type m2: numpy rank-2, 2D complex64 array - @keyword r20: The R2 value in the absence of exchange. - @type r20: float + @keyword R20A: The transverse, spin-spin relaxation rate for state A. + @type R20A: float + @keyword R20B: The transverse, spin-spin relaxation rate for state B. + @type R20B: float @keyword pA: The population of state A. @type pA: float @keyword pB: The population of state B. @@ -226,8 +230,8 @@ """ # Populate the m1 and m2 matrices (only once per function call for speed). - populate_matrix(matrix=m1, R20A=r20, R20B=r20, dw=dwX, k_AB=k_AB, k_BA=k_BA) - populate_matrix(matrix=m2, R20A=r20, R20B=r20, dw=-dwX, k_AB=k_AB, k_BA=k_BA) + populate_matrix(matrix=m1, R20A=R20A, R20B=R20B, dw=dwX, k_AB=k_AB, k_BA=k_BA) + populate_matrix(matrix=m2, R20A=R20A, R20B=R20B, dw=-dwX, k_AB=k_AB, k_BA=k_BA) # Loop over the time points, back calculating the R2eff values. for i in range(num_points): 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=21500&r1=21499&r2=21500&view=diff ============================================================================== --- branches/relax_disp/target_functions/relax_disp.py (original) +++ branches/relax_disp/target_functions/relax_disp.py Mon Nov 18 13:26:01 2013 @@ -940,17 +940,17 @@ # Back calculate the R2eff values for each experiment type. if self.exp_types[exp_index] == EXP_TYPE_CPMG: - r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, r20=R20[r20_index], pA=pA, pB=pB, dwX=dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) + r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, R20A=R20[r20_index], R20B=R20[r20_index], pA=pA, pB=pB, dwX=dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) elif self.exp_types[exp_index] == EXP_TYPE_PROTON_SQ_CPMG: - r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, r20=R20[r20_index], pA=pA, pB=pB, dwX=dwH_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) + r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, R20A=R20[r20_index], R20B=R20[r20_index], pA=pA, pB=pB, dwX=dwH_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) elif self.exp_types[exp_index] == EXP_TYPE_DQ_CPMG: - r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, r20=R20[r20_index], pA=pA, pB=pB, dwX=dwH_frq+dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) + r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, R20A=R20[r20_index], R20B=R20[r20_index], pA=pA, pB=pB, dwX=dwH_frq+dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) elif self.exp_types[exp_index] == EXP_TYPE_ZQ_CPMG: - r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, r20=R20[r20_index], pA=pA, pB=pB, dwX=dwH_frq-dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) + r2eff_mmq_2site_sq_dq_zq(M0=self.M0, m1=self.m1, m2=self.m2, R20A=R20[r20_index], R20B=R20[r20_index], pA=pA, pB=pB, dwX=dwH_frq-dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], power=self.power[exp_index][frq_index]) elif self.exp_types[exp_index] == EXP_TYPE_MQ_CPMG: - r2eff_mmq_2site_mq(M0=self.M0, m1=self.m1, m2=self.m2, r20=R20[r20_index], pA=pA, pB=pB, dw=dw_frq, dwH=dwH_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], n=self.n[exp_index][frq_index]) + r2eff_mmq_2site_mq(M0=self.M0, m1=self.m1, m2=self.m2, R20A=R20[r20_index], R20B=R20[r20_index], pA=pA, pB=pB, dw=dw_frq, dwH=dwH_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], n=self.n[exp_index][frq_index]) elif self.exp_types[exp_index] == EXP_TYPE_PROTON_MQ_CPMG: - r2eff_mmq_2site_mq(M0=self.M0, m1=self.m1, m2=self.m2, r20=R20[r20_index], pA=pA, pB=pB, dw=dwH_frq, dwH=dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], n=self.n[exp_index][frq_index]) + r2eff_mmq_2site_mq(M0=self.M0, m1=self.m1, m2=self.m2, R20A=R20[r20_index], R20B=R20[r20_index], pA=pA, pB=pB, dw=dwH_frq, dwH=dw_frq, k_AB=k_AB, k_BA=k_BA, inv_tcpmg=self.inv_relax_time, tcp=self.tau_cpmg[exp_index][frq_index], back_calc=self.back_calc[exp_index][spin_index][frq_index], num_points=self.num_disp_points[exp_index][frq_index], n=self.n[exp_index][frq_index]) # 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[exp_index][frq_index]):