Changeset a807206 in sasmodels for sasmodels/models/pearl_necklace.py
- Timestamp:
- Sep 30, 2016 10:42:06 PM (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:
- caddb14, 5031ca3
- Parents:
- 2222134
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/pearl_necklace.py
r42356c8 ra807206 46 46 pearl_necklace model are the following 47 47 48 NB: *num ber_of_pearls* must be an integer.48 NB: *num_pearls* must be an integer. 49 49 50 50 References … … 68 68 sld_string: the SLD of the strings 69 69 sld_solvent: the SLD of the solvent 70 num ber_of_pearls: number of the pearls70 num_pearls: number of the pearls 71 71 radius: the radius of a pearl 72 edge_sep aration: the length of string segment; surface to surface73 string_thickness: thickness (ie, diameter) of the string72 edge_sep: the length of string segment; surface to surface 73 thick_string: thickness (ie, diameter) of the string 74 74 """ 75 75 category = "shape:cylinder" … … 78 78 parameters = [["radius", "Ang", 80.0, [0, inf], "volume", 79 79 "Mean radius of the chained spheres"], 80 ["edge_sep aration", "Ang", 350.0, [0, inf], "volume",80 ["edge_sep", "Ang", 350.0, [0, inf], "volume", 81 81 "Mean separation of chained particles"], 82 [" string_thickness", "Ang", 2.5, [0, inf], "volume",82 ["thick_string", "Ang", 2.5, [0, inf], "volume", 83 83 "Thickness of the chain linkage"], 84 ["num ber_of_pearls", "none", 3, [0, inf], "volume",84 ["num_pearls", "none", 3, [0, inf], "volume", 85 85 "Number of pearls in the necklace (must be integer)"], 86 86 ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", … … 95 95 single = False # use double precision unless told otherwise 96 96 97 def volume(radius, edge_sep aration, string_thickness, number_of_pearls):97 def volume(radius, edge_sep, thick_string, num_pearls): 98 98 """ 99 99 Calculates the total particle volume of the necklace. 100 100 Redundant with form_volume. 101 101 """ 102 number_of_strings = num ber_of_pearls - 1.0103 string_vol = edge_sep aration * pi * pow((string_thickness/ 2.0), 2.0)102 number_of_strings = num_pearls - 1.0 103 string_vol = edge_sep * pi * pow((thick_string / 2.0), 2.0) 104 104 pearl_vol = 4.0 /3.0 * pi * pow(radius, 3.0) 105 105 total_vol = number_of_strings * string_vol 106 total_vol += num ber_of_pearls * pearl_vol106 total_vol += num_pearls * pearl_vol 107 107 return total_vol 108 108 109 def ER(radius, edge_sep aration, string_thickness, number_of_pearls):109 def ER(radius, edge_sep, thick_string, num_pearls): 110 110 """ 111 111 Calculation for effective radius. 112 112 """ 113 tot_vol = volume(radius, edge_sep aration, string_thickness, number_of_pearls)113 tot_vol = volume(radius, edge_sep, thick_string, num_pearls) 114 114 rad_out = pow((3.0*tot_vol/4.0/pi), 0.33333) 115 115 return rad_out 116 116 117 117 # parameters for demo 118 demo = dict(scale=1, background=0, radius=80.0, edge_sep aration=350.0,119 num ber_of_pearls=3, sld=1, sld_solvent=6.3, sld_string=1,120 string_thickness=2.5,118 demo = dict(scale=1, background=0, radius=80.0, edge_sep=350.0, 119 num_pearls=3, sld=1, sld_solvent=6.3, sld_string=1, 120 thick_string=2.5, 121 121 radius_pd=.2, radius_pd_n=5, 122 edge_sep aration_pd=25.0, edge_separation_pd_n=5,123 num ber_of_pearls_pd=0, number_of_pearls_pd_n=0,124 string_thickness_pd=0.2, string_thickness_pd_n=5,122 edge_sep_pd=25.0, edge_sep_pd_n=5, 123 num_pearls_pd=0, num_pearls_pd_n=0, 124 thick_string_pd=0.2, thick_string_pd_n=5, 125 125 ) 126 126
Note: See TracChangeset
for help on using the changeset viewer.