Author: bugman Date: Fri Jul 25 11:47:49 2008 New Revision: 6970 URL: http://svn.gna.org/viewcvs/relax?rev=6970&view=rev Log: Wrote the dipolar_constant() function for calculating the dipolar constant. The constant is defined as: mu0 gI.gS.h_bar d = - --- ----------- 4pi r**3 Modified: branches/rdc_analysis/physical_constants.py Modified: branches/rdc_analysis/physical_constants.py URL: http://svn.gna.org/viewcvs/relax/branches/rdc_analysis/physical_constants.py?rev=6970&r1=6969&r2=6970&view=diff ============================================================================== --- branches/rdc_analysis/physical_constants.py (original) +++ branches/rdc_analysis/physical_constants.py Fri Jul 25 11:47:49 2008 @@ -52,6 +52,37 @@ NH_BOND_LENGTH = 1.02 * 1e-10 """The length of the NH bond (default value).""" + + +# The dipolar constant. +####################### + +def dipolar_constant(gx, gh, r): + """Calculate the dipolar constant. + + The dipolar constant is defined as:: + + mu0 gI.gS.h_bar + d = - --- ----------- , + 4pi r**3 + + where: + - mu0 is the permeability of free space, + - gI and gS are the gyromagnetic ratios of the I and S spins, + - h_bar is Dirac's constant which is equal to Planck's constant divided by 2pi, + - r is the distance between the two spins. + + + @param gx: The gyromagnetic ratio of the heteronucleus (or first spin). + @type gx: float + @param gh: The gyromagnetic ratio of the proton (or second spin). + @type gh: float + @param r: The distance between the two nuclei. + @type r: float + """ + + # Calculate and return the value. + return - mu0 / (4.0*pi) * gx * gh * h_bar / r**3 # Gyromagnetic ratios.