fit_models#

This module contains the fit models.

The functions listed here are used to generate the corresponding lmfit.Model for the structure function or the intermediate scattering function. See the lmfit documentation for more information.

The model can be imported using the model name separated by underscores. The models for the intermediate scattering function are characterized by the presence of _isf_ in the name. For instance, to import the double_exponential_model and the flory_schulz_isf_model, do as follows:

# import the double exponential model for the structure function
from fastddm.fit_models import double_exponential_model

# import the Flory-Schulz model for the intermediate scattering function
from fastddm.fit_models import flory_schulz_isf_model

Structure function models#

The following lmfit.Model for the structure function are provided:

generic exponential model#

A generic exponential model for the structure function:

\[D(\Delta t) = A \left\{1 - \exp\left[ -(\Gamma \Delta t)^{\beta} \right] \right\} + B .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

Stretching/compressing exponent (\(\beta\))

beta

1

\((0, \infty)\)

The following plot highlights the differences between curves differing only for \(\beta\).

(Source code, png, hires.png, pdf)

_images/fit_models-1.png

simple exponential model#

A simple exponential model for the structure function:

\[D(\Delta t) = A \left[1 - \exp\left( - \Gamma \Delta t \right) \right] + B .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

It is defined from the generic_exponential_model by fixing beta to 1.

(Source code, png, hires.png, pdf)

_images/fit_models-2.png

stretched exponential model#

A stretched exponential model for the structure function:

\[D(\Delta t) = A \left\{1 - \exp\left[ -(\Gamma \Delta t)^{\beta} \right] \right\} + B .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

Stretching exponent (\(\beta\))

beta

1

\((0, 1]\)

(Source code, png, hires.png, pdf)

_images/fit_models-3.png

compressed exponential model#

A compressed exponential model for the structure function:

\[D(\Delta t) = A \left\{1 - \exp\left[ -(\Gamma \Delta t)^{\beta} \right] \right\} + B .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

Compressing exponent (\(\beta\))

beta

1

\([1, \infty)\)

(Source code, png, hires.png, pdf)

_images/fit_models-4.png

double exponential model#

A generic double exponential model for the structure function:

\[D(\Delta t) = A \left\{ 1 - \alpha \exp\left[-(\Gamma_1 \Delta t)^{\beta_1} \right] - (1 - \alpha) \exp\left[-(\Gamma_2 \Delta t)^{\beta_2} \right] \right\} + B\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Amplitude fraction 1 (\(\alpha\))

alpha

1

\([0, 1]\)

Relaxation rate 1 (\(\Gamma_1\))

Gamma1

1

\((0, \infty)\)

Stretching/compressing exponent 1 (\(\beta_1\))

beta1

1

\((0, \infty)\)

Relaxation rate 2 (\(\Gamma_2\))

Gamma2

1

\((0, \infty)\)

Stretching/compressing exponent 2 (\(\beta_2\))

beta2

1

\((0, \infty)\)

(Source code, png, hires.png, pdf)

_images/fit_models-5.png

flory schulz model#

A model for the structure function where the relaxation rates follow a Flory-Schulz distribution:

\[D(\Delta t) = A \left[1 - \frac{1}{(1 + \sigma^2 \bar{\Gamma} \Delta t)^{1/\sigma^2}} \right] + B\]
\[G(\Gamma) = \frac{1}{\bar{\Gamma}} \frac{(z+1)^{z+1}}{z!} \left(\frac{\Gamma}{\bar{\Gamma}}\right)^z \exp\left[-\frac{\Gamma}{\bar{\Gamma}}(z+1)\right]\]

where \(\bar{\Gamma}\) is the average relaxation rate and \(\sigma^2=1/(z+1)\) is the normalized variance (see Mailer et al (2015)).

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Relaxation rate (\(\bar{\Gamma}\))

Gamma

1

\((0, \infty)\)

Normalized standard deviation (\(\sigma\))

sigma

1

\((0, 1]\)

The following plot highlights the differences between curves differing only for \(\sigma\).

(Source code, png, hires.png, pdf)

_images/fit_models-6.png

exponential distribution model#

A model for the structure function where the relaxation rates follow an exponential distribution:

\[D(\Delta t) = A \left(1 - \frac{1}{1 + \bar{\Gamma} \Delta t}\right) + B\]
\[G(\Gamma) = \frac{1}{\bar{\Gamma}} \exp\left(-\frac{\Gamma}{\bar{\Gamma}}\right)\]

where \(\bar{\Gamma}\) is the average relaxation rate (see Mailer et al (2015)). It is obtained by fixing \(\sigma=1\) (i.e., \(z=0\)) in the flory_schulz_model.

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Noise (\(B\))

B

0

\((-\infty, \infty)\)

Relaxation rate (\(\bar{\Gamma}\))

Gamma

1

\((0, \infty)\)

(Source code, png, hires.png, pdf)

_images/fit_models-7.png

Intermediate scattering function models#

The following lmfit.Model for the intermediate scattering function are provided:

generic exponential isf model#

A generic exponential model for the intermediate scattering function:

\[f(\Delta t) = A \exp\left[ -(\Gamma \Delta t)^{\beta} \right] .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

Stretching/compressing exponent (\(\beta\))

beta

1

\((0, \infty)\)

simple exponential isf model#

A simple exponential model for the intermediate scattering function:

\[f(\Delta t) = A \exp\left( - \Gamma \Delta t \right) .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

It is defined from the generic_exponential_isf_model by fixing beta to 1.

stretched exponential isf model#

A stretched exponential model for the intermediate scattering function:

\[f(\Delta t) = A \exp\left[ -(\Gamma \Delta t)^{\beta} \right] .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

Stretching exponent (\(\beta\))

beta

1

\((0, 1]\)

compressed exponential isf model#

A compressed exponential model for the intermediate scattering function:

\[f(\Delta t) = A \exp\left[ -(\Gamma \Delta t)^{\beta} \right] .\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Relaxation rate (\(\Gamma\))

Gamma

1

\((0, \infty)\)

Compressing exponent (\(\beta\))

beta

1

\([1, \infty)\)

double exponential isf model#

A generic double exponential model for the intermediate scattering function:

\[f(\Delta t) = A \left\{ \alpha \exp\left[-(\Gamma_1 \Delta t)^{\beta_1} \right] + (1 - \alpha) \exp\left[-(\Gamma_2 \Delta t)^{\beta_2} \right] \right\}\]

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Amplitude fraction 1 (\(\alpha\))

alpha

1

\([0, 1]\)

Relaxation rate 1 (\(\Gamma_1\))

Gamma1

1

\((0, \infty)\)

Stretching/compressing exponent 1 (\(\beta_1\))

beta1

1

\((0, \infty)\)

Relaxation rate 2 (\(\Gamma_2\))

Gamma2

1

\((0, \infty)\)

Stretching/compressing exponent 2 (\(\beta_2\))

beta2

1

\((0, \infty)\)

flory schulz isf model#

A model for the intermediate scattering function where the relaxation rates follow a Flory-Schulz distribution:

\[f(\Delta t) = \frac{A}{(1 + \sigma^2 \bar{\Gamma} \Delta t)^{1/\sigma^2}}\]
\[G(\Gamma) = \frac{1}{\bar{\Gamma}} \frac{(z+1)^{z+1}}{z!} \left(\frac{\Gamma}{\bar{\Gamma}}\right)^z \exp\left[-\frac{\Gamma}{\bar{\Gamma}}(z+1)\right]\]

where \(\bar{\Gamma}\) is the average relaxation rate and \(\sigma^2=1/(z+1)\) is the normalized variance (see Mailer et al (2015)).

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Relaxation rate (\(\bar{\Gamma}\))

Gamma

1

\((0, \infty)\)

Normalized standard deviation (\(\sigma\))

sigma

1

\((0, 1]\)

exponential distribution isf model#

A model for the intermediate scattering function where the relaxation rates follow an exponential distribution:

\[f(\Delta t) = \frac{A}{1 + \bar{\Gamma} \Delta t}\]
\[G(\Gamma) = \frac{1}{\bar{\Gamma}} \exp\left(-\frac{\Gamma}{\bar{\Gamma}}\right)\]

where \(\bar{\Gamma}\) is the average relaxation rate (see Mailer et al (2015)). It is obtained by fixing \(\sigma=1\) (i.e., \(z=0\)) in the flory_schulz_isf_model.

The following parameters and settings are used:

Parameter

Symbol

Starting value

Limits

Amplitude (\(A\))

A

1

\((0, \infty)\)

Relaxation rate (\(\bar{\Gamma}\))

Gamma

1

\((0, \infty)\)