1 | r""" |
---|
2 | This model provides the form factor, $P(q)$, for a flexible cylinder |
---|
3 | where the form factor is normalized by the volume of the cylinder. |
---|
4 | **Inter-cylinder interactions are NOT provided for.** |
---|
5 | |
---|
6 | .. math:: |
---|
7 | |
---|
8 | P(q) = \text{scale} \left<F^2\right>/V + \text{background} |
---|
9 | |
---|
10 | where the averaging $\left<\ldots\right>$ is applied only for the 1D |
---|
11 | calculation |
---|
12 | |
---|
13 | The 2D scattering intensity is the same as 1D, regardless of the orientation of |
---|
14 | the q vector which is defined as |
---|
15 | |
---|
16 | .. math:: |
---|
17 | |
---|
18 | q = \sqrt{q_x^2 + q_y^2} |
---|
19 | |
---|
20 | Definitions |
---|
21 | ----------- |
---|
22 | |
---|
23 | .. figure:: img/flexible_cylinder_geometry.jpg |
---|
24 | |
---|
25 | |
---|
26 | The chain of contour length, $L$, (the total length) can be described as a |
---|
27 | chain of some number of locally stiff segments of length $l_p$, the persistence |
---|
28 | length (the length along the cylinder over which the flexible cylinder can be |
---|
29 | considered a rigid rod). |
---|
30 | The Kuhn length $(b = 2*l_p)$ is also used to describe the stiffness of a chain. |
---|
31 | |
---|
32 | The returned value is in units of $cm^-1$, on absolute scale. |
---|
33 | |
---|
34 | In the parameters, the sldCyl and sldSolv represent the SLD of the chain/cylinder |
---|
35 | and solvent respectively. |
---|
36 | |
---|
37 | |
---|
38 | .. figure:: img/flexible_cylinder_1d.jpg |
---|
39 | |
---|
40 | 1D plot using the default values (w/1000 data point). |
---|
41 | |
---|
42 | |
---|
43 | Our model uses the form factor calculations implemented in a c-library provided |
---|
44 | by the NIST Center for Neutron Research (Kline, 2006). |
---|
45 | |
---|
46 | |
---|
47 | From the reference: |
---|
48 | |
---|
49 | 'Method 3 With Excluded Volume' is used. |
---|
50 | The model is a parametrization of simulations of a discrete representation |
---|
51 | of the worm-like chain model of Kratky and Porod applied in the |
---|
52 | pseudocontinuous limit. |
---|
53 | See equations (13,26-27) in the original reference for the details. |
---|
54 | |
---|
55 | References |
---|
56 | ---------- |
---|
57 | |
---|
58 | J S Pedersen and P Schurtenberger. *Scattering functions of semiflexible |
---|
59 | polymers with and without excluded volume effects.* Macromolecules, |
---|
60 | 29 (1996) 7602-7612 |
---|
61 | |
---|
62 | Correction of the formula can be found in |
---|
63 | |
---|
64 | W R Chen, P D Butler and L J Magid, *Incorporating Intermicellar Interactions |
---|
65 | in the Fitting of SANS Data from Cationic Wormlike Micelles.* Langmuir, |
---|
66 | 22(15) 2006 6539-6548 |
---|
67 | """ |
---|
68 | from numpy import inf |
---|
69 | |
---|
70 | name = "flexible_cylinder" |
---|
71 | title = "Flexible cylinder where the form factor is normalized by the volume" \ |
---|
72 | "of the cylinder." |
---|
73 | description = """Note : scale and contrast=sld-solvent_sld are both |
---|
74 | multiplicative factors in the model and are perfectly |
---|
75 | correlated. One or both of these parameters must be held fixed |
---|
76 | during model fitting. |
---|
77 | """ |
---|
78 | |
---|
79 | category = "shape:cylinder" |
---|
80 | single = False |
---|
81 | |
---|
82 | # pylint: disable=bad-whitespace, line-too-long |
---|
83 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
84 | parameters = [ |
---|
85 | ["length", "Ang", 1000.0, [0, inf], "volume", "Length of the flexible cylinder"], |
---|
86 | ["kuhn_length", "Ang", 100.0, [0, inf], "volume", "Kuhn length of the flexible cylinder"], |
---|
87 | ["radius", "Ang", 20.0, [0, inf], "volume", "Radius of the flexible cylinder"], |
---|
88 | ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", "Cylinder scattering length density"], |
---|
89 | ["solvent_sld", "1e-6/Ang^2", 6.3, [-inf, inf], "", "Solvent scattering length density"], |
---|
90 | ] |
---|
91 | # pylint: enable=bad-whitespace, line-too-long |
---|
92 | source = ["lib/J1.c", "lib/wrc_cyl.c", "flexible_cylinder.c"] |
---|
93 | |
---|
94 | demo = dict(scale=1.0, background=0.0001, |
---|
95 | length=1000.0, |
---|
96 | kuhn_length=100.0, |
---|
97 | radius=20.0, |
---|
98 | sld=1.0, |
---|
99 | solvent_sld=6.3) |
---|
100 | |
---|
101 | oldname = 'FlexibleCylinderModel' |
---|
102 | oldpars = dict(sld='sldCyl', solvent_sld='sldSolv') |
---|
103 | |
---|
104 | |
---|
105 | tests = [ |
---|
106 | # Accuracy tests based on content in test/utest_other_models.py |
---|
107 | # Currently fails in OCL |
---|
108 | # [{'length': 1000.0, |
---|
109 | # 'kuhn_length': 100.0, |
---|
110 | # 'radius': 20.0, |
---|
111 | # 'sld': 1.0, |
---|
112 | # 'solvent_sld': 6.3, |
---|
113 | # 'background': 0.0001, |
---|
114 | # }, 0.001, 3509.2187], |
---|
115 | |
---|
116 | # Additional tests with larger range of parameters |
---|
117 | [{'length': 1000.0, |
---|
118 | 'kuhn_length': 100.0, |
---|
119 | 'radius': 20.0, |
---|
120 | 'sld': 1.0, |
---|
121 | 'solvent_sld': 6.3, |
---|
122 | 'background': 0.0001, |
---|
123 | }, 1.0, 0.000595345], |
---|
124 | [{'length': 10.0, |
---|
125 | 'kuhn_length': 800.0, |
---|
126 | 'radius': 2.0, |
---|
127 | 'sld': 6.0, |
---|
128 | 'solvent_sld': 12.3, |
---|
129 | 'background': 0.001, |
---|
130 | }, 0.1, 1.55228], |
---|
131 | [{'length': 100.0, |
---|
132 | 'kuhn_length': 800.0, |
---|
133 | 'radius': 50.0, |
---|
134 | 'sld': 0.1, |
---|
135 | 'solvent_sld': 5.1, |
---|
136 | 'background': 0.0, |
---|
137 | }, 1.0, 0.000938456] |
---|
138 | ] |
---|
139 | |
---|