Changeset a807206 in sasmodels for sasmodels/models/hollow_rectangular_prism.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/hollow_rectangular_prism.py
r40a87fa ra807206 105 105 ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", 106 106 "Solvent scattering length density"], 107 [" a_side", "Ang", 35, [0, inf], "volume",107 ["length_a", "Ang", 35, [0, inf], "volume", 108 108 "Shorter side of the parallelepiped"], 109 109 ["b2a_ratio", "Ang", 1, [0, inf], "volume", … … 117 117 source = ["lib/gauss76.c", "hollow_rectangular_prism.c"] 118 118 119 def ER( a_side, b2a_ratio, c2a_ratio, thickness):119 def ER(length_a, b2a_ratio, c2a_ratio, thickness): 120 120 """ 121 121 Return equivalent radius (ER) 122 122 thickness parameter not used 123 123 """ 124 b_side = a_side* b2a_ratio125 c_side = a_side* c2a_ratio124 b_side = length_a * b2a_ratio 125 c_side = length_a * c2a_ratio 126 126 127 127 # surface average radius (rough approximation) 128 surf_rad = sqrt( a_side* b_side / pi)128 surf_rad = sqrt(length_a * b_side / pi) 129 129 130 130 ddd = 0.75 * surf_rad * (2 * surf_rad * c_side + (c_side + surf_rad) * (c_side + pi * surf_rad)) 131 131 return 0.5 * (ddd) ** (1. / 3.) 132 132 133 def VR( a_side, b2a_ratio, c2a_ratio, thickness):133 def VR(length_a, b2a_ratio, c2a_ratio, thickness): 134 134 """ 135 135 Return shell volume and total volume 136 136 """ 137 b_side = a_side* b2a_ratio138 c_side = a_side* c2a_ratio139 a_core = a_side- 2.0*thickness137 b_side = length_a * b2a_ratio 138 c_side = length_a * c2a_ratio 139 a_core = length_a - 2.0*thickness 140 140 b_core = b_side - 2.0*thickness 141 141 c_core = c_side - 2.0*thickness 142 142 vol_core = a_core * b_core * c_core 143 vol_total = a_side* b_side * c_side143 vol_total = length_a * b_side * c_side 144 144 vol_shell = vol_total - vol_core 145 145 return vol_total, vol_shell … … 149 149 demo = dict(scale=1, background=0, 150 150 sld=6.3e-6, sld_solvent=1.0e-6, 151 a_side=35, b2a_ratio=1, c2a_ratio=1, thickness=1,152 a_side_pd=0.1, a_side_pd_n=10,151 length_a=35, b2a_ratio=1, c2a_ratio=1, thickness=1, 152 length_a_pd=0.1, length_a_pd_n=10, 153 153 b2a_ratio_pd=0.1, b2a_ratio_pd_n=1, 154 154 c2a_ratio_pd=0.1, c2a_ratio_pd_n=1)
Note: See TracChangeset
for help on using the changeset viewer.