[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 |
---|
| 7 | a peak. |
---|
| 8 | |
---|
| 9 | .. math:: |
---|
| 10 | |
---|
| 11 | I(q) = \frac{1}{a_2 + c_1 q^2 + c_2 q^4} + \text{background} |
---|
| 12 | |
---|
| 13 | The parameters $a_2$, $c_1$ and $c_2$ can be used to determine the |
---|
| 14 | characteristic domain size $d$, |
---|
| 15 | |
---|
| 16 | .. math:: |
---|
| 17 | |
---|
| 18 | d = 2\pi\left[\frac12\left(\frac{a_2}{c_2}\right)^{1/2} |
---|
| 19 | + \frac14\frac{c_1}{c_2}\right]^{-1/2} |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | and the correlation length $\xi$, |
---|
| 23 | |
---|
| 24 | .. math:: |
---|
| 25 | |
---|
| 26 | \xi = \left[\frac12\left(\frac{a_2}{c_2}\right)^{1/2} |
---|
| 27 | - \frac14\frac{c_1}{c_2}\right]^{-1/2} |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | For 2D data, scattering intensity is calculated in the same way as 1D, |
---|
| 31 | where the $q$ vector is defined as |
---|
| 32 | |
---|
| 33 | .. math:: |
---|
| 34 | |
---|
| 35 | q = \sqrt{q_x^2 + q_y^2} |
---|
| 36 | |
---|
| 37 | |
---|
[eb69cce] | 38 | References |
---|
| 39 | ---------- |
---|
[cbb54e2] | 40 | |
---|
| 41 | M Teubner, R Strey, *J. Chem. Phys.*, 87 (1987) 3195 |
---|
| 42 | |
---|
| 43 | K V Schubert, R Strey, S R Kline and E W Kaler, |
---|
| 44 | *J. Chem. Phys.*, 101 (1994) 5343 |
---|
| 45 | |
---|
| 46 | """ |
---|
| 47 | |
---|
| 48 | import numpy as np |
---|
| 49 | from numpy import inf, sqrt |
---|
| 50 | |
---|
| 51 | name = "teubner_strey" |
---|
| 52 | title = "Teubner-Strey model of microemulsions" |
---|
| 53 | description = """\ |
---|
| 54 | Scattering model class for the Teubner-Strey model given by |
---|
| 55 | Provide F(x) = 1/( a2 + c1 q^2+ c2 q^4 ) + background |
---|
| 56 | a2>0, c1<0, c2>0, 4 a2 c2 - c1^2 > 0 |
---|
| 57 | """ |
---|
| 58 | category = "shape-independent" |
---|
| 59 | |
---|
| 60 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 61 | parameters = [["a2", "", 0.1, [0, inf], "", |
---|
| 62 | "a2"], |
---|
| 63 | ["c1", "1e-6/Ang^2", -30., [-inf, 0], "", |
---|
| 64 | "c1"], |
---|
| 65 | ["c2", "Ang", 5000., [0, inf], "volume", |
---|
| 66 | "c2"], |
---|
| 67 | ] |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | def form_volume(radius): |
---|
| 71 | return 1.0 |
---|
| 72 | |
---|
| 73 | def Iq(q, a2, c1, c2): |
---|
| 74 | return 1. / np.polyval([c2, c1, a2], q**2) |
---|
[eb69cce] | 75 | Iq.vectorized = True # Iq accepts an array of q values |
---|
[cbb54e2] | 76 | |
---|
| 77 | def Iqxy(qx, qy, a2, c1, c2): |
---|
| 78 | return Iq(sqrt(qx**2 + qy**2), a2, c1, c2) |
---|
[eb69cce] | 79 | Iqxy.vectorized = True # Iqxy accepts arrays of qx, qy values |
---|
[cbb54e2] | 80 | |
---|
| 81 | # ER defaults to 0.0 |
---|
| 82 | |
---|
| 83 | # VR defaults to 1.0 |
---|
| 84 | |
---|
| 85 | demo = dict(scale=1, background=0, a2=0.1, c1=-30.0, c2=5000.0) |
---|
[6dd90c1] | 86 | tests = [[{}, 0.2, 0.145927536232]] |
---|