mailr11445 - /1.3/maths_fns/order_parameters.py


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

Header


Content

Posted by edward on August 09, 2010 - 14:09:
Author: bugman
Date: Mon Aug  9 14:09:47 2010
New Revision: 11445

URL: http://svn.gna.org/viewcvs/relax?rev=11445&view=rev
Log:
Properly implemented order_parameters.iso_cone_S_to_theta().

The previous order_parameters.iso_cone_S_to_cos_theta() function did nothing.


Modified:
    1.3/maths_fns/order_parameters.py

Modified: 1.3/maths_fns/order_parameters.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/maths_fns/order_parameters.py?rev=11445&r1=11444&r2=11445&view=diff
==============================================================================
--- 1.3/maths_fns/order_parameters.py (original)
+++ 1.3/maths_fns/order_parameters.py Mon Aug  9 14:09:47 2010
@@ -24,7 +24,7 @@
 """Module for the conversion of order parameters to specific model 
parameters and vice versa."""
 
 # Python module imports.
-from math import cos
+from math import acos, cos, sqrt
 
 
 def iso_cone_theta_to_S(theta):
@@ -33,6 +33,7 @@
     This uses Woessner's diffusion in a cone order parameter defined as::
 
         S = 1/2 (1 + cos(theta)) * cos(theta)
+
 
     @param theta:   The isotropic cone angle.
     @type theta:    float
@@ -47,8 +48,19 @@
     return S
 
 
-def iso_cone_S_to_cos_theta(S):
-    """Convert the isotropic cone order parameter S into the cosine of the 
cone angle.
+def iso_cone_S_to_theta(S):
+    """Convert the isotropic cone order parameter S into the cone angle.
+
+    This uses Woessner's diffusion in a cone order parameter defined as::
+
+        S = 1/2 (1 + cos(theta)) * cos(theta)
+
+    The conversion equation is::
+
+        theta = acos((sqrt(8.0*S + 1) - 1)/2)
+
+    Hence the cone angle is only between 0 and 2pi/3, as the order parameter 
for higher cone angles is ambiguous.
+
 
     @param S:   The order parameter value (not squared).
     @type S:    float
@@ -57,7 +69,7 @@
     """
 
     # Convert.
-    cos_theta = S
+    theta = acos(0.5*(sqrt(8.0*S + 1) - 1))
 
-    # Return cos(theta).
-    return cos_theta
+    # Return theta.
+    return theta




Related Messages


Powered by MHonArc, Updated Mon Aug 09 14:20:01 2010