Changeset 168052c in sasmodels for sasmodels/models/flexible_cylinder.py
- Timestamp:
- Jan 29, 2016 6:02:35 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- ed82794
- Parents:
- bf6631a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/flexible_cylinder.py
rf94d8a2 r168052c 1 1 r""" 2 This model provides the form factor, $P(q)$, for a flexible cylinder where the form factor3 is normalized by the volume of the cylinder.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 4 **Inter-cylinder interactions are NOT provided for.** 5 5 … … 8 8 P(q) = \text{scale} \left<F^2\right>/V + \text{background} 9 9 10 where the averaging $\left<\ldots\right>$ is applied only for the 1D calculation 10 where the averaging $\left<\ldots\right>$ is applied only for the 1D 11 calculation 11 12 12 The 2D scattering intensity is the same as 1D, regardless of the orientation of the q vector which is defined as 13 The 2D scattering intensity is the same as 1D, regardless of the orientation of 14 the q vector which is defined as 13 15 14 16 .. math:: … … 22 24 23 25 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). 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). 27 30 The Kuhn length $(b = 2*l_p)$ is also used to describe the stiffness of a chain. 28 31 29 32 The returned value is in units of $cm^-1$, on absolute scale. 30 33 31 In the parameters, the sldCyl and sldSolv represent the SLD of the chain/cylinder and solvent respectively. 34 In the parameters, the sldCyl and sldSolv represent the SLD of the chain/cylinder 35 and solvent respectively. 32 36 33 37 … … 37 41 38 42 39 Our model uses the form factor calculations implemented in a c-library provided by the NIST Center40 for Neutron Research (Kline, 2006).43 Our model uses the form factor calculations implemented in a c-library provided 44 by the NIST Center for Neutron Research (Kline, 2006). 41 45 42 46 … … 45 49 'Method 3 With Excluded Volume' is used. 46 50 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. 51 of the worm-like chain model of Kratky and Porod applied in the 52 pseudocontinuous limit. 48 53 See equations (13,26-27) in the original reference for the details. 49 54 … … 51 56 ---------- 52 57 53 J S Pedersen and P Schurtenberger. *Scattering functions of semiflexible polymers with and 54 without excluded volume effects.* Macromolecules, 29 (1996) 7602-7612 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 55 61 56 62 Correction of the formula can be found in 57 63 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 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 60 67 """ 61 68 from numpy import inf 62 69 63 70 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 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 68 76 during model fitting. 69 77 """ … … 71 79 category = "shape:cylinder" 72 80 81 # pylint: disable=bad-whitespace, line-too-long 73 82 # ["name", "units", default, [lower, upper], "type", "description"], 74 83 parameters = [ 75 76 77 78 79 80 81 84 ["length", "Ang", 1000.0, [0, inf], "volume", "Length of the flexible cylinder"], 85 ["kuhn_length", "Ang", 100.0, [0, inf], "volume", "Kuhn length of the flexible cylinder"], 86 ["radius", "Ang", 20.0, [0, inf], "volume", "Radius of the flexible cylinder"], 87 ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", "Cylinder scattering length density"], 88 ["solvent_sld", "1e-6/Ang^2", 6.3, [-inf, inf], "", "Solvent scattering length density"], 89 ] 90 # pylint: enable=bad-whitespace, line-too-long 82 91 source = ["lib/J1.c", "lib/wrc_cyl.c", "flexible_cylinder.c"] 83 92 … … 94 103 95 104 tests = [ 96 97 98 99 100 101 102 103 104 105 # Accuracy tests based on content in test/utest_other_models.py 106 # Currently fails in OCL 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 # }, 0.001, 3509.2187], 105 114 106 107 [{'length':1000.0,108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 115 # Additional tests with larger range of parameters 116 [{'length': 1000.0, 117 'kuhn_length': 100.0, 118 'radius': 20.0, 119 'sld': 1.0, 120 'solvent_sld': 6.3, 121 'background': 0.0001, 122 }, 1.0, 0.000595345], 123 [{'length': 10.0, 124 'kuhn_length': 800.0, 125 'radius': 2.0, 126 'sld': 6.0, 127 'solvent_sld': 12.3, 128 'background': 0.001, 129 }, 0.1, 1.55228], 130 [{'length': 100.0, 131 'kuhn_length': 800.0, 132 'radius': 50.0, 133 'sld': 0.1, 134 'solvent_sld': 5.1, 135 'background': 0.0, 136 }, 1.0, 0.000938456] 137 ] 129 138
Note: See TracChangeset
for help on using the changeset viewer.