[dc02af0] | 1 | # Note: model title and parameter table are inserted automatically |
---|
| 2 | r""" |
---|
[eb69cce] | 3 | This model provides the scattering intensity, $I(q)$, for a lyotropic lamellar |
---|
[3c56da87] | 4 | phase where a random distribution in solution are assumed. The SLD of the head |
---|
| 5 | region is taken to be different from the SLD of the tail region. |
---|
[dc02af0] | 6 | |
---|
[d138d43] | 7 | Definition |
---|
| 8 | ---------- |
---|
[dc02af0] | 9 | |
---|
[d138d43] | 10 | The scattering intensity $I(q)$ is |
---|
[dc02af0] | 11 | |
---|
| 12 | .. math:: |
---|
| 13 | |
---|
[d138d43] | 14 | I(q) = 2\pi\frac{\text{scale}}{2(\delta_H + \delta_T)} P(q) \frac{1}{q^2} |
---|
[dc02af0] | 15 | |
---|
[d138d43] | 16 | The form factor $P(q)$ is |
---|
[dc02af0] | 17 | |
---|
[d138d43] | 18 | .. math:: |
---|
| 19 | |
---|
| 20 | P(q) = \frac{4}{q^2} |
---|
| 21 | \left\lbrace |
---|
| 22 | \Delta \rho_H |
---|
| 23 | \left[\sin[q(\delta_H + \delta_T)\ - \sin(q\delta_T)\right] |
---|
| 24 | + \Delta\rho_T\sin(q\delta_T) |
---|
| 25 | \right\rbrace^2 |
---|
[dc02af0] | 26 | |
---|
[a807206] | 27 | where $\delta_T$ is *length_tail*, $\delta_H$ is *length_head*, |
---|
[6ab4ed8] | 28 | $\Delta\rho_H$ is the head contrast (*sld_head* $-$ *sld_solvent*), |
---|
| 29 | and $\Delta\rho_T$ is tail contrast (*sld* $-$ *sld_solvent*). |
---|
[dc02af0] | 30 | |
---|
[40a87fa] | 31 | The total thickness of the lamellar sheet is $\delta_H + \delta_T + \delta_T + \delta_H$. |
---|
| 32 | Note that in a non aqueous solvent the chemical "head" group may be the |
---|
[52a3db3] | 33 | "Tail region" and vice-versa. |
---|
| 34 | |
---|
[3c56da87] | 35 | The 2D scattering intensity is calculated in the same way as 1D, where |
---|
[eb69cce] | 36 | the $q$ vector is defined as |
---|
[dc02af0] | 37 | |
---|
[40a87fa] | 38 | .. math:: q = \sqrt{q_x^2 + q_y^2} |
---|
[dc02af0] | 39 | |
---|
[d138d43] | 40 | References |
---|
| 41 | ---------- |
---|
[dc02af0] | 42 | |
---|
| 43 | F Nallet, R Laversanne, and D Roux, J. Phys. II France, 3, (1993) 487-502 |
---|
| 44 | |
---|
| 45 | also in J. Phys. Chem. B, 105, (2001) 11081-11088 |
---|
| 46 | |
---|
| 47 | *2014/04/17 - Description reviewed by S King and P Butler.* |
---|
| 48 | """ |
---|
| 49 | |
---|
[2d81cfe] | 50 | import numpy as np |
---|
[3c56da87] | 51 | from numpy import inf |
---|
[dc02af0] | 52 | |
---|
[6ab4ed8] | 53 | name = "lamellar_hg" |
---|
| 54 | title = "Random lamellar phase with Head and Tail Groups" |
---|
[dc02af0] | 55 | description = """\ |
---|
[6ab4ed8] | 56 | [Random lamellar phase with Head and Tail Groups] |
---|
[3e428ec] | 57 | I(q)= 2*pi*P(q)/(2(H+T)*q^(2)), where |
---|
| 58 | P(q)= see manual |
---|
| 59 | layer thickness =(H+T+T+H) = 2(Head+Tail) |
---|
| 60 | sld = Tail scattering length density |
---|
[6ab4ed8] | 61 | sld_head = Head scattering length density |
---|
| 62 | sld_solvent = solvent scattering length density |
---|
[3e428ec] | 63 | background = incoherent background |
---|
| 64 | scale = scale factor |
---|
[dc02af0] | 65 | """ |
---|
[a5d0d00] | 66 | category = "shape:lamellae" |
---|
[dc02af0] | 67 | |
---|
[3eb6b90] | 68 | # pylint: disable=bad-whitespace, line-too-long |
---|
[3e428ec] | 69 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
[a807206] | 70 | parameters = [["length_tail", "Ang", 15, [0, inf], "volume", "Tail thickness ( total = H+T+T+H)"], |
---|
| 71 | ["length_head", "Ang", 10, [0, inf], "volume", "Head thickness"], |
---|
[42356c8] | 72 | ["sld", "1e-6/Ang^2", 0.4, [-inf,inf], "sld", "Tail scattering length density"], |
---|
| 73 | ["sld_head", "1e-6/Ang^2", 3.0, [-inf,inf], "sld", "Head scattering length density"], |
---|
| 74 | ["sld_solvent", "1e-6/Ang^2", 6, [-inf,inf], "sld", "Solvent scattering length density"]] |
---|
[3eb6b90] | 75 | # pylint: enable=bad-whitespace, line-too-long |
---|
[dc02af0] | 76 | |
---|
| 77 | # No volume normalization despite having a volume parameter |
---|
| 78 | # This should perhaps be volume normalized? |
---|
| 79 | form_volume = """ |
---|
| 80 | return 1.0; |
---|
| 81 | """ |
---|
| 82 | |
---|
| 83 | Iq = """ |
---|
| 84 | const double qsq = q*q; |
---|
[6ab4ed8] | 85 | const double drh = sld_head - sld_solvent; |
---|
| 86 | const double drt = sld - sld_solvent; //correction 13FEB06 by L.Porcar |
---|
[a807206] | 87 | const double qT = q*length_tail; |
---|
[3c56da87] | 88 | double Pq, inten; |
---|
[a807206] | 89 | Pq = drh*(sin(q*(length_head+length_tail))-sin(qT)) + drt*sin(qT); |
---|
[3c56da87] | 90 | Pq *= Pq; |
---|
| 91 | Pq *= 4.0/(qsq); |
---|
| 92 | |
---|
| 93 | inten = 2.0e-4*M_PI*Pq/qsq; |
---|
| 94 | |
---|
| 95 | // normalize by the bilayer thickness |
---|
[a807206] | 96 | inten /= 2.0*(length_head+length_tail); |
---|
[3c56da87] | 97 | |
---|
| 98 | return inten; |
---|
[dc02af0] | 99 | """ |
---|
[3c56da87] | 100 | |
---|
[404ebbd] | 101 | def random(): |
---|
| 102 | thickness = 10**np.random.uniform(1, 4) |
---|
| 103 | length_head = thickness * np.random.uniform(0, 1) |
---|
| 104 | length_tail = thickness - length_head |
---|
| 105 | pars = dict( |
---|
| 106 | length_head=length_head, |
---|
| 107 | length_tail=length_tail, |
---|
| 108 | ) |
---|
| 109 | return pars |
---|
| 110 | |
---|
[dc02af0] | 111 | # ER defaults to 0.0 |
---|
| 112 | # VR defaults to 1.0 |
---|
| 113 | |
---|
[3e428ec] | 114 | demo = dict(scale=1, background=0, |
---|
[a807206] | 115 | length_tail=15, length_head=10, |
---|
[6ab4ed8] | 116 | sld=0.4, sld_head=3.0, sld_solvent=6.0, |
---|
[a807206] | 117 | length_tail_pd=0.2, length_tail_pd_n=40, |
---|
| 118 | length_head_pd=0.01, length_head_pd_n=40) |
---|
[3c56da87] | 119 | |
---|
[7f47777] | 120 | # |
---|
[40a87fa] | 121 | tests = [ |
---|
[a807206] | 122 | [{'scale': 1.0, 'background': 0.0, 'length_tail': 15.0, 'length_head': 10.0, |
---|
[40a87fa] | 123 | 'sld': 0.4, 'sld_head': 3.0, 'sld_solvent': 6.0}, |
---|
| 124 | [0.001], [653143.9209]], |
---|
| 125 | ] |
---|
| 126 | # ADDED by: RKH ON: 18Mar2016 converted from sasview previously, now renaming everything & sorting the docs |
---|