1 | r""" |
---|
2 | Definition |
---|
3 | ---------- |
---|
4 | |
---|
5 | This model calculates the SAS signal of a phase separating system |
---|
6 | undergoing spinodal decomposition. The scattering intensity $I(q)$ is calculated |
---|
7 | as |
---|
8 | |
---|
9 | .. math:: |
---|
10 | I(q) = I_{max}\frac{(1+\gamma/2)x^2}{\gamma/2+x^{2+\gamma}}+B |
---|
11 | |
---|
12 | where $x=q/q_0$, $q_0$ is the peak position, $I_{max}$ is the intensity |
---|
13 | at $q_0$ (parameterised as the $scale$ parameter), and $B$ is a flat |
---|
14 | background. The spinodal wavelength is given by $2\pi/q_0$. |
---|
15 | |
---|
16 | The exponent $\gamma$ is equal to $d+1$ for off-critical concentration |
---|
17 | mixtures (smooth interfaces) and $2d$ for critical concentration mixtures |
---|
18 | (entangled interfaces), where $d$ is the dimensionality (ie, 1, 2, 3) of the |
---|
19 | system. Thus 2 <= $\gamma$ <= 6. A transition from $\gamma=d+1$ to $\gamma=2d$ |
---|
20 | is expected near the percolation threshold. |
---|
21 | |
---|
22 | As this function tends to zero as $q$ tends to zero, in practice it may be |
---|
23 | necessary to combine it with another function describing the low-angle |
---|
24 | scattering, or to simply omit the low-angle scattering from the fit. |
---|
25 | |
---|
26 | References |
---|
27 | ---------- |
---|
28 | |
---|
29 | H. Furukawa. Dynamics-scaling theory for phase-separating unmixing mixtures: |
---|
30 | Growth rates of droplets and scaling properties of autocorrelation functions. |
---|
31 | Physica A 123,497 (1984). |
---|
32 | |
---|
33 | Revision History |
---|
34 | ---------------- |
---|
35 | |
---|
36 | * **Author:** Dirk Honecker **Date:** Oct 7, 2016 |
---|
37 | * **Revised:** Steve King **Date:** Sep 7, 2018 |
---|
38 | """ |
---|
39 | |
---|
40 | import numpy as np |
---|
41 | from numpy import inf, errstate |
---|
42 | |
---|
43 | name = "spinodal" |
---|
44 | title = "Spinodal decomposition model" |
---|
45 | description = """\ |
---|
46 | I(q) = Imax ((1+gamma/2)x^2)/(gamma/2+x^(2+gamma)) + background |
---|
47 | |
---|
48 | List of default parameters: |
---|
49 | |
---|
50 | Imax = correlation peak intensity at q_0 |
---|
51 | background = incoherent background |
---|
52 | gamma = exponent (see model documentation) |
---|
53 | q_0 = correlation peak position [1/A] |
---|
54 | x = q/q_0""" |
---|
55 | |
---|
56 | category = "shape-independent" |
---|
57 | |
---|
58 | # pylint: disable=bad-whitespace, line-too-long |
---|
59 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
60 | parameters = [["gamma", "", 3.0, [-inf, inf], "", "Exponent"], |
---|
61 | ["q_0", "1/Ang", 0.1, [-inf, inf], "", "Correlation peak position"] |
---|
62 | ] |
---|
63 | # pylint: enable=bad-whitespace, line-too-long |
---|
64 | |
---|
65 | def Iq(q, |
---|
66 | gamma=3.0, |
---|
67 | q_0=0.1): |
---|
68 | """ |
---|
69 | :param q: Input q-value |
---|
70 | :param gamma: Exponent |
---|
71 | :param q_0: Correlation peak position |
---|
72 | :return: Calculated intensity |
---|
73 | """ |
---|
74 | with errstate(divide='ignore'): |
---|
75 | x = q/q_0 |
---|
76 | inten = ((1 + gamma / 2) * x ** 2) / (gamma / 2 + x ** (2 + gamma)) |
---|
77 | return inten |
---|
78 | Iq.vectorized = True # Iq accepts an array of q values |
---|
79 | |
---|
80 | def random(): |
---|
81 | pars = dict( |
---|
82 | scale=10**np.random.uniform(1, 3), |
---|
83 | gamma=np.random.uniform(0, 6), |
---|
84 | q_0=10**np.random.uniform(-3, -1), |
---|
85 | ) |
---|
86 | return pars |
---|
87 | |
---|
88 | demo = dict(scale=1, background=0, |
---|
89 | gamma=1, q_0=0.1) |
---|