mailr14853 - /1.3/maths_fns/n_state_model.py


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

Header


Content

Posted by edward on October 12, 2011 - 17:59:
Author: bugman
Date: Wed Oct 12 17:59:41 2011
New Revision: 14853

URL: http://svn.gna.org/viewcvs/relax?rev=14853&view=rev
Log:
Reverted r14849 as this was not the correct solution to the problem!

The command used was:
svn merge -r14849:r14848 .

.....
  r14849 | bugman | 2011-10-12 17:40:47 +0200 (Wed, 12 Oct 2011) | 5 lines
  Changed paths:
     M /1.3/maths_fns/n_state_model.py
  
  Yet another fix for the N-state model target functions.
  
  The Ln3+ optimisation with the tensors fixed was resulting in a chi2 value 
of 0 at all times!
.....


Modified:
    1.3/maths_fns/n_state_model.py

Modified: 1.3/maths_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/maths_fns/n_state_model.py?rev=14853&r1=14852&r2=14853&view=diff
==============================================================================
--- 1.3/maths_fns/n_state_model.py (original)
+++ 1.3/maths_fns/n_state_model.py Wed Oct 12 17:59:41 2011
@@ -633,7 +633,6 @@
             # Create tensor i from the parameters.
             if not self.fixed_tensors[i]:
                 to_tensor(self.A[i], params[5*index:5*index + 5])
-                index += 1
 
             # Loop over the spin systems j.
             for j in xrange(self.num_spins):
@@ -649,6 +648,10 @@
                     if not self.missing_deltaij[i, j]:
                         self.deltaij_theta[i, j] = 
ave_pcs_tensor(self.pcs_const[i, j], self.paramag_unit_vect[j], self.N, 
self.A[i], weights=self.probs)
 
+            # Skip the rest if the tensor is fixed.
+            if self.fixed_tensors[i]:
+                continue
+
             # Calculate and sum the single alignment chi-squared value (for 
the RDC).
             if self.rdc_flag:
                 chi2_sum = chi2_sum + chi2(self.Dij[i], self.Dij_theta[i], 
self.rdc_sigma_ij[i])
@@ -656,6 +659,9 @@
             # Calculate and sum the single alignment chi-squared value (for 
the PCS).
             if self.pcs_flag:
                 chi2_sum = chi2_sum + chi2(self.deltaij[i], 
self.deltaij_theta[i], self.pcs_sigma_ij[i])
+
+            # Increment the index.
+            index += 1
 
         # Return the chi-squared value.
         return chi2_sum
@@ -828,7 +834,6 @@
             # Create tensor i from the parameters.
             if not self.fixed_tensors[i]:
                 to_tensor(self.A[i], params[5*index:5*index + 5])
-                index += 1
 
             # Loop over the spin systems j.
             for j in xrange(self.num_spins):
@@ -844,6 +849,10 @@
                     if not self.missing_deltaij[i, j]:
                         self.deltaij_theta[i, j] = 
ave_pcs_tensor(self.pcs_const[i, j], self.paramag_unit_vect[j], self.N, 
self.A[i], weights=self.probs)
 
+            # Skip the rest if the tensor is fixed.
+            if self.fixed_tensors[i]:
+                continue
+
             # Calculate and sum the single alignment chi-squared value (for 
the RDC).
             if self.rdc_flag:
                 chi2_sum = chi2_sum + chi2(self.Dij[i], self.Dij_theta[i], 
self.rdc_sigma_ij[i])
@@ -851,6 +860,9 @@
             # Calculate and sum the single alignment chi-squared value (for 
the PCS).
             if self.pcs_flag:
                 chi2_sum = chi2_sum + chi2(self.deltaij[i], 
self.deltaij_theta[i], self.pcs_sigma_ij[i])
+
+            # Increment the index.
+            index += 1
 
         # Return the chi-squared value.
         return chi2_sum




Related Messages


Powered by MHonArc, Updated Wed Oct 12 18:20:02 2011