Author: bugman Date: Wed Jan 23 16:11:51 2013 New Revision: 18269 URL: http://svn.gna.org/viewcvs/relax?rev=18269&view=rev Log: Bug fix for the N-state model optimisation of populations and paramagnetic position. The gradient from dfunc_standard() is now correctly calculated when both are optimised. Modified: trunk/maths_fns/n_state_model.py Modified: trunk/maths_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/trunk/maths_fns/n_state_model.py?rev=18269&r1=18268&r2=18269&view=diff ============================================================================== --- trunk/maths_fns/n_state_model.py (original) +++ trunk/maths_fns/n_state_model.py Wed Jan 23 16:11:51 2013 @@ -938,7 +938,13 @@ # Construct the pc partial derivative gradient components, looping over each state. if not self.probs_fixed: - for c in range(self.N - 1): + # Shift the parameter index if the paramagnetic position is optimised. + x = 0 + if not self.centre_fixed: + x = 3 + + # Loop over each state. + for c in range(self.N - 1 - x): # Index in the parameter array. param_index = self.num_align_params + c