Skip to content

Polydispersity causes incorrect size distribution calculations when changing models #3500

@gnsmith

Description

@gnsmith

Describe the bug
When changing between models with polydispersity enabled, the calculated size distributions become nonsensically broad. Changing back to the original model does not recover the original computation. This is the case whether simulating data (when I first discovered it) but also when fitting data (I verified this). You can overcome this by switching off polydispersity or by changing both the polydispersity function and the value.

To Reproduce
Steps to reproduce the behavior:

  1. Select a model to simulate. I chose Sphere/sphere.
  2. Enable polydispersity, enter values, and calculate. I chose PD=0.08 schulz.
  3. Change models and calculate. I chose Sphere/core_shell_sphere.
  4. Return to the original model and calculate. The simulated data will not be the same.

Expected behavior
I do know that SasView does not remember the polydispersity function choice, but it does remember the PD value. The expected behavior is that the size distribution that is computed given the same combination of PD and function should be the same and that it should not depend on the path taken.

Screenshots
Here are screenshots of the steps in the "to reproduce" section.

Image Image Image Image Image

SasView version (please complete the following information):

  • Version: 6.1.0 only (as far as I can tell)
  • I tested this in v5.0.6 and v.6.0.0 and do not see the issue.

Operating system (please complete the following information):

  • OS: Windows 11

Installation method (please complete the following information):

  • Installed: Windows installer

Additional context
I am not sure how common of an approach to fitting this in. It feels like it might be an edge case, as I don't know how often people switch around models when fitting, as I have done here. However, if you did follow this pathway to computation or fitting, then your computed curves would be incorrect in a way that was not easily visible (the PD and functions are the same).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions