source: sasmodels/sasmodels/models/star_polymer.py @ 13ed84c

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 13ed84c was 13ed84c, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

set single=False on all models that fail the single precision tests

  • Property mode set to 100644
File size: 2.0 KB
Line 
1r"""
2Calculates the scattering from fractal-like aggregates based on
3the Mildner reference. This model is also known as the Benoit Star model.
4
5Definition
6----------
7
8For a star with $f$ arms the scattering intensity $I(q)$ is calculated as
9
10.. math::
11
12    I(q) = \frac{2}{fv^2}\left[ v-1+exp(-v)+\frac{f-1}{2}
13           \left[ 1-exp(-v)\right]^2\right]
14
15where
16
17.. math::
18
19    v=\frac{u^2f}{(3f-2)}
20
21and
22
23.. math::
24
25    u = \left\langle R_{g}^2\right\rangle q^2
26
27is the square of the ensemble average radius-of-gyration of an arm.
28
29.. figure:: img/star_polymer_1d.jpg
30
31    1D plot using the default values.
32
33
34Reference
35---------
36
37H Benoit *J. Polymer Science*, 11, 596-599 (1953)
38
39
40"""
41
42from numpy import inf
43
44name = "star_polymer"
45title = "Star polymer model with Gaussian statistics"
46description = """
47        Scattering model class for 'Star polymer with Gaussian statistics'
48        with
49        P(q) = 2/{fv^2} * (v - (1-exp(-v)) + {f-1}/2 * (1-exp(-v))^2)
50        where
51        - v = u^2f/(3f-2)
52        - u = <R_g^2>q^2, where <R_g^2> is the ensemble average radius of
53        giration squared of an arm
54        - f is the number of arms on the star
55        """
56category = "shape-independent"
57single = False
58# pylint: disable=bad-whitespace, line-too-long
59#             ["name", "units", default, [lower, upper], "type","description"],
60parameters = [["radius2", "Ang", 100.0, [0.0, inf], "", "Ensemble radius of gyration squared of an arm"],
61              ["arms",    "",      3,   [1.0, 6.0], "", "Number of arms in the model"],
62             ]
63# pylint: enable=bad-whitespace, line-too-long
64
65source = ["star_polymer.c"]
66
67demo = dict(scale=1, background=0,
68            radius2=100.0,
69            arms=3.0)
70
71oldname = 'StarPolymer'
72
73oldpars = dict(radius2='R2',
74               arms='arms')
75
76tests = [[{'radius2': 2.0,
77           'arms':    3.3,
78          }, 0.5, 0.850646091108],
79
80         [{'radius2':    1.0,
81           'arms':       2.0,
82           'background': 1.8,
83          }, 1.0, 2.53575888234],
84        ]
Note: See TracBrowser for help on using the repository browser.