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