Author: bugman Date: Fri Nov 7 15:10:57 2014 New Revision: 26445 URL: http://svn.gna.org/viewcvs/relax?rev=26445&view=rev Log: Implemented the compile_1st_matrix_double_rotor() function. This is for the lib.frame_order.double_rotor module. The function will calculate the 1st degree frame order matrix for the double_rotor model. Modified: branches/frame_order_cleanup/lib/frame_order/double_rotor.py Modified: branches/frame_order_cleanup/lib/frame_order/double_rotor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/frame_order/double_rotor.py?rev=26445&r1=26444&r2=26445&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/frame_order/double_rotor.py (original) +++ branches/frame_order_cleanup/lib/frame_order/double_rotor.py Fri Nov 7 15:10:57 2014 @@ -33,6 +33,32 @@ # relax module imports. from lib.compat import norm from lib.frame_order.matrix_ops import rotate_daeg + + +def compile_1st_matrix_double_rotor(matrix, R_eigen, smax1, smax2): + """Generate the 1st degree Frame Order matrix for the double rotor model. + + @param matrix: The Frame Order matrix, 1st degree to be populated. + @type matrix: numpy 3D, rank-2 array + @param R_eigen: The eigenframe rotation matrix. + @type R_eigen: numpy 3D, rank-2 array + @param smax1: The maximum torsion angle for the first rotor. + @type smax1: float + @param smax2: The maximum torsion angle for the second rotor. + @type smax2: float + """ + + # Repetitive trig calculations. + sinc_smax1 = sinc(smax1/pi) + sinc_smax2 = sinc(smax2/pi) + + # Numerical integration of phi of each element. + matrix[0, 0] = sinc_smax1 + matrix[1, 1] = sinc_smax2 + matrix[2, 2] = sinc_smax1 * sinc_smax2 + + # Rotate and return the frame order matrix. + return rotate_daeg(matrix, R_eigen) def compile_2nd_matrix_double_rotor(matrix, Rx2_eigen, smax1, smax2):