1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16   
17   
18   
19   
20   
21   
22   
23   
24  """The relaxation dispersion equations.""" 
25   
26   
27  from math import log, sqrt 
28   
29   
31      """Calculate the R2eff/R1rho value for the fixed relaxation time data. 
32   
33      The formula is:: 
34   
35                    -1         / I1 \  
36          R2eff = ------- * ln | -- | , 
37                  relax_T      \ I0 / 
38   
39      where relax_T is the fixed delay time, I0 is the reference peak intensity when relax_T is zero, and I1 is the peak intensity in a spectrum of interest. 
40   
41   
42      @keyword relax_time:    The fixed relaxation delay time in seconds. 
43      @type relax_time:       float 
44      @keyword I_ref:         The peak intensity in the reference spectrum. 
45      @type I_ref:            float 
46      @keyword I:             The peak intensity of interest. 
47      @type I:                float 
48      """ 
49   
50       
51      return -1.0 / relax_time * log(float(I) / I_ref) 
 52   
53   
55      """Calculate the R2eff/R1rho error for the fixed relaxation time data. 
56   
57      The formula is:: 
58   
59                                  __________________________________ 
60                        1        / / sigma_I1 \ 2     / sigma_I0 \ 2 
61          sigma_R2 = -------    /  | -------- |   +   | -------- | 
62                     relax_T  \/   \ I1(nu1)  /       \    I0    / 
63   
64      where relax_T is the fixed delay time, I0 and sigma_I0 are the reference peak intensity and error when relax_T is zero, and I1 and sigma_I1 are the peak intensity and error in the spectrum of interest. 
65   
66   
67      @keyword relax_time:    The fixed relaxation delay time in seconds. 
68      @type relax_time:       float 
69      @keyword I_ref:         The peak intensity in the reference spectrum. 
70      @type I_ref:            float 
71      @keyword I:             The peak intensity of interest. 
72      @type I:                float 
73      @keyword I_ref_err:     The peak intensity error in the reference spectrum. 
74      @type I_ref_err:        float 
75      @keyword I_err:         The peak intensity error of interest. 
76      @type I_err:            float 
77      """ 
78   
79       
80      return sqrt((I_ref_err / I_ref)**2 + (I_err / I)**2) / relax_time 
 81