Package lib :: Package auto_relaxation :: Module ri_prime
[hide private]
[frames] | no frames]

Source Code for Module lib.auto_relaxation.ri_prime

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2003, 2004 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   
 23  # The transformed relaxation equations 
 24  # ==================================== 
 25  # 
 26  #    Relaxation equations 
 27  #    ==================== 
 28  # 
 29  #        R1()  =  dip_const_func . dip_Jw_R1_func  +  csa_const_func . csa_Jw_R1_func 
 30  # 
 31  # 
 32  #                 dip_const_func                      csa_const_func 
 33  #        R2()  =  -------------- . dip_Jw_R2_func  +  -------------- . csa_Jw_R2_func  +  rex_const_func 
 34  #                       2                                   6 
 35  # 
 36  # 
 37  #        sigma_noe()  =  dip_const_func . dip_Jw_sigma_noe_func 
 38  # 
 39  # 
 40  #        Ri  =  dip_comps_func . dip_jw_comps_func  +  csa_comps_func * csa_jw_comps_func  +  rex_comps_func 
 41  # 
 42  # 
 43  # 
 44  # The transformed relaxation gradients 
 45  # ==================================== 
 46  # 
 47  #    Spectral density parameter 
 48  #    ========================== 
 49  # 
 50  #        dR1() 
 51  #        -----  =  dip_const_func . dip_Jw_R1_grad  +  csa_const_func . csa_Jw_R1_grad 
 52  #         dJw 
 53  # 
 54  # 
 55  #        dR2()     dip_const_func                      csa_const_func 
 56  #        -----  =  -------------- . dip_Jw_R2_grad  +  -------------- . csa_Jw_R2_grad 
 57  #         dJw            2                                   6 
 58  # 
 59  # 
 60  #        dsigma_noe() 
 61  #        ------------  = dip_const_func . dip_Jw_sigma_noe_grad 
 62  #            dJw 
 63  # 
 64  # 
 65  #        dRi() 
 66  #        -----  =  dip_comps_func . dip_jw_comps_grad  +  csa_comps_func . csa_jw_comps_grad 
 67  #         dJw 
 68  # 
 69  # 
 70  #    Chemical exchange 
 71  #    ================= 
 72  # 
 73  #        dR1() 
 74  #        -----  =  0 
 75  #        dRex 
 76  # 
 77  # 
 78  #        dR2() 
 79  #        -----  =  rex_const_grad 
 80  #        dRex 
 81  # 
 82  # 
 83  #        dsigma_noe() 
 84  #        ------------  =  0 
 85  #           dRex 
 86  # 
 87  # 
 88  #        dRi() 
 89  #        -----  =  rex_comps_grad 
 90  #        dRex 
 91  # 
 92  # 
 93  #    Bond length 
 94  #    =========== 
 95  # 
 96  #        dR1() 
 97  #        -----  =  dip_const_grad . dip_Jw_R1_func 
 98  #         dr 
 99  # 
