Author: bugman Date: Mon Jun 10 15:39:03 2013 New Revision: 20012 URL: http://svn.gna.org/viewcvs/relax?rev=20012&view=rev Log: Added the support for the pA.dw^2 parameter 'padw2' to the dispersion specific analysis. This is needed for the Ishima and Torchia 1999 2-site model for all timescales with pA >> pB. This commit follows step 5 of the relaxation dispersion model addition tutorial (http://thread.gmane.org/gmane.science.nmr.relax.devel/3907). Modified: branches/relax_disp/specific_analyses/relax_disp/__init__.py branches/relax_disp/specific_analyses/relax_disp/parameters.py Modified: branches/relax_disp/specific_analyses/relax_disp/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/__init__.py?rev=20012&r1=20011&r2=20012&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/__init__.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/__init__.py Mon Jun 10 15:39:03 2013 @@ -97,6 +97,7 @@ self.PARAMS.add('pA', scope='spin', default=0.5, desc='The population for state A', set='params', py_type=float, grace_string='\\qp\\sA\\N\\Q', err=True, sim=True) self.PARAMS.add('pB', scope='spin', default=0.5, desc='The population for state B', set='params', py_type=float, grace_string='\\qp\\sB\\N\\Q', err=True, sim=True) self.PARAMS.add('phi_ex', scope='spin', default=5.0, desc='The phi_ex = pA.pB.dw**2 value (ppm^2)', set='params', py_type=float, grace_string='\\xF\\B\\sex\\N = \\q p\\sA\\N.p\\sB\\N.\\xDw\\B\\S2\\N\\Q (ppm\\S2\\N)', err=True, sim=True) + self.PARAMS.add('padw2', scope='spin', default=1.0, desc='The pA.dw**2 value (ppm^2)', set='params', py_type=float, grace_string='\\qp\\sA\\N.\\xDw\\B\\S2\\N\\Q (ppm\\S2\\N)', err=True, sim=True) self.PARAMS.add('dw', scope='spin', default=0.0, desc='The chemical shift difference between states A and B (in ppm)', set='params', py_type=float, grace_string='\\q\\xDw\f{}\\Q (ppm)', err=True, sim=True) self.PARAMS.add('kex', scope='spin', default=10000.0, desc='The exchange rate', set='params', py_type=float, grace_string='\\qk\\sex\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) self.PARAMS.add('r2a', scope='spin', default=15.0, desc='The transversal relaxation rate for state A', set='params', py_type=float, grace_string='\\qR\\s2,A\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) @@ -385,8 +386,8 @@ lower.append(1.0) upper.append(40.0) - # The pA.pB.dw**2 parameter. - elif spin.params[i] == 'phi_ex': + # The pA.pB.dw**2 and pA.dw**2 parameters. + elif spin.params[i] in ['phi_ex', 'padw2']: lower.append(0.0) upper.append(10.0) @@ -1571,6 +1572,7 @@ _table.add_row(["Population of state A", "'pA'"]) _table.add_row(["Population of state B", "'pB'"]) _table.add_row(["The pA.pB.dw**2 parameter (ppm^2)", "'phi_ex'"]) + _table.add_row(["The pA.dw**2 parameter (ppm^2)", "'padw2'"]) _table.add_row(["Chemical shift difference between states A and B (ppm)", "'dw'"]) _table.add_row(["Exchange rate (rad/s)", "'kex'"]) _table.add_row(["Exchange rate from state A to state B (rad/s)", "'ka'"]) Modified: branches/relax_disp/specific_analyses/relax_disp/parameters.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/parameters.py?rev=20012&r1=20011&r2=20012&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/parameters.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/parameters.py Mon Jun 10 15:39:03 2013 @@ -136,8 +136,8 @@ if param_name == 'r2': scaling_matrix[param_index, param_index] = 10 - # The pA.pB.dw**2 parameter. - elif param_name == 'phi_ex': + # The pA.pB.dw**2 and pA.dw**2 parameters. + elif param_name in ['phi_ex', 'padw2']: scaling_matrix[param_index, param_index] = 1 # Chemical shift difference between states A and B scaling. @@ -254,6 +254,7 @@ pB <= pA <= 1 pA >= 0.85 (the skewed condition, pA >> pB) phi_ex >= 0 + padw2 >= 0 dw >= 0 kex >= 0 kA >= 0 @@ -277,6 +278,8 @@ | 1 0 0 | | pA | | 0.85 | | | | | | | | 1 0 0 | | phi_ex | | 0 | + | | | | | | + | 1 0 0 | | padw2 | | 0 | | | | | | | | 1 0 0 | | dw | | 0 | | | | | | | @@ -327,8 +330,8 @@ b.append(-200.0 / scaling_matrix[param_index, param_index]) j += 2 - # The pA.pB.dw**2 parameter (phi_ex >= 0). - elif param_name == 'phi_ex': + # The pA.pB.dw**2 and pA.dw**2 parameters (phi_ex >= 0 and padw2 >= 0). + elif param_name in ['phi_ex', 'padw2']: A.append(zero_array * 0.0) A[j][param_index] = 1.0 b.append(0.0) @@ -429,19 +432,22 @@ # Yield the data. yield 'r2', param_index, spin_index, frq_index - # Then the chemical shift difference parameters 'phi_ex' and 'dw' (one per spin). + # Then the chemical shift difference parameters 'phi_ex', 'padw2' and 'dw' (one per spin). for spin_index in range(len(spins)): # Yield the data. if 'phi_ex' in spins[spin_index].params: param_index += 1 yield 'phi_ex', param_index, spin_index, None + if 'padw2' in spins[spin_index].params: + param_index += 1 + yield 'padw2', param_index, spin_index, None if 'dw' in spins[spin_index].params: param_index += 1 yield 'dw', param_index, spin_index, None # All other parameters (one per spin cluster). for param in spins[0].params: - if not param in ['r2', 'phi_ex', 'dw']: + if not param in ['r2', 'phi_ex', 'padw2', 'dw']: param_index += 1 yield param, param_index, None, None @@ -490,7 +496,7 @@ raise RelaxError("The number of parameters for each spin in the cluster are not the same.") # Count the number of spin specific parameters for all spins. - spin_params = ['r2', 'phi_ex', 'dw'] + spin_params = ['r2', 'phi_ex', 'padw2', 'dw'] num = 0 for spin in spins: for i in range(len(spin.params)):