Changeset c6652bb in sasmodels


Ignore:
Timestamp:
Mar 21, 2016 3:30:00 PM (8 years ago)
Author:
butler
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
Message:

Review completeness of two_power_law and corrected equation in docs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/two_power_law.py

    raa2edb2 rc6652bb  
    11r""" 
    2 This model calculates an empirical functional form for SAS data characterized 
    3 by two power laws. 
    4  
    52Definition 
    63---------- 
     
    118 
    129    I(q) = \begin{cases} 
    13     A q^{-m1} + \text{background} & q <= qc \\ 
    14     C q^{-m2} + \text{background} & q > qc 
     10    A q^{-m1} + \text{background} & q <= q_c \\ 
     11    C q^{-m2} + \text{background} & q > q_c 
    1512    \end{cases} 
    1613 
    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 
     14where $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 
     16power law region, $m1$ = power law exponent at low Q, and $m2$ = power law  
     17exponent at high Q.  The scaling of the second power law region (coefficent C) 
     18is then automatically scaled to match the first by following formula: 
    2419 
    2520.. math:: 
    26     C = \frac{A}{qc^{-m1} qc^{-m2}} 
     21    C = \frac{A q_c^{m2}}{q_c^{m1}} 
    2722 
    2823.. note:: 
     
    4237None. 
    4338 
     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 
    4444""" 
    4545 
     
    5050 
    5151name = "two_power_law" 
    52 title = "Two Power Law intensity calculation" 
     52title = "This model calculates an empirical functional form for SAS data \ 
     53characterized by two power laws." 
    5354description = """ 
    54             I(q) = coef_A*pow(qval,-1.0*power1) + background for q<=qc 
    55             =C*pow(qval,-1.0*power2) + background for q>qc 
    56             where C=coef_A*pow(qc,-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). 
    5758 
    5859            coef_A = scaling coefficent 
    59             qc = crossover location [1/A] 
     60            q_c = crossover location [1/A] 
    6061            power_1 (=m1) = power law exponent at low Q 
    6162            power_2 (=m2) = power law exponent at high Q 
     
    6465category = "shape-independent" 
    6566 
    66 # pylint: disable=bad-whitespace, line-too-long 
    6767#            ["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"], 
     68parameters = [["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"], 
    7276             ] 
    73 # pylint: enable=bad-whitespace, line-too-long 
    7477 
    7578 
Note: See TracChangeset for help on using the changeset viewer.