Beispiel #1
0
def _gauss(r, mean, width):
    return _multigaussfun(r, mean, width)


# Create model
dd_gauss = Model(_gauss, constants='r')
dd_gauss.description = 'Gaussian distribution model'
# Parameters
dd_gauss.mean.set(description='Mean', lb=1.0, ub=20, par0=3.5, units='nm')
dd_gauss.width.set(description='Standard deviation',
                   lb=0.05,
                   ub=2.5,
                   par0=0.2,
                   units='nm')
# Add documentation
dd_gauss.__doc__ = _dd_docstring(dd_gauss, notes) + docstr_example('dd_gauss')

#=======================================================================================
#                                     dd_gauss2
#=======================================================================================
notes = r"""
**Model**

:math:`P(r) = a_1\frac{1}{\sigma_1\sqrt{2\pi}}\exp\left(-\frac{(r-\left<r_1\right>)^2}{2\sigma_1^2}\right) + a_2\frac{1}{\sigma_2\sqrt{2\pi}}\exp\left(-\frac{(r-\left<r_2\right>)^2}{2\sigma_2^2}\right)`

where `\left<r\right>_i` are the mean distances, `\sigma_i` the standard deviations, and `a_i` are the amplitudes of the Gaussians.
"""


def _gauss2(r, mean1, width1, mean2, width2):
    return _multigaussfun(r, [mean1, mean2], [width1, width2])
Beispiel #2
0
    B = np.exp(-κ * lam * conc * D * np.abs(t * 1e-6))
    return B


# Create model
bg_hom3d = Model(_hom3d, constants='t')
bg_hom3d.description = 'Background from a homogeneous distribution of spins in a 3D medium'
# Parameters
bg_hom3d.conc.set(description='Spin concentration',
                  lb=0.01,
                  ub=5000,
                  par0=50,
                  units='μM')
bg_hom3d.lam.set(description='Pathway amplitude', lb=0, ub=1, par0=1, units='')
# Add documentation
bg_hom3d.__doc__ = _docstring(bg_hom3d, notes)

#=======================================================================================
#                                     bg_hom3d_phase
#=======================================================================================
notes = r"""
**Model**

This model describes the phase shift due to inter-molecular interactions between one observer spin with a 3D homogenous distribution of spins of concentration `c_s`

The expression for this model is

.. math::
   B(t) = \mathrm{exp}\left(-\ii\frac{8\pi}{9\sqrt{3}}(\sqrt{3} + \mathrm{ln}(2-\sqrt{3}))\lambda c_s D |t|\right)`

where `c_s` is the spin concentration (entered in spins/m\ :sup:`3` into this expression) and D is the dipolar constant