Package lib :: Package frame_order :: Module iso_cone_free_rotor
[hide private]
[frames] | no frames]

Source Code for Module lib.frame_order.iso_cone_free_rotor

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2009-2013 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 6  #                                                                             # 
 7  # This program is free software: you can redistribute it and/or modify        # 
 8  # it under the terms of the GNU General Public License as published by        # 
 9  # the Free Software Foundation, either version 3 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # This program is distributed in the hope that it will be useful,             # 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
15  # GNU General Public License for more details.                                # 
16  #                                                                             # 
17  # You should have received a copy of the GNU General Public License           # 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.       # 
19  #                                                                             # 
20  ############################################################################### 
21   
22  # Module docstring. 
23  """Module for the handling of Frame Order.""" 
24   
25  # Python module imports. 
26  from math import cos 
27   
28  # relax module imports. 
29  from lib.order import order_parameters 
30  from lib.frame_order.matrix_ops import rotate_daeg 
31   
32   
33 -def compile_2nd_matrix_iso_cone_free_rotor(matrix, Rx2_eigen, s1):
34 """Generate the rotated 2nd degree Frame Order matrix for the free rotor isotropic cone. 35 36 The cone axis is assumed to be parallel to the z-axis in the eigenframe. In this model, the three order parameters are defined as:: 37 38 S1 = S2, 39 S3 = 0 40 41 42 @param matrix: The Frame Order matrix, 2nd degree to be populated. 43 @type matrix: numpy 9D, rank-2 array 44 @param Rx2_eigen: The Kronecker product of the eigenframe rotation matrix with itself. 45 @type Rx2_eigen: numpy 9D, rank-2 array 46 @param s1: The cone order parameter. 47 @type s1: float 48 """ 49 50 # Populate the Frame Order matrix in the eigenframe. 51 populate_2nd_eigenframe_iso_cone_free_rotor(matrix, s1) 52 53 # Rotate and return the frame order matrix. 54 return rotate_daeg(matrix, Rx2_eigen)
55 56
57 -def populate_2nd_eigenframe_iso_cone_free_rotor(matrix, s1):
58 """Populate the 2nd degree Frame Order matrix in the eigenframe for the free rotor isotropic cone. 59 60 The cone axis is assumed to be parallel to the z-axis in the eigenframe. In this model, the three order parameters are defined as:: 61 62 S1 = S2, 63 S3 = 0 64 65 This is in the Kronecker product form. 66 67 68 @param matrix: The Frame Order matrix, 2nd degree. 69 @type matrix: numpy 9D, rank-2 array 70 @param s1: The cone order parameter. 71 @type s1: float 72 """ 73 74 # Zeros. 75 for i in range(9): 76 for j in range(9): 77 matrix[i, j] = 0.0 78 79 # The c11^2, c22^2, c12^2, and c21^2 elements. 80 matrix[0, 0] = matrix[4, 4] = (s1 + 2.0) / 6.0 81 matrix[0, 4] = matrix[4, 0] = matrix[0, 0] 82 83 # The c33^2 element. 84 matrix[8, 8] = (2.0*s1 + 1.0) / 3.0 85 86 # The c13^2, c31^2, c23^2, c32^2 elements. 87 matrix[0, 8] = matrix[8, 0] = (1.0 - s1) / 3.0 88 matrix[4, 8] = matrix[8, 4] = matrix[0, 8] 89 90 # Calculate the cone angle. 91 theta = order_parameters.iso_cone_S_to_theta(s1) 92 93 # The c11.c22 and c12.c21 elements. 94 matrix[1, 1] = matrix[3, 3] = (cos(theta) + 1.0) / 4.0 95 matrix[1, 3] = matrix[3, 1] = -matrix[1, 1]
96