Changeset e9b0ef3 in sasmodels
- Timestamp:
- Dec 20, 2016 4:46:25 PM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 41b1edd
- Parents:
- d2deac2
- Location:
- sasmodels/models
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/linear_pearls.c
r4962519 re9b0ef3 4 4 double radius, 5 5 double edge_sep, 6 double num_pearls,6 double fp_num_pearls, 7 7 double pearl_sld, 8 8 double solvent_sld); … … 11 11 double radius, 12 12 double edge_sep, 13 doublenum_pearls,13 int num_pearls, 14 14 double pearl_sld, 15 15 double solvent_sld); 16 16 17 17 18 double form_volume(double radius, double num_pearls)18 double form_volume(double radius, double fp_num_pearls) 19 19 { 20 int num_pearls = (int)(fp_num_pearls + 0.5); 20 21 // Pearl volume 21 22 double pearl_vol = M_4PI_3 * cube(radius); … … 27 28 double radius, 28 29 double edge_sep, 29 doublenum_pearls,30 int num_pearls, 30 31 double pearl_sld, 31 32 double solvent_sld) 32 33 { 33 double n_contrib;34 34 //relative sld 35 35 double contrast_pearl = pearl_sld - solvent_sld; … … 47 47 48 48 // N pearls contribution 49 int n_max = num_pearls - 1; 50 n_contrib = num_pearls; 51 for(int num=1; num<=n_max; num++) { 52 n_contrib += (2.0*(num_pearls-num)*sinc(q*separation*num)); 49 double n_contrib = (double)num_pearls; 50 for(int num=1; num<num_pearls; num++) { 51 n_contrib += 2.0*(num_pearls-num)*sinc(q*separation*num); 53 52 } 54 53 // form factor for num_pearls … … 61 60 double radius, 62 61 double edge_sep, 63 double num_pearls,62 double fp_num_pearls, 64 63 double pearl_sld, 65 64 double solvent_sld) 66 65 { 67 66 67 int num_pearls = (int)(fp_num_pearls + 0.5); 68 68 double result = linear_pearls_kernel(q, 69 69 radius, -
sasmodels/models/linear_pearls.py
r4962519 re9b0ef3 16 16 .. math:: 17 17 18 P(Q) = \frac{ scale}{V}\left[ m_{p}^219 \left(N+2\sum_{n-1}^{N-1}(N-n)\frac{ sin(qnl)}{qnl}\right)20 \left( 3\frac{ sin(qR)-qRcos(qR)}{(qr)^3}\right)^2\right]18 P(Q) = \frac{\text{scale}}{V}\left[ m_{p}^2 19 \left(N+2\sum_{n-1}^{N-1}(N-n)\frac{\sin(qnl)}{qnl}\right) 20 \left( 3\frac{\sin(qR)-qR\cos(qR)}{(qr)^3}\right)^2\right] 21 21 22 22 where the mass $m_p$ is $(SLD_{pearl}-SLD_{solvent})*(volume\ of\ N\ pearls)$. … … 56 56 ["radius", "Ang", 80.0, [0, inf], "", "Radius of the pearls"], 57 57 ["edge_sep", "Ang", 350.0, [0, inf], "", "Length of the string segment - surface to surface"], 58 ["num_pearls", "", 3.0, [ 0, inf], "", "Number of the pearls"],58 ["num_pearls", "", 3.0, [1, inf], "", "Number of the pearls"], 59 59 ["sld", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", "SLD of the pearl spheres"], 60 60 ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "sld", "SLD of the solvent"],
Note: See TracChangeset
for help on using the changeset viewer.