[5d4777d] | 1 | r""" |
---|
| 2 | Polydispersity in the bilayer thickness can be applied from the GUI. |
---|
| 3 | |
---|
| 4 | Definition |
---|
| 5 | ---------- |
---|
| 6 | |
---|
[40a87fa] | 7 | The scattering intensity $I(q)$ for dilute, randomly oriented, |
---|
| 8 | "infinitely large" sheets or lamellae is |
---|
[5d4777d] | 9 | |
---|
| 10 | .. math:: |
---|
| 11 | |
---|
[500128b] | 12 | I(q) = \text{scale}\frac{2\pi P(q)}{q^2\delta} + \text{background} |
---|
[5d4777d] | 13 | |
---|
| 14 | |
---|
| 15 | The form factor is |
---|
| 16 | |
---|
| 17 | .. math:: |
---|
| 18 | |
---|
[500128b] | 19 | P(q) = \frac{2\Delta\rho^2}{q^2}(1-\cos(q\delta)) |
---|
| 20 | = \frac{4\Delta\rho^2}{q^2}\sin^2\left(\frac{q\delta}{2}\right) |
---|
[5d4777d] | 21 | |
---|
[40a87fa] | 22 | where $\delta$ is the total layer thickness and $\Delta\rho$ is the |
---|
| 23 | scattering length density difference. |
---|
[5d4777d] | 24 | |
---|
[40a87fa] | 25 | This is the limiting form for a spherical shell of infinitely large radius. |
---|
| 26 | Note that the division by $\delta$ means that $scale$ in sasview is the |
---|
| 27 | volume fraction of sheet, $\phi = S\delta$ where $S$ is the area of sheet |
---|
| 28 | per unit volume. $S$ is half the Porod surface area per unit volume of a |
---|
| 29 | thicker layer (as that would include both faces of the sheet). |
---|
[5d4777d] | 30 | |
---|
[eb69cce] | 31 | The 2D scattering intensity is calculated in the same way as 1D, where |
---|
| 32 | the $q$ vector is defined as |
---|
[5d4777d] | 33 | |
---|
| 34 | .. math:: |
---|
| 35 | |
---|
[eb69cce] | 36 | q = \sqrt{q_x^2 + q_y^2} |
---|
[5d4777d] | 37 | |
---|
| 38 | |
---|
[eb69cce] | 39 | References |
---|
| 40 | ---------- |
---|
[5d4777d] | 41 | |
---|
| 42 | F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502 |
---|
| 43 | |
---|
| 44 | also in J. Phys. Chem. B, 105, (2001) 11081-11088 |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | """ |
---|
| 48 | |
---|
[3c56da87] | 49 | from numpy import inf |
---|
[5d4777d] | 50 | |
---|
| 51 | name = "lamellar" |
---|
| 52 | title = "Lyotropic lamellar phase with uniform SLD and random distribution" |
---|
| 53 | description = """\ |
---|
[3e428ec] | 54 | [Dilute Lamellar Form Factor](from a lyotropic lamellar phase) |
---|
| 55 | I(q)= 2*pi*P(q)/(delta *q^(2)), where |
---|
| 56 | P(q)=2*(contrast/q)^(2)*(1-cos(q*delta))^(2)) |
---|
| 57 | thickness = layer thickness |
---|
| 58 | sld = layer scattering length density |
---|
| 59 | sld_solvent = solvent scattering length density |
---|
| 60 | background = incoherent background |
---|
| 61 | scale = scale factor |
---|
[5d4777d] | 62 | """ |
---|
[a5d0d00] | 63 | category = "shape:lamellae" |
---|
[5d4777d] | 64 | |
---|
[40a87fa] | 65 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 66 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 67 | parameters = [ |
---|
| 68 | ["thickness", "Ang", 50, [0, inf], "volume", "total layer thickness" ], |
---|
| 69 | ["sld", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Layer scattering length density" ], |
---|
| 70 | ["sld_solvent", "1e-6/Ang^2", 6, [-inf, inf], "sld", "Solvent scattering length density" ], |
---|
| 71 | ] |
---|
| 72 | # pylint: enable=bad-whitespace, line-too-long |
---|
[5d4777d] | 73 | |
---|
| 74 | # No volume normalization despite having a volume parameter |
---|
[7c391dd] | 75 | # This should perhaps be volume normalized? - it is! |
---|
[5d4777d] | 76 | form_volume = """ |
---|
[994d77f] | 77 | return 1.0; |
---|
[5d4777d] | 78 | """ |
---|
| 79 | |
---|
| 80 | Iq = """ |
---|
[7c391dd] | 81 | const double sub = sld - sld_solvent; |
---|
[994d77f] | 82 | const double qsq = q*q; |
---|
[38d8774] | 83 | // Original expression |
---|
| 84 | //return 4.0e-4*M_PI*sub*sub/qsq * (1.0-cos(q*thickness)) / (thickness*qsq); |
---|
| 85 | // const double alpha = fmod(q*thickness+0.1, 2.0*M_PI)-0.1; |
---|
| 86 | // Use small angle fix 1-cos(theta) = 2 sin^2(theta/2) |
---|
| 87 | const double sinq2 = sin(0.5*q*thickness); |
---|
| 88 | return 4.0e-4*M_PI*sub*sub/qsq * 2.0*sinq2*sinq2 / (thickness*qsq); |
---|
[5d4777d] | 89 | """ |
---|
| 90 | |
---|
| 91 | # ER defaults to 0.0 |
---|
[d547f16] | 92 | # VR defaults to 1.0 |
---|
| 93 | |
---|
[3e428ec] | 94 | demo = dict(scale=1, background=0, |
---|
[7c391dd] | 95 | sld=6, sld_solvent=1, |
---|
[3e428ec] | 96 | thickness=40, |
---|
| 97 | thickness_pd=0.2, thickness_pd_n=40) |
---|
[348557a] | 98 | tests = [ |
---|
[40a87fa] | 99 | [ {'scale': 1.0, 'background': 0.0, 'thickness': 50.0, |
---|
| 100 | 'sld': 1.0, 'sld_solvent': 6.3, 'thickness_pd': 0.0}, |
---|
| 101 | [0.001], [882289.54309]] |
---|
[348557a] | 102 | ] |
---|
| 103 | # ADDED by: converted by PAK? (or RKH?) ON: 16Mar2016 - RKH adding unit tests from sasview to early 2015 conversion |
---|
[40a87fa] | 104 | # [(qx1, qy1), (qx2, qy2), ...], [I(qx1,qy1), I(qx2,qy2), ...]], |
---|