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