Opened 3 years ago

Last modified 15 months ago

#780 new enhancement

let the user set effective radius in P(Q)*S(Q)

Reported by: pkienzle Owned by:
Priority: major Milestone: SasView Next Release +1
Component: SasView Keywords:
Cc: Work Package: Beta Approximation Project

Description

sasmodels.product defines P(Q)*S(Q) using the effective radius from P(Q) as the radius_effective parameter in S(Q). This is not always correct, and should be under control of the user. Similarly for volfraction and VR.

Instead of hard-coding this relationship, make ER and VR available as derived parameters from the model. These parameters will only be computed if their value is requested. Models could potentially allow other derived parameters.

Use sasmodels.mixture to multiply the models. Make sure that it supports arbitrary model expressions, not just A+B.

May want to allow model constraints to be set in the model value field. When the radius_effective field is edited, the user will see =A_ER, indicating the that the ER() derived parameter from model A should be evaluated. This will save bouncing to a constraints page to indicate a simple constraint.

Change History (7)

comment:1 Changed 2 years ago by butler

  • Milestone changed from SasView Next Release +1 to SasView 4.3.0

comment:2 Changed 18 months ago by richardh

The new qt gui has "+ symbols" on left of parameter table to expand details on polydispere radius etc, could we use the same mechanism to show constraints such as those for E_R and V_R ?

More generally are there any ideas yet for how to handle constraints in the qt gui?

comment:3 Changed 18 months ago by butler

  • Work Package changed from SasView Bug Fixing to Beta Approximation Project

comment:4 Changed 18 months ago by richardh

  • Milestone changed from SasView 4.3.0 to SasView Next Release +1

comment:5 Changed 17 months ago by richardh

Would be good for someone to explore how sasmodels.mixture etc currently add and multiply models and what happens to the flat backgrounds. In particular note that an S(Q) should never multiply a flat background.

Sometimes when we write P(Q) we mean including scale, contrast and background thus

P(Q)=scale.(delrho)2.<F2(Q)>+bkg

where, if sld difference is correct and the model is correct for the system we have

scale=phi=NV=volume_fraction

where there are N particles of volume V per unit volume of sample,

What we really need in sasview is P(Q)=scale.phi.(delrho)2.V.<F2(Q)>+bkg

where some factors of V have been shuffled around depending upon the exact definition of F(Q). Check carefully what sasview models return before adding a new calculation of <F(Q)>.

"scale" should be 1.0 if everything else is correct and I(Q) and delrho in the correct units.

bkg has to be removed or forced to zero if in danger of being multiplied by S(Q).

phi is the volume fraction parameter to be used by default along with the effective radius ER in S(Q) such that:

I(Q) = P(Q,scale,phi,ER).S(Q,phi,ER) + bkg

where it is emphasised here that "scale" should ideally be included separately in P(Q) in order to sort problems with the units of I(Q). More pragmatically, if scale is not 1.0, and our model only has a single scale and/or phi parameter, then we must let phi be set in S(Q) and not constrained to something from P(Q, thus:

I(Q) = P(Q,scale,ER).S(Q,phi,ER) + bkg

Then if the user knows what the unit fudge factor in scale is, they might want a constraint in S(Q) such that phi = constant.scale

This all requires a little thought and some testing, but the existing code is likely almost OK.

comment:6 Changed 15 months ago by richardh

For standard P(Q)S(Q) choices sasview 5.0 will have a menu drop down to choose the effective_radius for S(Q) for relevant P(Q) models.

effective_radius can be freely adjusting (or fixed) or constrained to either a mean curvature value or radius of sphere with same volume (as forced by sasview4) or now constrained to other P(Q) model dependent choices such as a minimum or maximum radius of the particle.

In the sasmodels beta_approx_new_R_eff branch a large number of models have had the new options included , these are currently (8 Sept 2018) being tested.

Sasview 4 calculations of ER have now been moved to .c files, the .py file for the model now contains only an index of ER types e.g. for core_shell_cylinder we have:

effective_radius_type = ["equivalent sphere","outer radius","half outer length","half min outer dimension",

"half max outer dimension","half outer diagonal"]

The type strings should be self explanatory.

We need to check what happens (and what is wanted) regarding polydispersity (in principle ER could perhaps be averaged over polydispersity?).

comment:7 Changed 15 months ago by tcbennun

The SasView 5.0 functionality to support beta_approx_new_R_eff is covered by JIRA issue 1052, and the feature branch is ESS_GUI_iss1052.

Last edited 15 months ago by butler (previous) (diff)
Note: See TracTickets for help on using tickets.