source: sasmodels/sasmodels/models/raspberry.py @ e481a39

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since e481a39 was bad8b12, checked in by butler, 8 years ago

conversion of RaspberryModel? - Andrew should Check the instabilities

  • Property mode set to 100644
File size: 4.3 KB
Line 
1r"""
2Definition
3----------
4
5The large and small spheres have their own SLD, as well as the solvent. The
6surface coverage term is a fractional coverage (maximum of approximately 0.9
7for hexagonally-packed spheres on a surface). Since not all of the small
8spheres are necessarily attached to the surface, the excess free (small)
9spheres scattering is also included in the calculation. The function calculate
10follows equations (8)-(12) of the reference below, and the equations are not
11reproduced here.
12
13No inter-particle scattering is included in this model.
14
15
16.. figure:: img/raspberry_geometry.jpg
17
18    Schematic of the raspberry model
19   
20where *Ro* is the radius of the large sphere, *Rp* the radius of the smaller
21spheres on the surface and |delta| = the fractional penetration depth.
22
23For 2D data: The 2D scattering intensity is calculated in the same way as 1D,
24where the *q* vector is defined as
25
26.. math::
27
28    q = \sqrt{q_x^2 + q_y^2}
29
30
31References
32----------
33
34K Larson-Smith, A Jackson, and D C Pozzo, *Small angle scattering model for Pickering emulsions and raspberry*
35*particles*, *Journal of Colloid and Interface Science*, 343(1) (2010) 36-41
36
37**Author:** Andrew jackson **on:** 2008
38
39**Modified by:** Paul Butler **on:** March 18, 2016
40
41**Reviewed by:** Paul Butler **on:** March 18, 2016
42"""
43
44from numpy import pi, inf
45
46name = "raspberry"
47title = "Calculates the form factor, *P(q)*, for a 'Raspberry-like' structure \
48where there are smaller spheres at the surface of a larger sphere, such as the \
49structure of a Pickering emulsion."
50description = """
51                RaspBerryModel:
52                volf_Lsph = volume fraction large spheres
53                radius_Lsph = radius large sphere (A)
54                sld_Lsph = sld large sphere (A-2)
55                volf_Ssph = volume fraction small spheres
56                radius_Ssph = radius small sphere (A)
57                surfrac_Ssph = fraction of small spheres at surface
58                sld_Ssph = sld small sphere
59                delta_Ssph = small sphere penetration (A)
60                sld_solv   = sld solvent
61                background = background (cm-1)
62            Ref: J. coll. inter. sci. (2010) vol. 343 (1) pp. 36-41."""
63category = "shape:sphere"
64
65#             [ "name", "units", default, [lower, upper], "type", "description"],
66parameters = [["sld_lg", "1e-6/Ang^2", -0.4, [-inf, inf], "",
67               "large particle scattering length density"],
68              ["sld_sm", "1e-6/Ang^2", 3.5, [-inf, inf], "",
69               "small particle scattering length density"],
70              ["sld_solvent", "1e-6/Ang^2", 6.36, [-inf, inf], "",
71               "solvent scattering length density"],
72              ["volfraction_lg", "", 0.05, [-inf, inf], "",
73               "volume fraction of large spheres"],
74              ["volfraction_sm", "", 0.005, [-inf, inf], "",
75               "volume fraction of small spheres"],
76              ["surf_fraction", "", 0.4, [-inf, inf], "",
77               "fraction of small spheres at surface"],
78              ["radius_lg", "Ang", 5000, [0, inf], "volume",
79               "radius of large spheres"],
80              ["radius_sm", "Ang", 100, [0, inf], "",
81               "radius of small spheres"],
82              ["penetration", "Ang", 0.0, [0, inf], "",
83               "penetration depth of small spheres into large sphere"],
84             ]
85
86source = ["lib/sph_j1c.c", "raspberry.c"]
87
88# parameters for demo
89demo = dict(scale=1, background=0.001,
90            sld_lg=-0.4, sld_sm=3.5, sld_solvent=6.36,
91            volfraction_lg=0.05, volfraction_sm=0.005, surf_fraction=0.4,
92            radius_lg=5000, radius_sm=100, penetration=0.0,
93            radius_lg_pd=.2, radius_lg_pd_n=10)
94
95# For testing against the old sasview models, include the converted parameter
96# names and the target sasview model name.
97oldname = 'RaspBerryModel'
98oldpars = dict(sld_lg='sld_Lsph', sld_sm='sld_Ssph', sld_solvent='sld_solv',
99               volfraction_lg='volf_Lsph', volfraction_sm='volf_Ssph',
100               surf_fraction='surfrac_Ssph',
101               radius_lg='radius_Lsph', radius_sm='radius_Ssph',
102               penetration='delta_Ssph')
103
104
105# NOTE: test results taken from values returned by SasView 3.1.2, with
106# 0.001 added for a non-zero default background.
107tests = [[{}, 0.0412755102041, 0.286669115234],
108         [{}, 0.5, 0.00103818393658],
109        ]
Note: See TracBrowser for help on using the repository browser.