Package maths_fns :: Module weights
[hide private]
[frames] | no frames]

Module weights

source code

Functions [hide private]
 
calc_sphere_ci(data, diff_data)
Weight for spherical diffusion.
source code
 
calc_spheroid_ci(data, diff_data)
Weights for spheroidal diffusion.
source code
 
calc_spheroid_dci(data, diff_data)
Weight gradient for spheroidal diffusion.
source code
 
calc_spheroid_d2ci(data, diff_data)
Weight Hessian for spheroidal diffusion.
source code
 
calc_ellipsoid_ci(data, diff_data)
Weight equations for ellipsoidal diffusion.
source code
 
calc_ellipsoid_dci(data, diff_data)
Weight gradient for ellipsoidal diffusion.
source code
 
calc_ellipsoid_d2ci(data, diff_data)
Weight Hessian for ellipsoidal diffusion.
source code
Variables [hide private]
  __package__ = 'maths_fns'

Imports: sqrt, outer


Function Details [hide private]

calc_sphere_ci(data, diff_data)

source code 

Weight for spherical diffusion.

The equation is:

   c0 = 1.

calc_spheroid_ci(data, diff_data)

source code 

Weights for spheroidal diffusion.

The equations are:

   c-1 = 1/4 (3dz**2 - 1)**2,

   c0  = 3dz**2 (1 - dz**2),

   c1  = 3/4 (dz**2 - 1)**2,

where dz is the direction cosine of the unit bond vector along the z-axis of the diffusion tensor which is calculated as the dot product of the unit bond vector with a unit vector along Dpar.

calc_spheroid_dci(data, diff_data)

source code 

Weight gradient for spheroidal diffusion.

The equations are:

   dc-1                     ddz
   ---- =  3dz (3dz**2 - 1) --- ,
   dOi                      dOi

   dc0                      ddz
   ---  =  6dz (1 - 2dz**2) --- ,
   dOi                      dOi

   dc1                     ddz
   ---  =  3dz (dz**2 - 1) --- ,
   dOi                     dOi

where the orientation parameter set O is {theta, phi}.

calc_spheroid_d2ci(data, diff_data)

source code 

Weight Hessian for spheroidal diffusion.

The equations are:

    d2c-1        /             ddz   ddz                      d2dz   \ 
   -------  =  3 |(9dz**2 - 1) --- . ---  +  dz (3dz**2 - 1) ------- | ,
   dOi.dOj       \             dOi   dOj                     dOi.dOj /

    d2c0         /             ddz   ddz                      d2dz   \ 
   -------  =  6 |(1 - 6dz**2) --- . ---  +  dz (1 - 2dz**2) ------- | ,
   dOi.dOj       \             dOi   dOj                     dOi.dOj /

    d2c1         /             ddz   ddz                     d2dz   \ 
   -------  =  3 |(3dz**2 - 1) --- . ---  +  dz (dz**2 - 1) ------- | ,
   dOi.dOj       \             dOi   dOj                    dOi.dOj /

where the orientation parameter set O is {theta, phi}.

calc_ellipsoid_ci(data, diff_data)

source code 

Weight equations for ellipsoidal diffusion.

The equations are:

   c-2 = 1/4 (d - e),

   c-1 = 3dy**2.dz**2,

   c0  = 3dx**2.dz**2,

   c1  = 3dx**2.dy**2,

   c2  = 1/4 (d + e),

where:

   d  = 3(dx**4 + dy**4 + dz**4) - 1,

   e  =  1/R [(1 + 3Dr)(dx**4 + 2dy**2.dz**2) + (1 - 3Dr)(dy**4 + 2dx**2.dz**2)
              - 2(dz**4 + 2dx**2.dy**2)],

and where the factor R is defined as:

        ___________
   R = V 1 + 3Dr**2.

dx, dy, and dz are the direction cosines of the XH bond vector along the x, y, and z-axes of the diffusion tensor, calculated as the dot product of the unit bond vector and the unit vectors along Dx, Dy, and Dz respectively.

