Opened 9 years ago

Closed 9 years ago

#376 closed defect (fixed)

lamellarPS in sasview, bugs in polydispersity loops (and Caille S(Q) )

Reported by: richardh Owned by: richardh
Priority: minor Milestone: SasView 3.1.0
Component: SasView Keywords: lamellarPS
Cc: Work Package: SasView Bug Fixing

Description

Whilst debugging equivalent lamellarCaille routine for sasmodels,
discovered the old one had two bugs in the polydispersity.
Later Paul K also found a separate issue with a summation in the
Caille S(Q) itself. I need to check the status of the fix for this
also for this and lamellarPS_HG.

The polydispersity bugs are illustrated here:

Perform the computation, with all weight points
double sum = 0.0;
double norm = 0.0;

Loop over short_edgeA weight points
for(int i=0; i< (int)weights_spacing.size(); i++) {

dp[1] = weights_spacing[i].value;
for(int j=0; j< (int)weights_spacing.size(); j++) { BUG
for(int j=0; j< (int)weights_delta.size(); j++) {

dp[2] = weights_delta[i].value; BUG
dp[2] = weights_delta[j].value;

sum += weights_spacing[i].weight * weights_delta[j].weight * LamellarPS_kernel(dp, q);
norm += weights_spacing[i].weight * weights_delta[j].weight;

}

}
return sum/norm + background();

Change History (4)

comment:1 Changed 9 years ago by richardh

Have fixed the Caille s(Q) in sasmodels for lamellarCaille, as Paul K had only done lamellarCailleHG. RichardH

comment:2 Changed 9 years ago by richardh

Have now pushed the fixes for lamellarPS and lamellarPS_HG in sasview. Alas they will now fail the current unit tests, as the results of the routines have changed!

Last edited 9 years ago by richardh (previous) (diff)

comment:3 Changed 9 years ago by richardh

Have made a quick fix to utest_other_models.py , have to go home now, will check more tomorrow.

comment:4 Changed 9 years ago by pkienzle

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.