Ticket #817: micelles_ellipsoid.py

File micelles_ellipsoid.py, 2.9 KB (added by pkienzle, 7 years ago)
Line 
1r"""
2
3This model provides the form factor, $P(q)$, for a micelle with a ellipsoidal
4core and Gaussian polymer chains attached to the surface, thus may be applied
5to block copolymer micelles. To work well the Gaussian chains must be much smaller
6than the core, which is often not the case.  Please study the reference carefully.
7
8Definition
9----------
10
11The 1D scattering intensity for this model is calculated according to
12the equations given by Pedersen (Pedersen, 2000).
13
14Validation
15----------
16
17This model has not yet been validated. Feb2015
18
19
20References
21----------
22
23J Pedersen, *J. Appl. Cryst.*, 33 (2000) 637-640
24
25"""
26
27from numpy import inf
28
29name = "polymer_micelle_ellipsoid"
30title = "Polymer micelle model"
31description = """
32    This model provides an approximate form factor, P(q), for a micelle with
33    a ellipsoidal core with Gaussian polymer chains attached to the surface.
34    """
35category = "shape:sphere"
36
37# pylint: disable=bad-whitespace, line-too-long
38#   ["name", "units", default, [lower, upper], "type","description"],
39parameters = [
40    ["ndensity",      "1e15/cm^3",  8.94, [0.0, inf], "", "Number density of micelles"],
41    ["v_core",        "Ang^3",  62624.0,  [0.0, inf], "", "Core volume "],
42    ["v_corona",      "Ang^3",  61940.0,  [0.0, inf], "", "Corona volume"],
43    ["sld_solvent",   "1e-6/Ang^2", 6.4,  [0.0, inf], "", "Solvent scattering length density"],
44    ["sld_core",      "1e-6/Ang^2", 0.34, [0.0, inf], "", "Core scattering length density"],
45    ["sld_corona",    "1e-6/Ang^2", 0.8,  [0.0, inf], "", "Corona scattering length density"],
46    ["radius_core",   "Ang",       40.0,  [0.0, inf], "", "Radius of core ( must be >> radius_gyr )"],
47    ["radius_gyr",    "Ang",       10.0,  [0.0, inf], "", "Radius of gyration of chains in corona"],
48    ["d_penetration", "",           1.0,  [-inf, inf], "", "Factor to mimic non-penetration of Gaussian chains"],
49    ["n_aggreg",      "",          67.0,  [-inf, inf], "", "Aggregation number of the micelle"],
50    ["epsilon",       "",           2.0,  [-inf, inf], "", "Nonpenetration parameters"],
51    ]
52# pylint: enable=bad-whitespace, line-too-long
53
54source = ["lib/sph_j1c.c", "micelles_ellipsoid.c"]
55
56demo = dict(scale=1, background=0,
57            ndensity=8.94,
58            v_core=62624.0,
59            v_corona=61940.0,
60            sld_solvent=6.4,
61            sld_core=0.34,
62            sld_corona=0.8,
63            radius_core=40.0,
64            radius_gyr=10.0,
65            d_penetration=1.0,
66            n_aggreg=67.0,
67            epsilon =2.0)
68tests = [
69    # Match the test case for polymer_micelle
70#    [{'epsilon':1.0, 'n_aggreg':6.0, 'radius_core':45., 'radius_gyr':20.},
71#     0.01, 15.3532],
72    ]
73# RKH 20Mar2016 - need to check whether the core & corona volumes are per monomer ??? and how aggregation number works!
74# renamed from micelle_ellipsoid_core to polymer_micelle, moved from shape-independent to ellipsoid section.
75# Ought to be able to add polydisp to core? And add ability to x by S(Q) ?