calc_ellipsoid_dci(data, diff_data)

source code 

Weight gradient for ellipsoidal diffusion.

Oi partial derivatives

The equations are:

   dc-2       /       ddx           ddy           ddz \     de
   ----  =  3 | dx**3 ---  +  dy**3 ---  +  dz**3 --- |  -  --- ,
   dOi        \       dOi           dOi           dOi /     dOi


   dc-1            /    ddz        ddy \ 
   ----  =  6dy.dz | dy ---  +  dz --- | ,
   dOi             \    dOi        dOi /


   dc0            /    ddz        ddx \ 
   ---  =  6dx.dz | dx ---  +  dz --- | ,
   dOi            \    dOi        dOi /


   dc1            /    ddy        ddx \ 
   ---  =  6dx.dy | dx ---  +  dy --- | ,
   dOi            \    dOi        dOi /


   dc2       /       ddx           ddy           ddz \     de
   ---  =  3 | dx**3 ---  +  dy**3 ---  +  dz**3 --- |  +  --- ,
   dOi       \       dOi           dOi           dOi /     dOi

where:

   de      1 /           /      ddx           /    ddz        ddy \ \ 
   ---  =  - | (1 + 3Dr) |dx**3 ---  +  dy.dz | dy ---  +  dz --- | |
   dOi     R \           \      dOi           \    dOi        dOi / /

                         /       ddy           /    ddz        ddx \ \ 
             + (1 - 3Dr) | dy**3 ---  +  dx.dz | dx ---  +  dz --- | |
                         \       dOi           \    dOi        dOi / /

                 /       ddz           /    ddy        ddx \ \ \ 
             - 2 | dz**3 ---  +  dx.dy | dx ---  +  dy --- | | | ,
                 \       dOi           \    dOi        dOi / / /

and where the orietation parameter set O is:

   O = {alpha, beta, gamma}.

tm partial derivatives

The equations are:

   dc-2
   ----  =  0,
   dtm

   dc-1
   ----  =  0,
   dtm

   dc0
   ---   =  0,
   dtm

   dc1
   ---   =  0,
   dtm

   dc2
   ---   =  0.
   dtm

Da partial derivatives

The equations are:

   dc-2
   ----  =  0,
   dDa

   dc-1
   ----  =  0,
   dDa

   dc0
   ---   =  0,
   dDa

   dc1
   ---   =  0,
   dDa

   dc2
   ---   =  0.
   dDa

Dr partial derivatives

The equations are:

   dc-2       3 de
   ----  =  - - ---,
   dDr        4 dDr

   dc-1
   ----  =  0,
   dDr

   dc0
   ---   =  0,
   dDr

   dc1
   ---   =  0,
   dDr

   dc2      3 de
   ---   =  - ---,
   dDr      4 dDr

where:

   de       1   /                                                                                                \ 
   ---  =  ---- | (1 - Dr) (dx**4 + 2dy**2.dz**2) - (1 + Dr) (dy**4 + 2dx**2.dz**2) + 2Dr (dz**4 + 2dx**2.dy**2) | .
   dDr     R**3 \                                                                                                /

calc_ellipsoid_d2ci(data, diff_data)

source code 

Weight Hessian for ellipsoidal diffusion.

Oi-Oj partial derivatives

