source: sasmodels/sasmodels/models/star_polymer.py @ bd21b12

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since bd21b12 was 48462b0, checked in by Paul Kienzle <pkienzle@…>, 7 years ago

tuned random model generation for even more models

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[55b283e8]1r"""
[40a87fa]2The Benoit model for a simple star polymer, with Gaussian coils arms from
[6b4f7f6]3a common point.
[55b283e8]4
5Definition
6----------
7
8For a star with $f$ arms the scattering intensity $I(q)$ is calculated as
9
10.. math::
11
[40a87fa]12    I(q) = \frac{2}{fv^2}\left[ v-1+\exp(-v)+\frac{f-1}{2}
13           \left[ 1-\exp(-v)\right]^2\right]
[55b283e8]14
15where
16
[40a87fa]17.. math:: v=\frac{u^2f}{(3f-2)}
[55b283e8]18
19and
20
[40a87fa]21.. math:: u = \left\langle R_{g}^2\right\rangle q^2
[55b283e8]22
[40a87fa]23contains the square of the ensemble average radius-of-gyration of an arm.
24Note that when there is only one arm, $f = 1$, the Debye Gaussian coil
25equation is recovered. Star polymers in solutions tend to have strong
26interparticle and osmotic effects, so the Benoit equation may not work well.
27At small $q$ the Guinier term and hence $I(q=0)$ is the same as for $f$ arms
28of radius of gyration $R_g$, as described for the :ref:`mono-gauss-coil` model.
[55b283e8]29
[6b4f7f6]30References
31----------
[55b283e8]32
33H Benoit *J. Polymer Science*, 11, 596-599 (1953)
34"""
35
36from numpy import inf
37
38name = "star_polymer"
39title = "Star polymer model with Gaussian statistics"
40description = """
[6b4f7f6]41        Benoit 'Star polymer with Gaussian statistics'
[55b283e8]42        with
43        P(q) = 2/{fv^2} * (v - (1-exp(-v)) + {f-1}/2 * (1-exp(-v))^2)
44        where
45        - v = u^2f/(3f-2)
46        - u = <R_g^2>q^2, where <R_g^2> is the ensemble average radius of
[6b4f7f6]47        gyration squared of an arm
[55b283e8]48        - f is the number of arms on the star
49        """
50category = "shape-independent"
[13ed84c]51single = False
[168052c]52# pylint: disable=bad-whitespace, line-too-long
[55b283e8]53#             ["name", "units", default, [lower, upper], "type","description"],
[6b4f7f6]54parameters = [["rg_squared", "Ang^2", 100.0, [0.0, inf], "", "Ensemble radius of gyration SQUARED of an arm"],
[55b283e8]55              ["arms",    "",      3,   [1.0, 6.0], "", "Number of arms in the model"],
[168052c]56             ]
57# pylint: enable=bad-whitespace, line-too-long
[55b283e8]58
59source = ["star_polymer.c"]
60
[48462b0]61def random():
62    import numpy as np
63    pars = dict(
64        #background=0,
65        scale=10**np.random.uniform(1, 4),
66        rg_squared=10**np.random.uniform(1, 8),
67        arms=np.random.uniform(1, 6),
68    )
69    return pars
[55b283e8]70
[6b4f7f6]71tests = [[{'rg_squared': 2.0,
[55b283e8]72           'arms':    3.3,
[6dd90c1]73          }, 0.5, 0.851646091108],
[55b283e8]74
[6b4f7f6]75         [{'rg_squared':    1.0,
[55b283e8]76           'arms':       2.0,
77           'background': 1.8,
[168052c]78          }, 1.0, 2.53575888234],
79        ]
[40a87fa]80# 23Mar2016  RKH edited docs, would this better use rg not rg^2 ? Numerical noise at extremely small q.rg
Note: See TracBrowser for help on using the repository browser.