Changeset 63d4dd1 in sasmodels for sasmodels/models/pearl_necklace.py


Ignore:
Timestamp:
Nov 9, 2018 3:25:10 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
7126c04
Parents:
599993b9 (diff), cf3d0ce (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'beta_approx' into ticket-1015-gpu-mem-error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/pearl_necklace.py

    r2d81cfe rcf3d0ce  
    5353R Schweins and K Huber, *Particle Scattering Factor of Pearl Necklace Chains*, 
    5454*Macromol. Symp.* 211 (2004) 25-42 2004 
     55L. Onsager, Ann. New York Acad. Sci. 51, 627-659 (1949).  
    5556""" 
    5657 
     
    9596source = ["lib/sas_Si.c", "lib/sas_3j1x_x.c", "pearl_necklace.c"] 
    9697single = False  # use double precision unless told otherwise 
    97  
    98 def volume(radius, edge_sep, thick_string, num_pearls): 
    99     """ 
    100     Calculates the total particle volume of the necklace. 
    101     Redundant with form_volume. 
    102     """ 
    103     num_pearls = int(num_pearls + 0.5) 
    104     number_of_strings = num_pearls - 1.0 
    105     string_vol = edge_sep * pi * pow((thick_string / 2.0), 2.0) 
    106     pearl_vol = 4.0 /3.0 * pi * pow(radius, 3.0) 
    107     total_vol = number_of_strings * string_vol 
    108     total_vol += num_pearls * pearl_vol 
    109     return total_vol 
    110  
    111 def ER(radius, edge_sep, thick_string, num_pearls): 
    112     """ 
    113     Calculation for effective radius. 
    114     """ 
    115     num_pearls = int(num_pearls + 0.5) 
    116     tot_vol = volume(radius, edge_sep, thick_string, num_pearls) 
    117     rad_out = (tot_vol/(4.0/3.0*pi)) ** (1./3.) 
    118     return rad_out 
    119  
     98effective_radius_type = [ 
     99    "equivalent volume sphere",  
     100    ] 
     101     
    120102def random(): 
    121103    radius = 10**np.random.uniform(1, 3) # 1 - 1000 
     
    140122            thick_string_pd=0.2, thick_string_pd_n=5, 
    141123           ) 
    142  
    143 tests = [[{}, 0.001, 17380.245], [{}, 'ER', 115.39502]] 
     124# ER function is not being used here, not that it is likely very sensible to  
     125# include an S(Q) with this model, the default in sasview 5.0 would be to the  
     126# "unconstrained" radius_effective. 
     127#tests = [[{}, 0.001, 17380.245], [{}, 'ER', 115.39502]] 
     128tests = [[{}, 0.001, 17380.245]] 
Note: See TracChangeset for help on using the changeset viewer.