Changes between Initial Version and Version 1 of Ticket #1121, comment 1
- Timestamp:
- Jul 5, 2018 7:33:12 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1121, comment 1
initial v1 5 5 # integrate over polydispersity in shape 6 6 F1 = F2 = 0 7 F_norm= 07 total_weight = total_volume = 0 8 8 for wk, pk in distribution: 9 9 # integrate over angles with u = cos(theta) substitution and z = 2*u - 1 … … 17 17 18 18 # accumulate 1D patterns over polydispersity 19 if sasfit: 20 F1 += wk * F1k 21 F2 += wk * F2k 22 F_norm += wk 23 elif sasview or yun: 24 F1 += wk * volume * F1k/volume 25 F2 += wk * volume * F2k/volume 26 F_norm += wk * volume 19 F1 += wk * F1k 20 F2 += wk * F2k 21 total_weight += wk 22 total_volume += wk * volume 27 23 28 F1 = F1/ F_norm29 F2 = F2/ F_norm24 F1 = F1/total_weight 25 F2 = F2/total_weight 30 26 Sq = S(q) 31 27 beta = F1**2/F2 28 Sq_eff = 1 + beta * (Sq - 1) 29 average_volume = total_volume/total_weight 32 30 33 31 if sasfit: 34 Sq_eff = 1 + beta * (Sq - 1)35 32 Pq = F2 36 33 elif sasview: 37 Sq_eff = undefined 38 Pq = F2*1e-4*volfraction 34 Pq = F2/average_volume*1e-4*volfraction 39 35 elif yun: 40 Sq_eff = 1 + F_norm*beta * (Sq - 1) 41 Pq = F2/volume 36 Pq = F2/average_volume*1e8*volfraction # slds not scaled by 1e-6 42 37 43 38 Iq = Pq*Sq … … 47 42 The match to sasfit is not very good (in the order of 1% relative error), but probably good enough that we know what calculation is being performed even though we are using different numeric procedures to perform it. 48 43 49 Still haven't seen Yun's results for gaussian dispersion of radii; may need to adapt the algorithm a bit once these are available.50