Changeset a807206 in sasmodels for sasmodels/models/correlation_length.py
- Timestamp:
- Sep 30, 2016 10:42:06 PM (7 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:
- caddb14, 5031ca3
- Parents:
- 2222134
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/correlation_length.py
r40a87fa ra807206 16 16 multiplicative factors $A$ and $C$, and the two exponents $n$ and $m$ are 17 17 used as fitting parameters. (Respectively *porod_scale*, *lorentz_scale*, 18 * exponent_p* and *exponent_l* in the parameter list.) The remaining18 *porod_exp* and *lorentz_exp* in the parameter list.) The remaining 19 19 parameter $\xi$ (*cor_length* in the parameter list) is a correlation 20 20 length for the polymer chains. Note that when $m=2$ this functional form … … 48 48 ["porod_scale", "", 1e-06, [0, inf], "", "Porod Scaling Factor"], 49 49 ["cor_length", "Ang", 50.0, [0, inf], "", "Correlation length, xi, in Lorentzian"], 50 [" exponent_p", "", 3.0, [0, inf], "", "Porod Exponent, n, in q^-n"],51 [" exponent_l", "1/Ang^2", 2.0, [0, inf], "", "Lorentzian Exponent, m, in 1/( 1 + (q.xi)^m)"],50 ["porod_exp", "", 3.0, [0, inf], "", "Porod Exponent, n, in q^-n"], 51 ["lorentz_exp", "1/Ang^2", 2.0, [0, inf], "", "Lorentzian Exponent, m, in 1/( 1 + (q.xi)^m)"], 52 52 ] 53 53 # pylint: enable=bad-continuation, line-too-long 54 54 55 def Iq(q, lorentz_scale, porod_scale, cor_length, exponent_p, exponent_l):55 def Iq(q, lorentz_scale, porod_scale, cor_length, porod_exp, lorentz_exp): 56 56 """ 57 57 1D calculation of the Correlation length model 58 58 """ 59 59 with errstate(divide='ignore'): 60 porod = porod_scale / q** exponent_p61 lorentz = lorentz_scale / (1.0 + (q * cor_length)** exponent_l)60 porod = porod_scale / q**porod_exp 61 lorentz = lorentz_scale / (1.0 + (q * cor_length)**lorentz_exp) 62 62 inten = porod + lorentz 63 63 return inten … … 66 66 # parameters for demo 67 67 demo = dict(lorentz_scale=10.0, porod_scale=1.0e-06, cor_length=50.0, 68 exponent_p=3.0, exponent_l=2.0, background=0.1,68 porod_exp=3.0, lorentz_exp=2.0, background=0.1, 69 69 ) 70 70
Note: See TracChangeset
for help on using the changeset viewer.