mailr23020 - /trunk/target_functions/relax_disp.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by tlinnet on May 06, 2014 - 17:28:
Author: tlinnet
Date: Tue May  6 17:28:01 2014
New Revision: 23020

URL: http://svn.gna.org/viewcvs/relax?rev=23020&view=rev
Log:
Added target function for the Baldwin (2014) 2-site exact solution model for 
all time scales, whereby the simplification R20A = R20B is assumed.

sr #3154: (https://gna.org/support/?3154) Implementation of Baldwin (2014) 
B14 model - 2-site exact solution model for all time scales.

This follows the tutorial for adding relaxation dispersion models at:
http://wiki.nmr-relax.com/Tutorial_for_adding_relaxation_dispersion_models_to_relax#The_target_function


Modified:
    trunk/target_functions/relax_disp.py

Modified: trunk/target_functions/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/target_functions/relax_disp.py?rev=23020&r1=23019&r2=23020&view=diff
==============================================================================
--- trunk/target_functions/relax_disp.py        (original)
+++ trunk/target_functions/relax_disp.py        Tue May  6 17:28:01 2014
@@ -836,6 +836,32 @@
                 raise RelaxError("The '%s' CPMG model is not compatible with 
the '%s' experiment type." % (self.model, self.exp_types[0]))
 
 
+    def func_B14(self, params):
+        """Target function for the Baldwin (2014) 2-site exact solution 
model for all time scales, whereby the simplification R20A = R20B is assumed.
+
+        This assumes that pA > pB, and hence this must be implemented as a 
constraint.
+
+
+        @param params:  The vector of parameter values.
+        @type params:   numpy rank-1 float array
+        @return:        The chi-squared value.
+        @rtype:         float
+        """
+
+        # Scaling.
+        if self.scaling_flag:
+            params = dot(params, self.scaling_matrix)
+
+        # Unpack the parameter values.
+        R20 = params[:self.end_index[0]]
+        dw = params[self.end_index[0]:self.end_index[1]]
+        pA = params[self.end_index[1]]
+        kex = params[self.end_index[1]+1]
+
+        # Calculate and return the chi-squared value.
+        return self.calc_B14_chi2(R20A=R20, R20B=R20, dw=dw, pA=pA, kex=kex)
+
+
     def func_B14_full(self, params):
         """Target function for the Baldwin (2014) 2-site exact solution 
model for all time scales.
 




Related Messages


Powered by MHonArc, Updated Tue May 06 17:40:02 2014