The equations are:

    d2c-2        /       /     d2dx       ddx   ddx \           /     d2dy       ddy   ddy \           /     d2dz       ddz   ddz \ \       d2e
   -------  =  3 | dx**2 | dx ------- + 3 --- . --- |  +  dy**2 | dy ------- + 3 --- . --- |  +  dz**2 | dz ------- + 3 --- . --- | |  -  ------- ,
   dOi.dOj       \       \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj / /     dOi.dOj


    d2c-1              /     d2dz       ddz   ddz \              / ddy   ddz     ddz   ddy \             /     d2dy       ddy   ddy \ 
   -------  =  6 dy**2 | dz -------  +  --- . --- |  +  12 dy.dz | --- . ---  +  --- . --- |  +  6 dz**2 | dy -------  +  --- . --- | ,
   dOi.dOj             \    dOi.dOj     dOi   dOj /              \ dOi   dOj     dOi   dOj /             \    dOi.dOj     dOi   dOj /


    d2c0               /     d2dz       ddz   ddz \              / ddx   ddz     ddz   ddx \             /     d2dx       ddx   ddx \ 
   -------  =  6 dx**2 | dz -------  +  --- . --- |  +  12 dx.dz | --- . ---  +  --- . --- |  +  6 dz**2 | dx -------  +  --- . --- | ,
   dOi.dOj             \    dOi.dOj     dOi   dOj /              \ dOi   dOj     dOi   dOj /             \    dOi.dOj     dOi   dOj /


    d2c1               /     d2dy       ddy   ddy \              / ddx   ddy     ddy   ddx \             /     d2dx       ddx   ddx \ 
   -------  =  6 dx**2 | dy -------  +  --- . --- |  +  12 dx.dy | --- . ---  +  --- . --- |  +  6 dy**2 | dx -------  +  --- . --- | ,
   dOi.dOj             \    dOi.dOj     dOi   dOj /              \ dOi   dOj     dOi   dOj /             \    dOi.dOj     dOi   dOj /


    d2c2         /       /     d2dx       ddx   ddx \           /     d2dy       ddy   ddy \           /     d2dz       ddz   ddz \ \       d2e
   -------  =  3 | dx**2 | dx ------- + 3 --- . --- |  +  dy**2 | dy ------- + 3 --- . --- |  +  dz**2 | dz ------- + 3 --- . --- | |  +  ------- ,
   dOi.dOj       \       \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj / /     dOi.dOj

where:

     d2e       1 /           /       /     d2dx       ddx   ddx \           /     d2dz       ddz   ddz \ 
   -------  =  - | (1 + 3Dr) | dx**2 | dx ------- + 3 --- . --- |  +  dy**2 | dz -------  +  --- . --- |
   dOi.dOj     R \           \       \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj / 

                                     /     d2dy       ddy   ddy \            / ddy   ddz     ddz   ddy \ \ 
                             + dz**2 | dy -------  +  --- . --- |  +  2dy.dz | --- . ---  +  --- . --- | |
                                     \    dOi.dOj     dOi   dOj /            \ dOi   dOj     dOi   dOj / /

                             /       /     d2dy       ddy   ddy \           /     d2dz       ddz   ddz \ 
                 + (1 - 3Dr) | dy**2 | dy ------- + 3 --- . --- |  +  dx**2 | dz -------  +  --- . --- |
                             \       \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj / 

                                     /     d2dx       ddx   ddx \            / ddx   ddz     ddz   ddx \ \ 
                             + dz**2 | dx -------  +  --- . --- |  +  2dx.dz | --- . ---  +  --- . --- | |
                                     \    dOi.dOj     dOi   dOj /            \ dOi   dOj     dOi   dOj / /

                     /       /     d2dz       ddz   ddz \           /     d2dy       ddy   ddy \ 
                 - 2 | dz**2 | dz ------- + 3 --- . --- |  +  dx**2 | dy -------  +  --- . --- |
                     \       \    dOi.dOj     dOi   dOj /           \    dOi.dOj     dOi   dOj / 

                             /     d2dx       ddx   ddx \            / ddx   ddy     ddy   ddx \ \ \ 
                     + dy**2 | dx -------  +  --- . --- |  +  2dx.dy | --- . ---  +  --- . --- | | |
                             \    dOi.dOj     dOi   dOj /            \ dOi   dOj     dOi   dOj / / /

Oi-tm partial derivatives

The equations are:

    d2c-2
   -------  =  0,
   dOi.dtm


    d2c-1
   -------  =  0,
   dOi.dtm


    d2c0
   -------  =  0,
   dOi.dtm


    d2c1
   -------  =  0,
   dOi.dtm


    d2c2
   -------  =  0.
   dOi.dtm

Oi-Da partial derivatives

