Changeset f12357f in sasmodels for sasmodels/models/pearl_necklace.py
- Timestamp:
- Feb 3, 2016 8:49:57 AM (8 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:
- a17fe40
- Parents:
- 8696a87
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/pearl_necklace.py
r841753c rf12357f 58 58 """ 59 59 60 from numpy import inf 60 from numpy import inf, pi 61 61 62 62 name = "pearl_necklace" … … 96 96 97 97 source = ["lib/Si.c", "pearl_necklace.c"] 98 # new flag to let the compiler know to never use single precision 99 single = False 100 101 def volume(radius, edge_separation, string_thickness, number_of_pearls): 102 """ 103 Calculates the total particle volume of the necklace. 104 Redundant with form_volume. 105 """ 106 number_of_strings = number_of_pearls - 1.0 107 string_vol = edge_separation * pi * pow((string_thickness / 2.0), 2.0) 108 pearl_vol = 4.0 /3.0 * pi * pow(radius, 3.0) 109 total_vol = number_of_strings * string_vol 110 total_vol += number_of_pearls * pearl_vol 111 return total_vol 112 113 def ER(radius, edge_separation, string_thickness, number_of_pearls): 114 """ 115 Calculation for effective radius. 116 """ 117 tot_vol = volume(radius, edge_separation, string_thickness, number_of_pearls) 118 rad_out = pow((3.0*tot_vol/4.0/pi), 0.33333) 119 return rad_out 98 120 99 121 # parameters for demo … … 114 136 string_thickness='thick_string', sld='sld_pearl', 115 137 string_sld='sld_string', edge_separation='edge_separation') 138 139 tests = [[{}, 0.001, 17380.245], [{}, 'ER', 115.39502]]
Note: See TracChangeset
for help on using the changeset viewer.