[504abee] | 1 | r""" |
---|
| 2 | This model calculates the form factor for a flexible cylinder with an |
---|
| 3 | elliptical cross section and a uniform scattering length density. |
---|
| 4 | The non-negligible diameter of the cylinder is included by accounting |
---|
| 5 | for excluded volume interactions within the walk of a single cylinder. |
---|
| 6 | The form factor is normalized by the particle volume such that |
---|
| 7 | |
---|
| 8 | .. math:: |
---|
| 9 | |
---|
| 10 | P(q) = \text{scale} \left<F^2\right>/V + \text{background} |
---|
| 11 | |
---|
| 12 | where the averaging $\left<\ldots\right>$ is over all possible orientations |
---|
| 13 | of the flexible cylinder. |
---|
| 14 | |
---|
| 15 | The 2D scattering intensity is the same as 1D, regardless of the orientation |
---|
| 16 | of the q vector which is defined as |
---|
| 17 | |
---|
| 18 | .. math:: |
---|
| 19 | |
---|
| 20 | q = \sqrt{q_x^2 + q_y^2} |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | Definitions |
---|
| 24 | ----------- |
---|
| 25 | |
---|
| 26 | The function calculated is from the reference given below. From that paper, |
---|
| 27 | "Method 3 With Excluded Volume" is used. |
---|
| 28 | The model is a parameterization of simulations of a discrete representation of |
---|
| 29 | the worm-like chain model of Kratky and Porod applied in the pseudo-continuous |
---|
| 30 | limit. See equations (13, 26-27) in the original reference for the details. |
---|
| 31 | |
---|
| 32 | .. note:: |
---|
| 33 | |
---|
| 34 | There are several typos in the original reference that have been corrected |
---|
| 35 | by WRC. Details of the corrections are in the reference below. Most notably |
---|
| 36 | |
---|
| 37 | - Equation (13): the term $(1 - w(QR))$ should swap position with $w(QR)$ |
---|
| 38 | |
---|
| 39 | - Equations (23) and (24) are incorrect; WRC has entered these into |
---|
| 40 | Mathematica and solved analytically. The results were then converted to |
---|
| 41 | code. |
---|
| 42 | |
---|
| 43 | - Equation (27) should be $q0 = max(a3/sqrt(RgSquare),3)$ instead of |
---|
| 44 | $max(a3*b/sqrt(RgSquare),3)$ |
---|
| 45 | |
---|
| 46 | - The scattering function is negative for a range of parameter values and |
---|
| 47 | q-values that are experimentally accessible. A correction function has been |
---|
| 48 | added to give the proper behavior. |
---|
| 49 | |
---|
| 50 | .. figure:: img/flexible_cylinder_ex_geometry.jpg |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | The chain of contour length, $L$, (the total length) can be described as a chain |
---|
| 54 | of some number of locally stiff segments of length $l_p$, the persistence length |
---|
| 55 | (the length along the cylinder over which the flexible cylinder can be considered |
---|
| 56 | a rigid rod). |
---|
| 57 | The Kuhn length $(b = 2*l_p)$ is also used to describe the stiffness of a chain. |
---|
| 58 | |
---|
| 59 | The cross section of the cylinder is elliptical, with minor radius $a$ . |
---|
| 60 | The major radius is larger, so of course, **the axis ratio (parameter 5) must be |
---|
| 61 | greater than one.** Simple constraints should be applied during curve fitting to |
---|
| 62 | maintain this inequality. |
---|
| 63 | |
---|
| 64 | The returned value is in units of $cm^-1$, on absolute scale. |
---|
| 65 | |
---|
| 66 | In the parameters, the $sldCyl$ and $sldSolv$ represent the SLD of the |
---|
| 67 | chain/cylinder and solvent respectively. The *scale*, and the contrast are both |
---|
| 68 | multiplicative factors in the model and are perfectly correlated. One or both of |
---|
| 69 | these parameters must be held fixed during model fitting. |
---|
| 70 | |
---|
| 71 | **No inter-cylinder interference effects are included in this calculation.** |
---|
| 72 | |
---|
| 73 | .. figure:: img/flexible_cylinder_ex_1d.jpg |
---|
| 74 | |
---|
| 75 | 1D plot using the default values (w/1000 data point). |
---|
| 76 | |
---|
| 77 | References |
---|
| 78 | ---------- |
---|
| 79 | |
---|
| 80 | J S Pedersen and P Schurtenberger. *Scattering functions of semiflexible polymers |
---|
| 81 | with and without excluded volume effects.* Macromolecules, 29 (1996) 7602-7612 |
---|
| 82 | |
---|
| 83 | Correction of the formula can be found in |
---|
| 84 | |
---|
| 85 | W R Chen, P D Butler and L J Magid, *Incorporating Intermicellar Interactions in |
---|
| 86 | the Fitting of SANS Data from Cationic Wormlike Micelles.* Langmuir, |
---|
| 87 | 22(15) 2006 6539-6548 |
---|
| 88 | """ |
---|
| 89 | from numpy import inf |
---|
| 90 | |
---|
| 91 | name = "flexible_cylinder_ex" |
---|
| 92 | title = "Flexible cylinder wth an elliptical cross section and a uniform " \ |
---|
| 93 | "scattering length density." |
---|
| 94 | description = """Note : scale and contrast=sldCyl-sldSolv are both multiplicative |
---|
| 95 | factors in the |
---|
| 96 | model and are perfectly correlated. One or |
---|
| 97 | both of these parameters must be held fixed |
---|
| 98 | during model fitting. |
---|
| 99 | """ |
---|
[13ed84c] | 100 | single = False |
---|
[504abee] | 101 | |
---|
| 102 | category = "shape:cylinder" |
---|
| 103 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 104 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
| 105 | parameters = [ |
---|
| 106 | ["length", "Ang", 1000.0, [0, inf], "volume", "Length of the flexible cylinder"], |
---|
| 107 | ["kuhn_length", "Ang", 100.0, [0, inf], "volume", "Kuhn length of the flexible cylinder"], |
---|
| 108 | ["radius", "Ang", 20.0, [0, inf], "volume", "Radius of the flexible cylinder"], |
---|
| 109 | ["axis_ratio", "", 1.5, [0, inf], "", "Axis_ratio (major_radius/radius"], |
---|
| 110 | ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", "Cylinder scattering length density"], |
---|
| 111 | ["solvent_sld", "1e-6/Ang^2", 6.3, [-inf, inf], "", "Solvent scattering length density"], |
---|
| 112 | ] |
---|
| 113 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 114 | |
---|
| 115 | source = ["lib/J1.c", "lib/gauss76.c", "lib/wrc_cyl.c", "flexible_cylinder_ex.c"] |
---|
| 116 | |
---|
| 117 | demo = dict(scale=1.0, background=0.0001, |
---|
| 118 | length=1000.0, |
---|
| 119 | kuhn_length=100.0, |
---|
| 120 | radius=20.0, |
---|
| 121 | axis_ratio=1.5, |
---|
| 122 | sld=1.0, |
---|
| 123 | solvent_sld=6.3) |
---|
| 124 | |
---|
| 125 | oldname = 'FlexCylEllipXModel' |
---|
| 126 | oldpars = dict(sld='sldCyl', solvent_sld='sldSolv') |
---|
| 127 | |
---|
| 128 | |
---|
| 129 | tests = [ |
---|
| 130 | # Accuracy tests based on content in test/utest_other_models.py |
---|
| 131 | # Currently fails in OCL |
---|
| 132 | # [{'length': 1000.0, |
---|
| 133 | # 'kuhn_length': 100.0, |
---|
| 134 | # 'radius': 20.0, |
---|
| 135 | # 'axis_ratio': 1.5, |
---|
| 136 | # 'sld': 1.0, |
---|
| 137 | # 'solvent_sld': 6.3, |
---|
| 138 | # 'background': 0.0001, |
---|
| 139 | # }, 0.001, 3509.2187], |
---|
| 140 | |
---|
| 141 | # Additional tests with larger range of parameters |
---|
| 142 | [{'length': 1000.0, |
---|
| 143 | 'kuhn_length': 100.0, |
---|
| 144 | 'radius': 20.0, |
---|
| 145 | 'axis_ratio': 1.5, |
---|
| 146 | 'sld': 1.0, |
---|
| 147 | 'solvent_sld': 6.3, |
---|
| 148 | 'background': 0.0001, |
---|
| 149 | }, 1.0, 0.00223819], |
---|
| 150 | [{'length': 10.0, |
---|
| 151 | 'kuhn_length': 800.0, |
---|
| 152 | 'radius': 2.0, |
---|
| 153 | 'axis_ratio': 0.5, |
---|
| 154 | 'sld': 6.0, |
---|
| 155 | 'solvent_sld': 12.3, |
---|
| 156 | 'background': 0.001, |
---|
| 157 | }, 0.1, 0.390281], |
---|
| 158 | [{'length': 100.0, |
---|
| 159 | 'kuhn_length': 800.0, |
---|
| 160 | 'radius': 50.0, |
---|
| 161 | 'axis_ratio': 4.5, |
---|
| 162 | 'sld': 0.1, |
---|
| 163 | 'solvent_sld': 5.1, |
---|
| 164 | 'background': 0.0, |
---|
| 165 | }, 1.0, 0.0016338264790] |
---|
| 166 | ] |
---|
| 167 | |
---|