[cbb54e2] | 1 | r""" |
---|
| 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
| 5 | This model calculates the scattered intensity of a two-component system |
---|
| 6 | using the Teubner-Strey model. Unlike :ref:`dab` this function generates |
---|
[caddb14] | 7 | a peak. A two-phase material can be characterised by two length scales - |
---|
| 8 | a correlation length and a domain size (periodicity). |
---|
| 9 | |
---|
| 10 | The original paper by Teubner and Strey defined the function as: |
---|
[cbb54e2] | 11 | |
---|
| 12 | .. math:: |
---|
| 13 | |
---|
[caddb14] | 14 | I(q) \propto \frac{1}{a_2 + c_1 q^2 + c_2 q^4} + \text{background} |
---|
[cbb54e2] | 15 | |
---|
[caddb14] | 16 | where the parameters $a_2$, $c_1$ and $c_2$ are defined in terms of the |
---|
| 17 | periodicity, $d$, and correlation length $\xi$ as: |
---|
[cbb54e2] | 18 | |
---|
| 19 | .. math:: |
---|
| 20 | |
---|
[b3f2a24] | 21 | a_2 &= \biggl[1+\bigl(\frac{2\pi\xi}{d}\bigr)^2\biggr]^2\\ |
---|
[caddb14] | 22 | c_1 &= -2\xi^2\bigl(\frac{2\pi\xi}{d}\bigr)^2+2\xi^2\\ |
---|
| 23 | c_2 &= \xi^4 |
---|
[cbb54e2] | 24 | |
---|
[caddb14] | 25 | and thus, the periodicity, $d$ is given by |
---|
[cbb54e2] | 26 | |
---|
[caddb14] | 27 | .. math:: |
---|
| 28 | |
---|
| 29 | d = 2\pi\left[\frac12\left(\frac{a_2}{c_2}\right)^{1/2} |
---|
| 30 | - \frac14\frac{c_1}{c_2}\right]^{-1/2} |
---|
| 31 | |
---|
| 32 | and the correlation length, $\xi$, is given by |
---|
[cbb54e2] | 33 | |
---|
| 34 | .. math:: |
---|
| 35 | |
---|
| 36 | \xi = \left[\frac12\left(\frac{a_2}{c_2}\right)^{1/2} |
---|
[caddb14] | 37 | + \frac14\frac{c_1}{c_2}\right]^{-1/2} |
---|
| 38 | |
---|
| 39 | Here the model is parameterised in terms of $d$ and $\xi$ and with an explicit |
---|
| 40 | volume fraction for one phase, $\phi_a$, and contrast, |
---|
| 41 | $\delta\rho^2 = (\rho_a - \rho_b)^2$ : |
---|
| 42 | |
---|
| 43 | .. math:: |
---|
[cbb54e2] | 44 | |
---|
[caddb14] | 45 | I(q) = \frac{8\pi\phi_a(1-\phi_a)(\Delta\rho)^2c_2/\xi} |
---|
| 46 | {a_2 + c_1q^2 + c_2q^4} |
---|
| 47 | |
---|
| 48 | where :math:`8\pi\phi_a(1-\phi_a)(\Delta\rho)^2c_2/\xi` is the constant of |
---|
| 49 | proportionality from the first equation above. |
---|
| 50 | |
---|
| 51 | In the case of a microemulsion, $a_2 > 0$, $c_1 < 0$, and $c_2 >0$. |
---|
[cbb54e2] | 52 | |
---|
| 53 | For 2D data, scattering intensity is calculated in the same way as 1D, |
---|
| 54 | where the $q$ vector is defined as |
---|
| 55 | |
---|
| 56 | .. math:: |
---|
| 57 | |
---|
| 58 | q = \sqrt{q_x^2 + q_y^2} |
---|
| 59 | |
---|
[eb69cce] | 60 | References |
---|
| 61 | ---------- |
---|
[cbb54e2] | 62 | |
---|
[0507e09] | 63 | .. [#] M Teubner, R Strey, *J. Chem. Phys.*, 87 (1987) 3195 |
---|
| 64 | .. [#] K V Schubert, R Strey, S R Kline and E W Kaler, *J. Chem. Phys.*, 101 (1994) 5343 |
---|
| 65 | .. [#] H Endo, M Mihailescu, M. Monkenbusch, J Allgaier, G Gompper, D Richter, B Jakobs, T Sottmann, R Strey, and I Grillo, *J. Chem. Phys.*, 115 (2001), 580 |
---|
[cbb54e2] | 66 | |
---|
[0507e09] | 67 | Source |
---|
| 68 | ------ |
---|
[cbb54e2] | 69 | |
---|
[0507e09] | 70 | `teubner_strey.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/teubner_strey.py>`_ |
---|
| 71 | |
---|
| 72 | `teubner_strey.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/teubner_strey.c>`_ |
---|
| 73 | |
---|
| 74 | Authorship and Verification |
---|
| 75 | ---------------------------- |
---|
| 76 | |
---|
| 77 | * **Author:** |
---|
| 78 | * **Last Modified by:** |
---|
| 79 | * **Last Reviewed by:** |
---|
| 80 | * **Source added by :** Steve King **Date:** March 25, 2019 |
---|
[cbb54e2] | 81 | """ |
---|
[8393c74] | 82 | from __future__ import division |
---|
[cbb54e2] | 83 | |
---|
| 84 | import numpy as np |
---|
[4962519] | 85 | from numpy import inf, pi |
---|
[cbb54e2] | 86 | |
---|
| 87 | name = "teubner_strey" |
---|
| 88 | title = "Teubner-Strey model of microemulsions" |
---|
| 89 | description = """\ |
---|
[caddb14] | 90 | Calculates scattering according to the Teubner-Strey model |
---|
[cbb54e2] | 91 | """ |
---|
| 92 | category = "shape-independent" |
---|
| 93 | |
---|
[40a87fa] | 94 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 95 | parameters = [ |
---|
[caddb14] | 96 | ["volfraction_a", "", 0.5, [0, 1.0], "", "Volume fraction of phase a"], |
---|
| 97 | ["sld_a", "1e-6/Ang^2", 0.3, [-inf, inf], "", "SLD of phase a"], |
---|
| 98 | ["sld_b", "1e-6/Ang^2", 6.3, [-inf, inf], "", "SLD of phase b"], |
---|
| 99 | ["d", "Ang", 100.0, [0, inf], "", "Domain size (periodicity)"], |
---|
| 100 | ["xi", "Ang", 30.0, [0, inf], "", "Correlation length"], |
---|
[40a87fa] | 101 | ] |
---|
[cbb54e2] | 102 | |
---|
[8393c74] | 103 | def Iq(q, volfraction_a, sld_a, sld_b, d, xi): |
---|
[40a87fa] | 104 | """SAS form""" |
---|
[8393c74] | 105 | drho = sld_a - sld_b |
---|
[b3f2a24] | 106 | k = 2.0*pi*xi/d |
---|
[4962519] | 107 | a2 = (1.0 + k**2)**2 |
---|
| 108 | c1 = 2.0*xi**2 * (1.0 - k**2) |
---|
| 109 | c2 = xi**4 |
---|
[8393c74] | 110 | prefactor = 8.0*pi * volfraction_a*(1.0 - volfraction_a) * drho**2 * c2/xi |
---|
[caddb14] | 111 | return 1.0e-4*prefactor / np.polyval([c2, c1, a2], q**2) |
---|
| 112 | |
---|
[eb69cce] | 113 | Iq.vectorized = True # Iq accepts an array of q values |
---|
[cbb54e2] | 114 | |
---|
[48462b0] | 115 | def random(): |
---|
[b297ba9] | 116 | """Return a random parameter set for the model.""" |
---|
[48462b0] | 117 | d = 10**np.random.uniform(1, 4) |
---|
| 118 | xi = 10**np.random.uniform(-0.3, 2)*d |
---|
| 119 | pars = dict( |
---|
| 120 | #background=0, |
---|
| 121 | scale=100, |
---|
| 122 | volfraction_a=10**np.random.uniform(-3, 0), |
---|
| 123 | sld_a=np.random.uniform(-0.5, 12), |
---|
| 124 | sld_b=np.random.uniform(-0.5, 12), |
---|
| 125 | d=d, |
---|
| 126 | xi=xi, |
---|
| 127 | ) |
---|
| 128 | return pars |
---|
| 129 | |
---|
[caddb14] | 130 | demo = dict(scale=1, background=0, volfraction_a=0.5, |
---|
[48462b0] | 131 | sld_a=0.3, sld_b=6.3, |
---|
| 132 | d=100.0, xi=30.0) |
---|
[caddb14] | 133 | tests = [[{}, 0.06, 41.5918888453]] |
---|