[321736f] | 1 | r""" |
---|
| 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
| 5 | The 1D scattering intensity is calculated in the following way (Guinier, 1955) |
---|
| 6 | |
---|
| 7 | .. math:: |
---|
| 8 | |
---|
| 9 | P(q) = \frac{\text{scale}}{V_\text{shell}} \left[ |
---|
| 10 | \frac{3V_{\text{core}}({\rho_{\text{solvent}} |
---|
| 11 | - \rho_{\text{shell}})j_1(qR_{\text{core}})}}{qR_{\text{core}}} |
---|
| 12 | + \frac{3V_{\text{tot}}(\rho_{\text{shell}} |
---|
| 13 | - \rho_{\text{solvent}}) j_1(qR_{\text{tot}})}{qR_{\text{tot}}} |
---|
| 14 | \right]^2 + \text{background} |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | where scale is a scale factor equivalent to the volume fraction of shell |
---|
| 18 | material if the data is on an absolute scale, $V_{shell}$ is the volume of the |
---|
| 19 | shell, $V_{\text{cor}}$ is the volume of the core, $V_{\text{tot}}$ is the |
---|
| 20 | total volume, $R_{\text{core}}$ is the radius of the core, $R_{\text{tot}}$ is |
---|
| 21 | the outer radius of the shell, $\rho_{\text{solvent}}$ is the scattering length |
---|
| 22 | density of the solvent (which is the same as for the core in this case), |
---|
| 23 | $\rho_{\text{scale}}$ is the scattering length density of the shell, background |
---|
| 24 | is a flat background level (due for example to incoherent scattering in the |
---|
| 25 | case of neutrons), and $j_1$ is the spherical bessel function |
---|
[fa8011eb] | 26 | $j_1 = (\sin(x) - x \cos(x))/ x^2$. |
---|
[321736f] | 27 | |
---|
| 28 | The functional form is identical to a "typical" core-shell structure, except |
---|
| 29 | that the scattering is normalized by the volume that is contributing to the |
---|
| 30 | scattering, namely the volume of the shell alone, the scattering length density |
---|
| 31 | of the core is fixed the same as that of the solvent, the scale factor when the |
---|
| 32 | data are on an absolute scale is equivalent to the volume fraction of material |
---|
| 33 | in the shell rather than the entire core+shell sphere, and the parameterization |
---|
| 34 | is done in terms of the core radius = $R_{\text{core}}$ and the shell |
---|
| 35 | thickness = $R_{\text{tot}} - R_{\text{core}}$. |
---|
| 36 | |
---|
[fa8011eb] | 37 | .. figure:: img/vesicle_geometry.jpg |
---|
| 38 | |
---|
| 39 | Vesicle geometry. |
---|
[321736f] | 40 | |
---|
| 41 | The 2D scattering intensity is the same as *P(q)* above, regardless of the |
---|
| 42 | orientation of the *q* vector which is defined as |
---|
| 43 | |
---|
| 44 | .. math:: |
---|
| 45 | |
---|
| 46 | q = \sqrt{q_x^2 + q_y^2} |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | NB: The outer most radius (= *radius* + *thickness*) is used as the effective |
---|
| 50 | radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied. |
---|
| 51 | |
---|
| 52 | |
---|
[aa2edb2] | 53 | References |
---|
| 54 | ---------- |
---|
[321736f] | 55 | |
---|
| 56 | A Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and |
---|
| 57 | Sons, New York, (1955) |
---|
| 58 | """ |
---|
| 59 | |
---|
| 60 | from numpy import pi, inf |
---|
| 61 | |
---|
| 62 | name = "vesicle" |
---|
| 63 | title = "This model provides the form factor, *P(q)*, for an unilamellar \ |
---|
| 64 | vesicle. This is model is effectively identical to the hollow sphere \ |
---|
[216fa6d] | 65 | reparameterized to be more intuitive for a vesicle and normalizing the \ |
---|
| 66 | form factor by the volume of the shell." |
---|
[321736f] | 67 | description = """ |
---|
| 68 | Model parameters: |
---|
| 69 | radius : the core radius of the vesicle |
---|
| 70 | thickness: the shell thickness |
---|
| 71 | sld: the shell SLD |
---|
| 72 | solvent_sld: the solvent (and core) SLD |
---|
| 73 | background: incoherent background |
---|
| 74 | scale : scale factor = shell volume fraction if on absolute scale""" |
---|
| 75 | category = "shape:sphere" |
---|
| 76 | |
---|
| 77 | # [ "name", "units", default, [lower, upper], "type", "description"], |
---|
| 78 | parameters = [["sld", "1e-6/Ang^2", 0.5, [-inf, inf], "", |
---|
| 79 | "vesicle shell scattering length density"], |
---|
| 80 | ["solvent_sld", "1e-6/Ang^2", 6.36, [-inf, inf], "", |
---|
| 81 | "solvent scattering length density"], |
---|
| 82 | ["radius", "Ang", 100, [0, inf], "volume", |
---|
| 83 | "vesicle core radius"], |
---|
| 84 | ["thickness", "Ang", 30, [0, inf], "volume", |
---|
| 85 | "vesicle shell thickness"], |
---|
| 86 | ] |
---|
| 87 | |
---|
| 88 | source = ["lib/sph_j1c.c", "vesicle.c"] |
---|
| 89 | |
---|
| 90 | def ER(radius, thickness): |
---|
| 91 | ''' |
---|
| 92 | returns the effective radius used in the S*P calculation |
---|
| 93 | |
---|
| 94 | :param radius: core radius |
---|
| 95 | :param thickness: shell thickness |
---|
| 96 | ''' |
---|
| 97 | return radius + thickness |
---|
| 98 | |
---|
| 99 | def VR(radius, thickness): |
---|
| 100 | ''' |
---|
| 101 | returns the volumes of the shell and of the whole sphere including the |
---|
| 102 | core plus shell - is used to normalize when including polydispersity. |
---|
| 103 | |
---|
| 104 | :param radius: core radius |
---|
| 105 | :param thickness: shell thickness |
---|
| 106 | :return whole: volume of core and shell |
---|
| 107 | :return whole-core: volume of the shell |
---|
| 108 | ''' |
---|
| 109 | |
---|
| 110 | whole = 4. * pi * (radius + thickness) ** 3. / 3. |
---|
| 111 | core = 4. * pi * radius ** 3. / 3. |
---|
| 112 | return whole, whole - core |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | # parameters for demo |
---|
| 116 | demo = dict(scale=1, background=0, |
---|
| 117 | sld=0.5, solvent_sld=6.36, |
---|
| 118 | radius=100, thickness=30, |
---|
| 119 | radius_pd=.2, radius_pd_n=10, |
---|
| 120 | thickness_pd=.2, thickness_pd_n=10) |
---|
| 121 | |
---|
| 122 | # For testing against the old sasview models, include the converted parameter |
---|
| 123 | # names and the target sasview model name. |
---|
| 124 | oldname = 'VesicleModel' |
---|
| 125 | oldpars = dict(sld='shell_sld', solvent_sld='solv_sld') |
---|
| 126 | |
---|
| 127 | |
---|
[6dd90c1] | 128 | # NOTE: test results taken from values returned by SasView 3.1.2, with |
---|
| 129 | # 0.001 added for a non-zero default background. |
---|
| 130 | tests = [[{}, 0.0010005303255, 17139.8278799], |
---|
| 131 | [{}, 0.200027832249, 0.131387268704], |
---|
[321736f] | 132 | [{}, 'ER', 130.], |
---|
| 133 | [{}, 'VR', 0.54483386436], |
---|
| 134 | ] |
---|