Aggregate and chain structure-factor models#719
Aggregate and chain structure-factor models#719wpotrzebowski wants to merge 6 commits intomasterfrom
Conversation
|
There is some typo/nomenclature glitch. It should be compact not composite |
|
The parameters are not following sasmodels naming conventions. Run Existing structure factors expect radius_effective as the first parameter. This is populated from the form factor, averaged over the polydispersiy. The second parameter is volfraction, which pulls from the form factor volfraction if it is defined, with a correction for hollow shapes, wherein volfraction is the volume fraction of the shell. Existing fractal models compute P*S at the end for P sphere or core-shell sphere. You may want to do the same for these models. The difference is in the handling of polydispersity. Keeping the structure factor separate gives you structure factor for the average sphere radius to a polydisperse form factor I implemented S(q) for a fractal so I could see the differences. Monodisperse gives identical results. Polydisperse simple P@S gives significantly different values at low Q. Those differences are much less if the β approximation (structure_factor_mode=1) is used.
|
|
As a reply to @pkienzle : The purpose of these aggregation structure factors is to make SASview more generally applicable so that the aggregation structure factors can be combined with any form factor, and hopefully in the future also with form factors of biomacromolecules calculated by AUSAXS within SASview including the scattering from the hydration layer. The aggregation structure factors have been formulated in similar manner with aggregation number and distance between points as fit parameters. Usually, the purpose of applying then would be to determine the aggregation number, so it makes sense to have this as a fit parameter. Some structure factors have additional parameters like the fractals and compact aggregates (fractal dimension, and average radius and polydispersity, respectively). There are many systems where the distance between particles within an aggregate is not given by the radius of the constituting particles, for examples, micelles bridged by polymers/polyelectrolyte/proteins where the connecting string is often invisible in scattering and matrix mediated association, like precipitates in alloys, where lattice mismatch can lead to these effects. So to have them generally applicable, the distance between points should be a parameter. The aggregation structure factors are different from those from liquid state theory and volume fraction is an irrelevant parameter. There is nothing alarming in that the curves are different for different ways of including polydispersity of the constituting particles. I think the best way to preserve aggregation number as meaningful parameter, is to have the intensity as the product of the structure factor and an average form factor and not integrate the product over the size distribution. I agree that the beta/decoupling approximation is the best way to include them. I use that in my programs. |
@Janskovp This case is covered by
The current implementation in Meanwhile the structure factor models will have to include the volume fraction parameter but ignore it. This parameter is used within the structure factor to control the packing density, not as an overall scaling on Currently there is no way to turn off the overall volume fraction scaling. For solid objects you can compensate by setting |
|
I am still relatively new to SASview and I know little about what is hidden behind options that appear in the GUI. Anyway, I think that radius_effective_mode == 0. appears at 'unconstrained' in the fit panel meaning that the radius in the structure factor appears as an actual extra fit parameter, which is perfect for the versatility of the use of the cluster structure factors. It would be good (less confusing) if the volume fraction does not appear under the structure factor when it does not depend on it. I think we could accept to keep radius_effective, although I think that the distance between points is the more natural parameter. It is easy to change the code to use radius_effective instead of the distance between points. I will talk with @wpotrzebowski Wojtek about modifying the codes to make them compatible with the requirements. Regarding 'overall volume fraction scaling'. If I understand correctly, this is the 'scale' always appearing as the first fit parameter. For spheres, it is used to calculate number density as scale/V and there is an additional V^2 and Delta_rho^2 scaling from the form factor to give absolute intensities. I don't think that this 'interfers' with the aggregation structure factors, as it relates to the form factors. (By the way, there are similar 'issues' as with the shell structures for the polymer models (and possibly with microgel formfactors), where I_0 is used as fit parameter instead of expressing the model on absolute scale directly, mainly because the model does not directly involve the polymer volume.) |
|
I added a note to #720 to remove the unused parameters that we just introduced. Regarding radius_effective, I think it should be defined as half the distance between points. For example, if the radius is set by hard spheres, the distance between the centers is twice the radius. Inside the models I'm seeing code like Regarding volfraction, it is applied during P@S with overall scale equal to Regarding the other parameters, here's what existing convention suggests for the names: Scale parameters don't follow the usual "math" convention of e.g., radius_core. Instead they use forms like porod_scale. Here's a list of names used in various models:
|
|
I agree with most of the renaminings. They are meaningful. But I have some comments: "r = 0.5 * radius_effective; I believe this should just be r = radius_effective." yes, I think you are right. I will check the code but perhaps it is the other way around that in the code, one should have dist_points = 2.0 * radius_effective. "sig_rel_R => radius_cluster_pd (this is what I use in sasmodels scripting for the polydispersity parameter)" This is a bad choice since 'polydispersity' is not well-defined (Different in SAS (sigma/average), DLS (sigma/av)^2, polymer science (1+(sigma/av)^2)). So I suggest 'radius_cluster_sigma_relative', which should define it fully. "amp => peak_scale (see below)" Since it does not relate to a peak, I think that 'scale_power_law' is better, although it is not directly this due to the stabilization. |
|
Yes, it should be Regarding the polydispersity parameter, we are using the SAS definition of 1-σ relative weights. Your implementation of SCHULZ matches that in sasmodels, so the "unmarked form" for the polydispersity parameter name The following distributions are defined in sasmodels. Here r is the nominal value of the parameter, p is the relative polydispersity and n is the number of sigmas for the distribution:
Your definition of Schulz is the same after some rearrangement and change of variables. Original from SCHULZ: with After substitution using z = Z+1, R = R/R_A and r = R_A the formulas match: So the notion of pd width in sasmodels matches SIGL in your code. The center and limits of the distribution are surprising. I would have expected R_A = radius_cluster with R over [radius_effective, radius_cluster + 6 radius_cluster SIGL]. |
|
Yes, my Schulz follows the most common definition. The structure factor is based on the analytical solution of polydisperse spheres with a Schulz, so it is very fast. But it required some approximations to apply it in this context: R_L is the radius of the embedding sphere and R_L has relative sigma_L, but the distribution of the centers of the substructures should only be from R_L to R_L- R_S, where R_s is the same as radius_effective. There are no subparticles in spheres of radisu R_L < R_S and since R_L is the radius of the embedding sphere, we have to have R_L- R_S as the maximum value. To use the analytical solution we neglect the problems at 0 radius, since this is anyway contributing very little, and we have to make the approximation that R_L- R_S has the same sigma as R_L (this can probably be improved for example using sigma_L * R_L/(R_L - R_S), but I did not introduce that). There is a numerical calculation of the effective structure factor that gives the internal correlation of the subparticles. This has to be done numerically, as the spheres at the periphery (R_L- 2 * R_S) to R_L- R_S has fewer neighbors, and that there are no subparticles in a large sphere with radius R_L = R_S due to definition of R_L being the radius of the embedding sphere. Therefore the integration starts at R_S. I think/hope that for reasonable polydispersities, the upper limit of the integration is large enough. Anyway, all of this is done in order to have a reasonable estimate of local correlations with slowing the calculations down too much. And note that this is done on the 'N level' and not on the 'N^2 level' as it gives the high q behavior, so it is less justified to neglect the discrepancies at lower bound. Anyway, S_HS(q) cannot be averaged over the Schulz distribution in any case... I am working on a document that gives these more subtle details of the model and we could include it in the documentation in the PY file later on. |
Submitting on behalf of @Janskovp
Summary
This pull request adds six new models under the structure-factor category, aimed at scattering from aggregates and related power-law behaviour. Most implementations use compiled C kernels with Python model definitions, following existing sasmodels conventions. A follow-up commit applies Ruff formatting to the new Python files.
New models
structure_factor = False—worth confirming intended behaviour in SasView vs other (S(q)) plugins.Files
compact_polydisperse_cluster.{py,c}fractal_aggregate.{py,c}fractal_aggregate_discrete_chain.{py,c}free_rotating_chain.{py,c}linear_aggregate.{py,c}stabilized_power_law.py(PythonIqonly)