100  # 
101  #        dR2()     dip_const_grad 
102  #        -----  =  -------------- . dip_Jw_R2_func 
103  #         dr             2 
104  # 
105  # 
106  #        dsigma_noe() 
107  #        ------------  =  dip_const_grad . dip_Jw_sigma_noe_func 
108  #             dr 
109  # 
110  # 
111  #        dRi() 
112  #        -----  =  dip_comps_grad . dip_jw_comps_func 
113  #         dr 
114  # 
115  # 
116  #    CSA 
117  #    === 
118  # 
119  #        dR1() 
120  #        -----  =  csa_const_grad . csa_Jw_R1_func 
121  #        dcsa 
122  # 
123  # 
124  #        dR2()     csa_const_grad 
125  #        -----  =  -------------- . csa_Jw_R2_func 
126  #        dcsa            6 
127  # 
128  # 
129  #        dsigma_noe() 
130  #        ------------  =  0 
131  #            dcsa 
132  # 
133  # 
134  #        dRi() 
135  #        -----  =  csa_comps_grad . csa_jw_comps_func 
136  #        dcsa 
137  # 
138  # 
139  # 
140  # The transformed relaxation Hessians 
141  # =================================== 
142  # 
143  #    Spectral density parameter - Spectral density parameter 
144  #    ======================================================= 
145  # 
146  #          d2R1() 
147  #        ---------  =  dip_const_func . dip_Jw_R1_hess  +  csa_const_func . csa_Jw_R1_hess 
148  #        dJwi.dJwj 
149  # 
150  # 
151  #          d2R2()      dip_const_func                      csa_const_func 
152  #        ---------  =  -------------- . dip_Jw_R2_hess  +  -------------- . csa_Jw_R2_hess 
153  #        dJwi.dJwj           2                                   6 
154  # 
155  # 
156  #        d2sigma_noe() 
157  #        -------------  =  dip_const_func . dip_Jw_sigma_noe_hess 
158  #          dJwi.dJwj 
159  # 
160  # 
161  #          d2Ri() 
162  #        ---------  =  dip_comps_func . dip_jw_comps_hess  +  csa_comps_func . csa_jw_comps_hess 
163  #        dJwi.dJwj 
164  # 
165  # 
166  #    Spectral density parameter - Chemical exchange 
167  #    ============================================== 
168  # 
169  #         d2R1()               d2R2()              d2sigma_noe() 
170  #        --------  =  0   ,   --------  =  0   ,   -------------  =  0 
171  #        dJw.dRex             dJw.dRex               dJw.dRex 
172  # 
173  # 
174  #    Spectral density parameter - CSA 
175  #    ================================ 
176  # 
177  #         d2R1() 
178  #        --------  =  csa_const_grad . csa_Jw_R1_grad 
179  #        dJw.dcsa 
180  # 
181  # 
182  #         d2R2()      csa_const_grad 
183  #        --------  =  -------------- . csa_Jw_R2_grad 
184  #        dJw.dcsa           6 
185  # 
186  # 
187  #        d2sigma_noe() 
188  #        -------------  =  0 
189  #          dJw.dcsa 
190  # 
191  # 
192  #         d2Ri() 
193  #        --------  =  csa_comps_grad . csa_jw_comps_grad 
194  #        dJw.dcsa 
195  # 
196  # 
197  #    Spectral density parameter - Bond length 
198  #    ======================================== 
199  # 
200  #        d2R1() 
201  #        ------  =  dip_const_grad . dip_Jw_R1_grad 
202  #        dJw.dr 
203  # 
204  # 
205  #        d2R2()     dip_const_grad 
206  #        ------  =  -------------- . dip_Jw_R2_grad 
207  #        dJw.dr           2 
208  # 
209  # 
210  #        d2sigma_noe() 
211  #        -------------  =  dip_const_grad . dip_Jw_sigma_noe_grad 
212  #           dJw.dr 
213  # 
214  # 
215  #        d2Ri() 
216  #        ------  =  dip_comps_grad . dip_jw_comps_grad 
217  #        dJw.dr 
218  # 
219  # 
220  #    Chemical exchange - Chemical exchange 
221  #    ===================================== 
222  # 
223  #         d2R1()              d2R2()             d2sigma_noe() 
224  #        -------  =  0   ,   -------  =  0   ,   -------------  =  0 
225  #        dRex**2             dRex**2                dRex**2 
226  # 
227  # 
228  #    Chemical exchange - CSA 
229  #    ======================= 
230  # 
231  #          d2R1()                d2R2()              d2sigma_noe() 
232  #        ---------  =  0   ,   ---------  =  0   ,   -------------  =  0 
233  #        dRex.dcsa             dRex.dcsa               dRex.dcsa 
234  # 
235  # 
236  #    Chemical exchange - Bond length 
237  #    =============================== 
238  # 
239  #         d2R1()              d2R2()             d2sigma_noe() 
240  #        -------  =  0   ,   -------  =  0   ,   -------------  =  0 
241  #        dRex.dr             dRex.dr                dRex.dr 
242  # 
243  # 
244  #    CSA - CSA 
245  #    ========= 
246  # 
247  #         d2R1() 
248  #        -------  =  csa_const_hess  . csa_Jw_R1_func 
249  #        dcsa**2 
250  # 
251  # 
252  #         d2R2()     csa_const_hess 
253  #        -------  =  -------------- . csa_Jw_R2_func 
254  #        dcsa**2           6 
255  # 
256  # 
257  #        d2sigma_noe() 
258  #        -------------  =  0 
259  #           dcsa**2 
260  # 
261  # 
262  #         d2Ri() 
263  #        -------  =  csa_comps_hess  . csa_jw_comps_func 
264  #        dcsa**2 
265  # 
266  # 
267  #    CSA - Bond length 
268  #    ================= 
269  # 
270  #         d2R1()              d2R2()             d2sigma_noe() 
271  #        -------  =  0   ,   -------  =  0   ,   -------------  =  0 
272  #        dcsa.dr             dcsa.dr                dcsa.dr 
273  # 
274  # 
275  #    Bond length - Bond length 
276  #    ========================= 
277  # 
278  #        d2R1() 
279  #        ------  =  dip_const_hess . dip_Jw_R1_func 
280  #        dr**2 
281  # 
282  # 
283  #        d2R2()     dip_const_hess 
284  #        ------  =  -------------- . dip_Jw_R2_func 
285  #        dr**2            2 
286  # 
287  # 
288  #        d2sigma_noe() 
289  #        -------------  =  dip_const_hess . dip_Jw_sigma_noe_func 
290  #            dr**2 
291  # 
292  # 
293  #        d2Ri() 
294  #        ------  =  dip_comps_hess . dip_jw_comps_func 
295  #        dr**2 
296  # 
297  # 
298   
299   
300  # Transformed relaxation equatons. 
301  ################################## 
302   
303 -def func_ri_prime(data):
304 """Calculate the transformed relaxation values.""" 305 306 return data.dip_comps_func * data.dip_jw_comps_func + data.csa_comps_func * data.csa_jw_comps_func
307 308
309 -def func_ri_prime_rex(data):
310 """Calculate the transformed relaxation values.""" 311 312 return data.dip_comps_func * data.dip_jw_comps_func + data.csa_comps_func * data.csa_jw_comps_func + data.rex_comps_func
313 314 315 # Transformed relaxation gradients. 316 ################################### 317 318 # dRi/dJ(w)
319 -def func_dri_djw_prime(data):
320 """Spectral density parameter derivatives.""" 321 322 return data.dip_comps_func * data.dip_jw_comps_grad + data.csa_comps_func * data.csa_jw_comps_grad
323 324 325 # dRi/dRex
326 -def func_dri_drex_prime(data):
327 """Chemical exchange derivatives.""" 328 329 return data.rex_comps_grad
330 331 332 # dRi/dr
333 -def func_dri_dr_prime(data):
334 """Bond length derivatives.""" 335 336 return data.dip_comps_grad * data.dip_jw_comps_func
337 338 339 # dRi/dCSA
340 -def func_dri_dcsa_prime(data):
341 """CSA derivatives.""" 342 343 return data.csa_comps_grad * data.csa_jw_comps_func
344 345 346 347 348 # Transformed relaxation Hessians. 349 ################################## 350 351 352 # d2Ri/dJ(w)i.dJ(w)j
353 -def func_d2ri_djwidjwj_prime(data):
354 """Spectral density parameter / spectral density parameter Hessian. 355 356 The equations are:: 357 358 d2R1() 359 --------- = dip_const_func . dip_Jw_R1_hess + csa_const_func . csa_Jw_R1_hess 360 dJwi.dJwj 361 362 d2R2() dip_const_func csa_const_func 363 --------- = -------------- . dip_Jw_R2_hess + -------------- . csa_Jw_R2_hess 364 dJwi.dJwj 2 6 365 366 d2sigma_noe() 367 ------------- = dip_const_func . dip_Jw_sigma_noe_hess 368 dJwi.dJwj 369 370 d2Ri() 371 --------- = dip_comps_func . dip_jw_comps_hess + csa_comps_func . csa_jw_comps_hess 372 dJwi.dJwj 373 """ 374 375 return data.dip_comps_func * data.dip_jw_comps_hess + data.csa_comps_func * data.csa_jw_comps_hess
376 377 378 # d2Ri/dJ(w).dCSA
379 -def func_d2ri_djwdcsa_prime(data):
380 """Spectral density parameter / CSA Hessian. 381 382 The equations are:: 383 384 d2R1() 385 -------- = csa_const_grad . csa_Jw_R1_grad 386 dJw.dcsa 387 388 d2R2() csa_const_grad 389 -------- = -------------- . csa_Jw_R2_grad 390 dJw.dcsa 6 391 392 d2sigma_noe() 393 ------------- = 0 394 dJw.dcsa 395 396 d2Ri() 397 -------- = csa_comps_grad . csa_jw_comps_grad 398 dJw.dcsa 399 """ 400 401 return data.csa_comps_grad * data.csa_jw_comps_grad
402 403 404 # d2Ri/dJ(w).dr
405 -def func_d2ri_djwdr_prime(data):
406 """Spectral density parameter / bond length Hessian. 407 408 The equations are:: 409 410 d2R1() 411 ------ = dip_const_grad . dip_Jw_R1_grad 412 dJw.dr 413 414 d2R2() dip_const_grad 415 ------ = -------------- . dip_Jw_R2_grad 416 dJw.dr 2 417 418 d2sigma_noe() 419 ------------- = dip_const_grad . dip_Jw_sigma_noe_grad 420 dJw.dr 421 422 d2Ri() 423 ------ = dip_comps_grad . dip_jw_comps_grad 424 dJw.dr 425 """ 426 427 return data.dip_comps_grad * data.dip_jw_comps_grad
428 429 430 # d2Ri/dCSA^2
431 -def func_d2ri_dcsa2_prime(data):
432 """CSA / CSA Hessian. 433 434 The equations are:: 435 436 d2R1() 437 ------- = csa_const_hess . csa_Jw_R1_func 438 dcsa**2 439 440 d2R2() csa_const_hess 441 ------- = -------------- . csa_Jw_R2_func 442 dcsa**2 6 443 444 d2sigma_noe() 445 ------------- = 0 446 dcsa**2 447 448 d2Ri() 449 ------- = csa_comps_hess . csa_jw_comps_func 450 dcsa**2 451 """ 452 453 return data.csa_comps_hess * data.csa_jw_comps_func
454 455 456 # d2Ri/dr^2
457 -def func_d2ri_dr2_prime(data):
458 """Bond length / bond length Hessian. 459 460 The equations are:: 461 462 d2R1() 463 ------ = dip_const_hess . dip_Jw_R1_func 464 dr**2 465 466 d2R2() dip_const_hess 467 ------ = -------------- . dip_Jw_R2_func 468 dr**2 2 469 470 d2sigma_noe() 471 ------------- = dip_const_hess . dip_Jw_sigma_noe_func 472 dr**2 473 474 d2Ri() 475 ------ = dip_comps_hess . dip_jw_comps_func 476 dr**2 477 """ 478 479 return data.dip_comps_hess * data.dip_jw_comps_func
480