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:
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
)
simple exponential model#
A simple exponential model for the structure function:
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
)
stretched exponential model#
A stretched exponential model for the structure function:
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
)
compressed exponential model#
A compressed exponential model for the structure function:
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
)
double exponential model#
A generic double exponential model for the structure function:
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
)
flory schulz model#
A model for the structure function where the relaxation rates follow a Flory-Schulz distribution:
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
)
exponential distribution model#
A model for the structure function where the relaxation rates follow an exponential distribution:
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
)
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:
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:
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:
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:
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:
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:
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:
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)\) |