Opened 7 months ago

Last modified 7 months ago

#1110 new defect

Basis for polydispersity normalization may be wrong

Reported by: butler Owned by:
Priority: major Milestone: SasView 4.3.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing


Originally reported by Peter Schmidt of UMN in September of 2017 as follows:

Hi SASView Coders,

I have been using SASView to fit SAXS patterns for methylcellulose hydrogels. My group has used IgorPro? previously to fit SANS results of these materials previously to the "semiflexible cylinder model with polydisperse radius." I noticed I was consistently getting a fit with a higher fibril diameter.

I played around with SASView and the Igor SANS macro by inputting various values into the flexible cylinder model. I have found that when I incorporate polydispersity, I get slightly different shaped scattering patterns. To my knowledge Igor uses a Schulz distribution, but even using the Schulz distribution in SASView, I get a slightly different answer. Without the polydispersity in the radius term the two plots superpose as they likely should.

I was wondering if there is a reason why this might be occurring (based on how the distribution is implemented), if there might be an issue with the code, or if there is another reason why these two aren't generating the same plot when adding in a dispersity term.

Best regards,

Attached is the graph he sent — note that the length must be 1e4 not 1. Yun Liu has recently looked at the polydispersity code he says because of the beta approximation and believes it is correct "For number average" representation.

However, IGOR also claims to report number averages I believe. Further Peter Schmidt recently told me (at IPRIME meeting end of May 2018) that he did some digging and discovered that IGOR is averaging using the second moment of the distribution (as the documentation suggests and which should be correct for proper scattering normalization, in particular for such things as the Invariant etc) while SasView uses the first moment.

I have created the IGOR version with the parameters given as a data file and attached as well. If SASFIT has the same model it would be good to check against it as well?

It is not clear that this is simply a nomenclature issue (which is fixed with better documentation) but could be giving somewhat "incorrect" results for very polydisperse systems which would propagate as noted in the IGOR documentation to the invariant calculator as well and perhaps elsewhere?

Attachments (2)

SASViewVSIgorPro.png (85.2 KB) - added by butler 7 months ago.
Plot showing diff between IGOR and SasView? for a PD of 3 on wormlike chain - courtesy of Peter Schmidt
PeterSchmidtWormIGORversion.txt (3.1 KB) - added by butler 7 months ago.
Data File from IGOR using flexible cylinder model with parameters described in ticket

Download all attachments as: .zip

Change History (6)

Changed 7 months ago by butler

Plot showing diff between IGOR and SasView? for a PD of 3 on wormlike chain - courtesy of Peter Schmidt

Changed 7 months ago by butler

Data File from IGOR using flexible cylinder model with parameters described in ticket

comment:1 Changed 7 months ago by richardh

Could some kind person perhaps compare IGOR& sasview with a simple model such as a polydisperse sphere or cylinder, just to make sure that we are not dealing with an issue specific to the implementation of the rather complex flexible cylinder model (even though I might guess that the sasview code was based on the NIST one).

comment:2 Changed 7 months ago by butler

Interestingly, yes - the shpere with polydisperse R of 0.4 is exactly the same for SasView and IGOR and so is the cylinder with polydisperse Radius of 0.4 and so is cylinder with polydisperse Length of 0.4. This leaves us with the question of what is going on with the flexible chain model and how to validate.

comment:3 Changed 7 months ago by richardh

Suspect a systematic comparison of both codes is required. With very long contour length and long Kuhn length it ought to look like a cylinder. Looking at the plot, my guess would be that IGOR is applying the polydispersity to the wrong variable?? (e.g. to the Kuhn length instead of the radius. A quick look at the sasview code suggests sasview ought to be OK in this regard.)  But since I don't have IGOR myself I cannot test this.

comment:4 Changed 7 months ago by butler

  • Milestone changed from SasView 4.2.0 to SasView 4.3.0
  • Priority changed from critical to major

Indeed —- given however this is for one particular model, and clearly long standing, I think this cannot block a release so moving to 4.3 for now.

Note: See TracTickets for help on using tickets.