Changeset 99658f6 in sasmodels for sasmodels/models/pearl_necklace.py
- Timestamp:
- Nov 6, 2018 2:10:43 PM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- cf3d0ce
- Parents:
- 5024a56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/pearl_necklace.py
r2cc8aa2 r99658f6 53 53 R Schweins and K Huber, *Particle Scattering Factor of Pearl Necklace Chains*, 54 54 *Macromol. Symp.* 211 (2004) 25-42 2004 55 L. Onsager, Ann. New York Acad. Sci. 51, 627-659 (1949). 55 56 """ 56 57 … … 95 96 source = ["lib/sas_Si.c", "lib/sas_3j1x_x.c", "pearl_necklace.c"] 96 97 single = 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 98 effective_radius_type = [ 99 "equivalent volume sphere", 100 ] 101 102 #def volume(radius, edge_sep, thick_string, num_pearls): 103 # """ 104 # Calculates the total particle volume of the necklace. 105 # Redundant with form_volume. 106 # """ 107 # num_pearls = int(num_pearls + 0.5) 108 # number_of_strings = num_pearls - 1.0 109 # string_vol = edge_sep * pi * pow((thick_string / 2.0), 2.0) 110 # pearl_vol = 4.0 /3.0 * pi * pow(radius, 3.0) 111 # total_vol = number_of_strings * string_vol 112 # total_vol += num_pearls * pearl_vol 113 # return total_vol 114 # 115 #def ER(radius, edge_sep, thick_string, num_pearls): 116 # """ 117 # Calculation for effective radius. 118 # """ 119 # num_pearls = int(num_pearls + 0.5) 120 # tot_vol = volume(radius, edge_sep, thick_string, num_pearls) 121 # rad_out = (tot_vol/(4.0/3.0*pi)) ** (1./3.) 122 # return rad_out 119 123 120 124 def random():
Note: See TracChangeset
for help on using the changeset viewer.