[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 | |
---|
[0e9048f] | 38 | .. figure:: img/teubner_strey_1d.jpg |
---|
[cbb54e2] | 39 | |
---|
| 40 | 1D plot using the default values (w/200 data point). |
---|
| 41 | |
---|
[eb69cce] | 42 | References |
---|
| 43 | ---------- |
---|
[cbb54e2] | 44 | |
---|
| 45 | M Teubner, R Strey, *J. Chem. Phys.*, 87 (1987) 3195 |
---|
| 46 | |
---|
| 47 | K V Schubert, R Strey, S R Kline and E W Kaler, |
---|
| 48 | *J. Chem. Phys.*, 101 (1994) 5343 |
---|
| 49 | |
---|
| 50 | """ |
---|
| 51 | |
---|
| 52 | import numpy as np |
---|
| 53 | from numpy import inf, sqrt |
---|
| 54 | |
---|
| 55 | name = "teubner_strey" |
---|
| 56 | title = "Teubner-Strey model of microemulsions" |
---|
| 57 | description = """\ |
---|
| 58 | Scattering model class for the Teubner-Strey model given by |
---|
| 59 | Provide F(x) = 1/( a2 + c1 q^2+ c2 q^4 ) + background |
---|
| 60 | a2>0, c1<0, c2>0, 4 a2 c2 - c1^2 > 0 |
---|
| 61 | """ |
---|
| 62 | category = "shape-independent" |
---|
| 63 | |
---|
| 64 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 65 | parameters = [["a2", "", 0.1, [0, inf], "", |
---|
| 66 | "a2"], |
---|
| 67 | ["c1", "1e-6/Ang^2", -30., [-inf, 0], "", |
---|
| 68 | "c1"], |
---|
| 69 | ["c2", "Ang", 5000., [0, inf], "volume", |
---|
| 70 | "c2"], |
---|
| 71 | ] |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | def form_volume(radius): |
---|
| 75 | return 1.0 |
---|
| 76 | |
---|
| 77 | def Iq(q, a2, c1, c2): |
---|
| 78 | return 1. / np.polyval([c2, c1, a2], q**2) |
---|
[eb69cce] | 79 | Iq.vectorized = True # Iq accepts an array of q values |
---|
[cbb54e2] | 80 | |
---|
| 81 | def Iqxy(qx, qy, a2, c1, c2): |
---|
| 82 | return Iq(sqrt(qx**2 + qy**2), a2, c1, c2) |
---|
[eb69cce] | 83 | Iqxy.vectorized = True # Iqxy accepts arrays of qx, qy values |
---|
[cbb54e2] | 84 | |
---|
| 85 | # ER defaults to 0.0 |
---|
| 86 | |
---|
| 87 | # VR defaults to 1.0 |
---|
| 88 | |
---|
| 89 | demo = dict(scale=1, background=0, a2=0.1, c1=-30.0, c2=5000.0) |
---|
| 90 | oldname = "TeubnerStreyModel" |
---|
| 91 | oldpars = dict(a2='scale') |
---|
[bea48a6] | 92 | |
---|
| 93 | tests = [[{}, 0.2, 0.144927536232]] |
---|