Changeset c6652bb in sasmodels
- Timestamp:
- Mar 21, 2016 5:30:00 PM (9 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:
- 693570c
- Parents:
- f7930be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/two_power_law.py
raa2edb2 rc6652bb 1 1 r""" 2 This model calculates an empirical functional form for SAS data characterized3 by two power laws.4 5 2 Definition 6 3 ---------- … … 11 8 12 9 I(q) = \begin{cases} 13 A q^{-m1} + \text{background} & q <= q c \\14 C q^{-m2} + \text{background} & q > q c10 A q^{-m1} + \text{background} & q <= q_c \\ 11 C q^{-m2} + \text{background} & q > q_c 15 12 \end{cases} 16 13 17 where $qc$ = the location of the crossover from one slope to the other, 18 $A$ = the scaling coefficent that sets the overall intensity of the lower Q power law region, 19 $m1$ = power law exponent at low Q, 20 $m2$ = power law exponent at high Q 21 22 The scaling of the second power law region (coefficent C) is then automatically scaled to 23 match the first by following formula 14 where $q_c$ = the location of the crossover from one slope to the other, 15 $A$ = the scaling coefficent that sets the overall intensity of the lower Q 16 power law region, $m1$ = power law exponent at low Q, and $m2$ = power law 17 exponent at high Q. The scaling of the second power law region (coefficent C) 18 is then automatically scaled to match the first by following formula: 24 19 25 20 .. math:: 26 C = \frac{A }{qc^{-m1} qc^{-m2}}21 C = \frac{A q_c^{m2}}{q_c^{m1}} 27 22 28 23 .. note:: … … 42 37 None. 43 38 39 **Author:** NIST IGOR/DANSE **on:** pre 2010 40 41 **Last Modified by:** Wojciech Wpotrzebowski **on:** February 18, 2016 42 43 **Last Reviewed by:** Paul Butler **on:** March 21, 2016 44 44 """ 45 45 … … 50 50 51 51 name = "two_power_law" 52 title = "Two Power Law intensity calculation" 52 title = "This model calculates an empirical functional form for SAS data \ 53 characterized by two power laws." 53 54 description = """ 54 I(q) = coef_A*pow(qval,-1.0*power1) + background for q<=q c55 =C*pow(qval,-1.0*power2) + background for q>q c56 where C=coef_A*pow(q c,-1.0*power1)/pow(qc,-1.0*power2).55 I(q) = coef_A*pow(qval,-1.0*power1) + background for q<=q_c 56 =C*pow(qval,-1.0*power2) + background for q>q_c 57 where C=coef_A*pow(q_c,-1.0*power1)/pow(q_c,-1.0*power2). 57 58 58 59 coef_A = scaling coefficent 59 q c = crossover location [1/A]60 q_c = crossover location [1/A] 60 61 power_1 (=m1) = power law exponent at low Q 61 62 power_2 (=m2) = power law exponent at high Q … … 64 65 category = "shape-independent" 65 66 66 # pylint: disable=bad-whitespace, line-too-long67 67 # ["name", "units", default, [lower, upper], "type", "description"], 68 parameters = [["coefficent_1", "", 1.0, [-inf, inf], "", "coefficent A in low Q region"], 69 ["crossover", "1/Ang", 0.04,[0, inf], "", "crossover location"], 70 ["power_1", "", 1.0, [0, inf], "", "power law exponent at low Q"], 71 ["power_2", "", 4.0, [0, inf], "", "power law exponent at high Q"], 68 parameters = [["coefficent_1", "", 1.0, [-inf, inf], "", 69 "coefficent A in low Q region"], 70 ["crossover", "1/Ang", 0.04,[0, inf], "", 71 "crossover location"], 72 ["power_1", "", 1.0, [0, inf], "", 73 "power law exponent at low Q"], 74 ["power_2", "", 4.0, [0, inf], "", 75 "power law exponent at high Q"], 72 76 ] 73 # pylint: enable=bad-whitespace, line-too-long74 77 75 78
Note: See TracChangeset
for help on using the changeset viewer.