The equations are:

    d2c-2
   -------  =  0,
   dOi.dDa


    d2c-1
   -------  =  0,
   dOi.dDa


    d2c0
   -------  =  0,
   dOi.dDa


    d2c1
   -------  =  0,
   dOi.dDa


    d2c2
   -------  =  0.
   dOi.dDa

Oi-Dr partial derivatives

The equations are:

    d2c-2            d2e
   -------  =  - 3 -------,
   dOi.dDr         dOi.dDr


    d2c-1
   -------  =  0,
   dOi.dDr


    d2c0
   -------  =  0,
   dOi.dDr


    d2c1
   -------  =  0,
   dOi.dDr


    d2c2           d2e
   -------  =  3 -------,
   dOi.dDr       dOi.dDr

where:

    d2e         1   /          /       ddx           /    ddz        ddy \ \ 
   -------  =  ---- | (1 - Dr) | dx**3 ---  +  dy.dz | dy ---  +  dz --- | |
   dOi.dDr     R**3 \          \       dOi           \    dOi        dOi / /

                               /       ddy           /    ddz        ddx \ \ 
                    - (1 + Dr) | dy**3 ---  +  dx.dz | dx ---  +  dz --- | |
                               \       dOi           \    dOi        dOi / /

                          /       ddz           /    ddy        ddx \ \ \ 
                    + 2Dr | dz**3 ---  +  dx.dy | dx ---  +  dy --- | | |
                          \       dOi           \    dOi        dOi / / /

tm-tm partial derivatives

The equations are:

   d2c-2
   -----  =  0,
   dtm2


   d2c-1
   -----  =  0,
   dtm2


   d2c0
   ----   =  0,
   dtm2


   d2c1
   ----   =  0,
   dtm2


   d2c2
   ----   =  0.
   dtm2

tm-Da partial derivatives

The equations are:

    d2c-2
   -------  =  0,
   dtm.dDa


    d2c-1
   -------  =  0,
   dtm.dDa


    d2c0
   -------  =  0,
   dtm.dDa


    d2c1
   -------  =  0,
   dtm.dDa


    d2c2
   -------  =  0.
   dtm.dDa

tm-Dr partial derivatives

The equations are:

    d2c-2
   -------  =  0,
   dtm.dDr


    d2c-1
   -------  =  0,
   dtm.dDr


    d2c0
   -------  =  0,
   dtm.dDr


    d2c1
   -------  =  0,
   dtm.dDr


    d2c2
   -------  =  0.
   dtm.dDr

Da-Da partial derivatives

The equations are:

   d2c-2
   ------  =  0,
   dDa**2


   d2c-1
   ------  =  0,
   dDa**2


    d2c0
   ------  =  0,
   dDa**2


    d2c1
   ------  =  0,
   dDa**2


    d2c2
   ------  =  0.
   dDa**2

Da-Dr partial derivatives

The equations are:

    d2c-2
   -------  =  0,
   dDa.dDr


    d2c-1
   -------  =  0,
   dDa.dDr


    d2c0
   -------  =  0,
   dDa.dDr


    d2c1
   -------  =  0,
   dDa.dDr


    d2c2
   -------  =  0.
   dDa.dDr

Dr-Dr partial derivatives

The equations are:

   d2c-2        3  d2e
   ------  =  - - ------,
   dDr**2       4 dDr**2


   d2c-1
   ------  =  0,
   dDr**2


    d2c0
   ------  =  0,
   dDr**2


    d2c1
   ------  =  0,
   dDr**2


    d2c2      3  d2e
   ------  =  - ------,
   dDr**2     4 dDr**2

where:

    d2e        1   /                                                                                                                           \ 
   ------  =  ---- | (6Dr**2 - 9Dr - 1)(dx**4 + 2dy**2.dz**2) + (6Dr**2 + 9Dr - 1)(dy**4 + 2dx**2.dz**2) - 2(6Dr**2 - 1)(ddz*4 + 2dx**2.dy**2) |
   dDr**2     R**5 \                                                                                                                           /