Author: bugman Date: Fri Jul 12 11:56:23 2013 New Revision: 20280 URL: http://svn.gna.org/viewcvs/relax?rev=20280&view=rev Log: Added support for the R2B parameter as required by the 'NS 2-site star' model. This is the model of the numerical solution for the 2-site Bloch-McConnell equations using complex conjugate matrices. 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/api.py branches/relax_disp/specific_analyses/relax_disp/parameters.py Modified: branches/relax_disp/specific_analyses/relax_disp/api.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/api.py?rev=20280&r1=20279&r2=20280&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/api.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/api.py Fri Jul 12 11:56:23 2013 @@ -89,7 +89,8 @@ 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('tex', scope='spin', default=1.0/20000.0, desc='The time of exchange (tex = 1/(2kex))', set='params', py_type=float, grace_string='\\q\\xt\\B\\sex\\N\\Q (s.rad\\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) + self.PARAMS.add('r2a', scope='spin', default=15.0, desc='The transversal relaxation rate for state A in the absence of exchange', set='params', py_type=float, grace_string='\\qR\\s2,A\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) + self.PARAMS.add('r2b', scope='spin', default=15.0, desc='The transversal relaxation rate for state B in the absence of exchange', set='params', py_type=float, grace_string='\\qR\\s2,B\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) self.PARAMS.add('ka', scope='spin', default=10000.0, desc='The exchange rate from state A to state B', set='params', py_type=float, grace_string='\\qk\\sA\\N\\Q (rad.s\\S-1\\N)', err=True, sim=True) self.PARAMS.add('params', scope='spin', desc='The model parameters', py_type=list) @@ -371,7 +372,7 @@ for spin in spins: for i in range(len(spin.params)): # R2 relaxation rates (from 1 to 40 s^-1). - if spin.params[i] == 'r2': + if spin.params[i] in ['r2', 'r2a', 'r2b']: lower.append(1.0) upper.append(40.0) @@ -388,11 +389,6 @@ # The cluster specific parameters (only use the values from the first spin of the cluster). spin = spins[0] for i in range(len(spin.params)): - # R2 relaxation rates (from 1 to 40 s^-1). - if spin.params[i] == 'r2a': - lower.append(1.0) - upper.append(40.0) - # The population of state A. elif spin.params[i] == 'pA': if spin.model == MODEL_M61B: @@ -1329,6 +1325,7 @@ _table.add_headings(["Data type", "Object name"]) _table.add_row(["Transversal relaxation rate (rad/s)", "'r2'"]) _table.add_row(["Transversal relaxation rate for state A (rad/s)", "'r2a'"]) + _table.add_row(["Transversal relaxation rate for state B (rad/s)", "'r2b'"]) _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'"]) 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=20280&r1=20279&r2=20280&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp/parameters.py (original) +++ branches/relax_disp/specific_analyses/relax_disp/parameters.py Fri Jul 12 11:56:23 2013 @@ -92,7 +92,7 @@ # Loop over the parameters of the cluster. for param_name, param_index, spin_index, frq_index in loop_parameters(spins=spins): # Transversal relaxation rate scaling. - if param_name == 'r2': + if param_name in ['r2', 'r2a', 'r2b']: scaling_matrix[param_index, param_index] = 10 # The pA.pB.dw**2 and pA.dw**2 parameters. @@ -102,10 +102,6 @@ # Chemical shift difference between states A and B scaling. elif param_name == 'dw': scaling_matrix[param_index, param_index] = 1 - - # Transversal relaxation rate scaling. - elif param_name == 'r2a': - scaling_matrix[param_index, param_index] = 10 # The population of state A. elif param_name == 'pA': @@ -228,9 +224,9 @@ The different constraints used within different models are:: - R2 >= 0 - R2 <= -200 - R2A >= 0 + 0 <= R2 <= 200 + 0 <= R2A <= 200 + 0 <= R2B <= 200 pB <= pA <= 1 pA >= 0.85 (the skewed condition, pA >> pB) phi_ex >= 0 @@ -252,12 +248,18 @@ | | | | | | | 1 0 0 | | R2A | | 0 | | | | | | | + |-1 0 0 | | R2A | | -200 | + | | | | | | + | 1 0 0 | | R2B | | 0 | + | | | | | | + |-1 0 0 | | R2B | | -200 | + | | | | | | | 1 0 0 | | pA | | 0.5 | | | | | | | - |-1 0 0 | | pA | | -1 | + |-1 0 0 | . | pA | >= | -1 | | | | | | | | 1 0 0 | | pA | | 0.85 | - | | . | | >= | | + | | | | | | | 1 0 0 | | phi_ex | | 0 | | | | | | | | 1 0 0 | | padw2 | | 0 | @@ -304,7 +306,7 @@ j += 1 # The transversal relaxation rates (0 <= r2 <= 200). - elif param_name == 'r2': + elif param_name in ['r2', 'r2a', 'r2b']: A.append(zero_array * 0.0) A.append(zero_array * 0.0) A[j][param_index] = 1.0 @@ -326,16 +328,6 @@ A[j][param_index] = 1.0 b.append(0.0) j += 1 - - # The transversal relaxation rates (0 <= r2 <= 200). - elif param_name == 'r2a': - A.append(zero_array * 0.0) - A.append(zero_array * 0.0) - A[j][param_index] = 1.0 - A[j+1][param_index] = -1.0 - b.append(0.0) - b.append(-200.0 / scaling_matrix[param_index, param_index]) - j += 2 # The population of state A. elif param_name == 'pA':