mailr23418 - /branches/disp_speed/lib/dispersion/b14.py


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

Header


Content

Posted by tlinnet on May 26, 2014 - 13:50:
Author: tlinnet
Date: Mon May 26 13:50:05 2014
New Revision: 23418

URL: http://svn.gna.org/viewcvs/relax?rev=23418&view=rev
Log:
Critical fix for the math domain catching of model B14.

Removed the test for kex >= 1.e5.

This catching should rather be performed on the math functions instead.

In this case, it is the cathing of sinh(), not evaluating values above 710.

Modified:
    branches/disp_speed/lib/dispersion/b14.py

Modified: branches/disp_speed/lib/dispersion/b14.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_speed/lib/dispersion/b14.py?rev=23418&r1=23417&r2=23418&view=diff
==============================================================================
--- branches/disp_speed/lib/dispersion/b14.py   (original)
+++ branches/disp_speed/lib/dispersion/b14.py   Mon May 26 13:50:05 2014
@@ -110,7 +110,7 @@
 """
 
 # Python module imports.
-from numpy import arccosh, arctan2, array, cos, cosh, isfinite, log, power, 
sin, sinh, sqrt, sum
+from numpy import arccosh, arctan2, array, cos, cosh, isfinite, log, max, 
power, sin, sinh, sqrt, sum
 
 # Repetitive calculations (to speed up calculations).
 g_fact = 1/sqrt(2)
@@ -148,7 +148,7 @@
     """
 
     # Catch parameter values that will result in no exchange, returning flat 
R2eff = R20 lines (when kex = 0.0, k_AB = 0.0).
-    if dw == 0.0 or pA == 1.0 or k_AB == 0.0 or kex >= 1.e5:
+    if dw == 0.0 or pA == 1.0 or k_AB == 0.0:
         return array([r20a]*num_points)
 
     # Repetitive calculations (to speed up calculations).
@@ -197,6 +197,11 @@
     # E0 = -2.0 * tcp * (F00R - f11R).
     E0 =  two_tcp * g3
 
+    # Catch math domain error of sinh(val > 710).
+    # This is when E0 > 710.
+    if max(E0) > 700:
+        return array([r20a]*num_points)
+
     # Derived from chemical shifts  #E2 = complex(0,-2.0 * tcp * (F00I - 
f11I)).
     E2 =  two_tcp * g4
 




Related Messages


Powered by MHonArc, Updated Mon May 26 14:40:02 2014