SasView / sasview

Code for the SasView application.
BSD 3-Clause "New" or "Revised" License
51 stars 41 forks source link

Polydispersity not being applied to S(q) for cylinder models using P(q)*S(q) or with the beta approximation #1703

Closed murphyryanp closed 8 months ago

murphyryanp commented 3 years ago

I am fitting data using the cylinder model P(q) and sticky hard sphere S(q). I use the built-in multiplication of P*S or P*S with the beta approximation (using the drop down panel in the fitting panel), in both cases polydispersity does not get applied to S(q). This creates peaks and oscillations near q~pi/R, where R is whatever the constraint is set on the radius. If you plot S(q) graph, the strong peak and oscillations indicate it does not have any dispersity applied to R or L, and S(q) stays constant if you change the dispersity in R or L. This seems both physically unrealistic, and it doesn't make sense from a modelling standpoint either, I think.

To confirm, I used the model builder to manually generate a plugin model using cylinder*stickyhardsphere. With this plugin model, you can manually set the polydispersity of R and Reff in S(q) to be equal. If you compare this result, it shows that indeed no dispersity is applied to S(q) in the built-in P*S or P*S with beta approximation function.

I'm not entirely certain the order in which polydispersity gets applied, or if it was intended to not apply polydispersity to S(q).

Can anyone else confirm this is the case?

pkienzle commented 3 years ago

There is no polydispersity in structure factor, only dispersion around inter-particle separation. The various structure factor models will have ways of tweaking the regularity which will lead to larger or smaller peaks. You can look at the structure factor alone to see how the parameters interact.

The assumption to the monodisperse approximation (simple P*S) is that all particles are spherically symmetric of the same size.

The β-approximation improves on this slightly, implementing a "decoupling" approximation, which assumes there is no correlations between particle size or orientation between particles.

The "locally monodisperse" approximation assumes that particles of similar sizes are near each other, though still with no correlation between orientations. This isn't yet supported. You could implement it yourself for P*Q pairs as needed, returning F²(Q;r)*S(Q;r) instead of the usual F²(Q) form, but long term this should be automated in the polydispersity loop. You can run it in SasFit to see what that produces. See Chapter 4 of the SasFit manual for even more refined approximations supported by SasFit, though note that these still don't handle correlated orientation.

murphyryanp commented 3 years ago

Thanks for clarifying Paul!

I will check out SasFit to implement 'P(q, R) * S(q, R)' pairs across some distribution of 'R'. I understand that orientation is not accounted for in this way; if it was important, then the stickyhardsphere model would not be a good choice!

By the way, was polydispersity ever applied to 'S(q)' in previous versions of SasView v4? I remember 'S(q)' being smeared with changing dispersity in 'R', at least when using the spherical form factor. Currently, it doesn't seem to implement polydispersity for 'S(q)' even when using spherical form factors.

pkienzle commented 3 years ago

You remember correctly.

I just looked at the code for HardSphere 3.1, and it does allow for a distribution of effective radius, as did Richard's initial conversion to sasmodels hardsphere. I removed it when we implemented the β approximation (Aug. 2018) for version 5.0, following the theory outlined in (Kotlarchyk and Chen, 1983) and the SasFit manual.

RichardHeenan commented 3 years ago

To go back to the original comment, the final S(Q) should change, with its peaks being "damped", with polydispersity and/or aspect ratio of the cylinder P(Q) if the beta(Q) correction is turned on, but not elsewise. Hope that you actually saw this? - as this is the goal of the beta(Q) adjustment to S(Q).

As mentioned, the theory still assumes non-correlation of neighbouring particles, i.e. they are freely rotating, so will break down for larger aspect ratio particles or higher polydispersity, and higher concentrations.

pkienzle commented 3 years ago

To clarify, S' = 1 + β(S - 1), where β = <F>²/<F²> as given in (K&C 1983, eq 14), so S' depends on polydispersity even though S itself depends only on the average effective radius.

Note: Further down in the paper, Fig 2 caption, K&C use cubed root of <R³> as the effective radius for the Schultz distribution, which we are not able to do. We calculate <R> = ∫ w(x) R(x) dx for shape parameter x and distribution w, so we can compute the average of the cube root of volume, but not the cubed root of the average volume. Maybe a new ticket?

gonzalezma commented 8 months ago

Can we close this in favour of #2423?

murphyryanp commented 8 months ago

Yes!