Skip to content
RichardHeenan edited this page Mar 19, 2020 · 5 revisions

Some aspects of this have not actually been done yet, so could do with new tickets, but maybe we need to write a new master ticket first?

Last July I wrote two versions of a constrained core/shell ellipsoid (a) as a normal model and (b) using Paul K’s experimental reparameterize capability. [Paul K has proven that this is the most used spelling according to Google, so not reparametrize nor reparametrise.] The examples solve a cubic equation on the fly for the shell thickness, so unlike most sasview models can have both core radius and shell thickness varying inside a single polydispersity loop. The parameters include “dry shell to core volume ratio”, and “local fraction of solvent in shell”. This provides a practical parameter space for many polymers and surfactants.

See https://github.com/SasView/sasmodels/issues/381 and https://github.com/SasView/sasmodels/pull/211 (note this never had a ticket, just a pull request from Paul K !)

I have also just made for a colleague core/shell versions of flexible_cylinder, called core_shell_flexible_cylinder and core_shell_flexible_cylinder_tied. [can send these to anyone interested, I ought to make a branch for some new models]. Many of the other core/shell models could be treated likewise.

It would be useful to know what sort of molecular constraints etc those at other facilities (e.g. Lionel & Sylvain at ILL) would like to see more of.

For larger polymer micelles perhaps the solvent fraction varies through the shell, or indeed the core and shell have an imprecise boundary. Though sasview has various core multi-shell models something with some molecular constraints might be better?

See also request for pegylated vesicle https://github.com/SasView/sasmodels/issues/225

The extreme case for molecular constraints is perhaps a charged ellipsoidal micelle model which starts with molar volumes of the heads & tails, aggregation numbers, hydration numbers, fractional charge per head, ionic activities, etc then computes all the parameters for the Hayter-Penfold S(Q). Having done this myself in FISH using constraints, it is probably easier to write a one off P(Q)S(Q) model for this specific case. Then you may want to add in some penetrating solvent, co-solvent, or a drug molecule that partition between core and shell.

Issues yet to be addressed include -

– feeding back the value of the computed shell thickness or other parameters to the user via some new place in the gui, and then into any fit reports generated.

  • Checking that we get the results that we expect when adding polydispersity.
  • For technical reasons all the parameters that control particle volume have to be “volume” parameters, which allows them to be set as polydisperse even when that is not physically sensible (e.g for the “local fraction of solvent in shell” see notes in core_shell_ellipsoid_tied.c).
  • Ensuring that users really can tell what model was being used on saving results of a fit.
  • Document reparameterize- this has been done!.
  • FIXED BUG in reparameterize – at least in Windows v5 sasview, the gui is not reporting the original parameters, only the new ones (as detailed by Miguel last July). - specific ticket for this https://github.com/SasView/sasmodels/issues/381 - fixed in this PR https://github.com/SasView/sasmodels/issues/381

However it does occur to me that even a simple reparameterize is still going to be rather scary for the average user, and still generates a completely new model in the list.

Should we have ways of adding a “sub-level” to model names in the gui so that versions are all kept together as far as the user is concerned. Paul K suggests a CASES=[....] structure see https://github.com/SasView/sasmodels/issues/215

Can we see a way to allow a simpler interface in the gui to generate the reparameterized model?

Related ideas -

  • Relational constraints don’t exist yet in sasview, e.g. 10 < shell_thickness < 20 can be done by setting Min & Max limits on the parameter value (would this apply inside polydispersity ? – likely not ? ) Are any more complex relational constraints needed ? – or between tabs for different data sets ?
  • Please test constraints within one data set (select one line, ctrl/click another, then right click) and between data sets in v5 (in fitting drop down, select constrained or simultaneous fit to open the tab).

Perhaps we could have a discussion on all of this close to the start of code camp?

Issues related to sum & multiply models, numerical integration etc are outlined here: https://github.com/SasView/sasview/issues/1470 including the desire to pass back derived values to the user https://github.com/SasView/sasmodels/issues/182

Regards to all, Richard

Yet more on constraints

Additional fixed parameters (though a plugin model plus constraints could do this easily) https://github.com/SasView/sasview/issues/978

Ought to close this one ? https://github.com/SasView/sasview/issues/621

Following up on recent user email from John Hackett, I note that on the model marketplace Thomas Cleveland (then at NIST), wrote nanodisc_simple which has taken a different, rather complex, approach to putting in molecular sld's. Is there anything we can usefully take from his contribution? At present I cannot get the nanodisc_simple model to run, despite making some changes for python 3.

Clone this wiki locally