mailr21091 - /branches/relax_disp/specific_analyses/relax_disp/optimisation.py


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

Header


Content

Posted by edward on October 14, 2013 - 14:32:
Author: bugman
Date: Mon Oct 14 14:32:52 2013
New Revision: 21091

URL: http://svn.gna.org/viewcvs/relax?rev=21091&view=rev
Log:
Changed the operation of the grid search for the relaxation dispersion 
analysis.

If a parameter is a simple floating number type and it already has a value, 
then the grid search
over that dimension is fixed.  The grid increments are set to 1, and the 
upper and lower bounds set
to the parameter value.  This allows parameters to be pre-set, if known from 
experiment.  They will
nevertheless be optimised via the minimise user function.


Modified:
    branches/relax_disp/specific_analyses/relax_disp/optimisation.py

Modified: branches/relax_disp/specific_analyses/relax_disp/optimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp/optimisation.py?rev=21091&r1=21090&r2=21091&view=diff
==============================================================================
--- branches/relax_disp/specific_analyses/relax_disp/optimisation.py 
(original)
+++ branches/relax_disp/specific_analyses/relax_disp/optimisation.py Mon Oct 
14 14:32:52 2013
@@ -31,6 +31,7 @@
 import sys
 
 # relax module imports.
+from lib.check_types import is_float
 from lib.errors import RelaxError
 from lib.text.sectioning import subsection
 from multi import Memo, Result_command, Slave_command
@@ -146,6 +147,23 @@
                 elif spin.params[i] in ['tex']:
                     lower.append(1/200000.0)
                     upper.append(0.5)
+
+    # Pre-set parameters.
+    index = 0
+    for spin in spins:
+        for param in spin.params:
+            # Get the parameter.
+            if hasattr(spin, param):
+                val = getattr(spin, param)
+
+                # Value already set.
+                if is_float(val) and val != 0.0:
+                    inc[index] = 1
+                    lower[index] = val
+                    upper[index] = val
+
+            # Increment the parameter index.
+            index += 1
 
     # The full grid size.
     grid_size = 1




Related Messages


Powered by MHonArc, Updated Mon Oct 14 14:40:01 2013