Changeset 15bd6e7 in sasmodels for sasmodels/models/mono_gauss_coil.py
- Timestamp:
- Mar 17, 2016 9:38:20 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:
- 54954e1
- Parents:
- 4373d62
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/mono_gauss_coil.py
raa2edb2 r15bd6e7 14 14 15 15 *I(q)* = *scale* |cdot| *I* \ :sub:`0` |cdot| *P(q)* + *background* 16 16 17 17 where 18 18 … … 20 20 21 21 *P(q)* = 2 [exp(-Z) + Z - 1] / Z \ :sup:`2` 22 23 22 23 *Z* = (*q R* \ :sub:`g`)\ :sup:`2` 24 24 25 25 and 26 26 27 28 27 *V* = *M* / (*N*\ :sub:`A` |delta|) 28 29 29 Here, |phi|\ :sub:`poly` is the volume fraction of polymer, *V* is the volume of a polymer coil, *M* is the molecular weight of the polymer, *N*\ :sub:`A` is Avogadro's Number, |delta| is the bulk density of the polymer, |rho|\ :sub:`poly` is the sld of the polymer, |rho|\ :sub:`solv` is the sld of the solvent, and *R*\ :sub:`g` is the radius of gyration of the polymer coil. 30 30 … … 52 52 description = """ 53 53 Evaluates the scattering from 54 54 monodisperse polymer chains. 55 55 """ 56 56 category = "shape-independent" 57 57 58 58 # ["name", "units", default, [lower, upper], "type", "description"], 59 parameters = [["i_zero", "1/cm", 1.0, [-inf, inf], "", "Intensity at q=0"],60 ["radius_gyration", "Ang", 50.0, [0.0, inf], "", "Radius of gyration"]]59 parameters = [["i_zero", "1/cm", 70.0, [0.0, inf], "", "Intensity at q=0"], 60 ["radius_gyration", "Ang", 75.0, [0.0, inf], "", "Radius of gyration"]] 61 61 62 62 # NB: Scale and Background are implicit parameters on every model 63 63 def Iq(q, i_zero, radius_gyration): 64 64 # pylint: disable = missing-docstring 65 z = (q * radius_gyration) * * 266 if q == 0:67 inten = 1.065 z = (q * radius_gyration) * (q * radius_gyration) 66 if (q == 0).any(): 67 inten = i_zero 68 68 else: 69 69 inten = i_zero * 2.0 * (exp(-z) + z - 1.0 ) / (z * z) … … 77 77 78 78 demo = dict(scale = 1.0, 79 i_zero = 1.0,80 radius_gyration = 50.0,79 i_zero = 70.0, 80 radius_gyration = 75.0, 81 81 background = 0.0) 82 82 … … 87 87 88 88 tests = [ 89 [{'scale': 1.0, 'radius_gyration': 50.0, 'background': 0.0},90 [0.0106939, 0.469418], [ 0.911141, 0.00362394]],89 [{'scale': 70.0, 'radius_gyration': 75.0, 'background': 0.0}, 90 [0.0106939, 0.469418], [57.1241, 0.112859]], 91 91 ]
Note: See TracChangeset
for help on using the changeset viewer.