SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

Add Maier-Saupe type orientational distribution (Trac #1066) #221

Open smk78 opened 5 years ago

smk78 commented 5 years ago

On testing 4.2 beta User Matt Helgeson expressed dismay that the functional forms for orientational distributions were still the same as those for polydispersity. The issue being that the current distributions (Gaussian, log-normal, etc) are all unphysical for orientaional purposes because they are not periodic. And the array function is ''mostly useless...since fitting routines cannot change entries in the input array''.

@butler asked what distributions would be appropriate.

Matt replied ''In our experience, the anisotropy/orientation distribution from almost every elongated object we've measured (WLMs, polymers, rodlike particles) follows a Maier-Saupe type distribution. The general functional form involves exponentials of Legendre polynomials. I've attached a couple papers that go into various levels of sophistication in this regard. Eqn. 1 of Picken et al. (Macromolecules 1990) shows the basic functional form that tends to work for elongated systems which show two-fold symmetry. This can be generalized to n-fold symmetry, as in Bhattacharjee et al. (Molecular Physics 1981) eqn. 2.''

''There are also much more rheologically consistent models that one can achieve by solving the Smoluchowski equation in various situations. For example, for shear flow, some of this was actually worked out by Norm Wagner and Lynn Walker during Lynn's Ph.D. (Macromolecules 1994). However, for a simple functional form for fitting, the Maier-Saupe type equations seem to work pretty well.''

Migrated from http://trac.sasview.org/ticket/1066

{
    "status": "new",
    "changetime": "2018-09-12T21:20:56",
    "_ts": "2018-09-12 21:20:56.238029+00:00",
    "description": "On testing 4.2 beta User Matt Helgeson expressed dismay that the functional forms for orientational distributions were still the same as those for polydispersity. The issue being that the current distributions (Gaussian, log-normal, etc) are all unphysical for orientaional purposes because they are not periodic. And the array function is ''mostly useless...since fitting routines cannot change entries in the input array''.\n\n@butler asked what distributions would be appropriate.\n\nMatt replied ''In our experience, the anisotropy/orientation distribution from almost every elongated object we've measured (WLMs, polymers, rodlike particles) follows a Maier-Saupe type distribution. The general functional form involves exponentials of Legendre polynomials. I've attached a couple papers that go into various levels of sophistication in this regard. Eqn. 1 of Picken et al. (Macromolecules 1990) shows the basic functional form that tends to work for elongated systems which show two-fold symmetry. This can be generalized to n-fold symmetry, as in Bhattacharjee et al. (Molecular Physics 1981) eqn. 2.''\n\n''There are also much more rheologically consistent models that one can achieve by solving the Smoluchowski equation in various situations. For example, for shear flow, some of this was actually worked out by Norm Wagner and Lynn Walker during Lynn's Ph.D. (Macromolecules 1994). However, for a simple functional form for fitting, the Maier-Saupe type equations seem to work pretty well.''\n",
    "reporter": "smk78",
    "cc": "",
    "resolution": "",
    "workpackage": "SasView GUI Enhancements",
    "time": "2018-01-25T09:42:49",
    "component": "SasView",
    "summary": "Add Maier-Saupe type orientational distribution",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.3.0",
    "owner": "",
    "type": "defect"
}
smk78 commented 5 years ago

Trac update at 2018/01/25 09:43:27:

Picken et al paper

smk78 commented 5 years ago

Trac update at 2018/01/25 09:43:55:

Bhattacharjee et al paper

smk78 commented 5 years ago

Trac update at 2018/01/25 09:44:31:

Wagner Walker paper

RichardHeenan commented 5 years ago

Trac update at 2018/01/25 15:30:16: richardh changed attachment from "" to "Hardouin_etal_MaierSaupe_Macromolecules_1995.pdf"

RichardHeenan commented 5 years ago

Trac update at 2018/01/25 15:30:28: richardh commented:

Here is another paper regarding Maier Saupe - Hardouin et.al. (though I have a note in the FISH manual that eqn (9) here is wrong, its a long time since I looked into this, so I don't recall the details)

RichardHeenan commented 5 years ago

Trac update at 2018/01/25 16:12:40: richardh commented:

I am already confused, Eqn (6) of Hardouin (which is what I used in FISH) does not seem to me to agree with eqn (1) of Picken, is there more than one definition of "Maier Saupe distribution"?

Before we ask external usrers, has anyone on the sasview tem looked into this previously?

RichardHeenan commented 5 years ago

Trac update at 2018/01/25 16:57:56: richardh commented:

I don't have access to "molecular physics" for the earlier references, but did stumble across "Evaluation of equatorial orientation distributions" by C. Burger and W. Ruland, J.Appl.Cryst 39( 2006) 889-891, linked below

http://onlinelibrary.wiley.com/doi/10.1107/S0021889806038957/epdf

This says that Leadbetter & Norris made a mistake in 1979. However the gax(beta) in eqn ~10, agrees with Hardouin, but there is yet another function for geq(psi). I suspect that we need more than one orientation function for different directions? Someone needs to talk to an expert.

smk78 commented 5 years ago

Trac update at 2018/01/25 17:11:36: smk78 commented:

There are probably some papers by the likes of Geoff Luckhurst from the 70's/80's that use M-S.

Rob Richardson might be another port of call?

butlerpd commented 5 years ago

Trac update at 2018/02/13 14:56:28:

smk78 commented 5 years ago

Trac update at 2018/02/13 14:59:39: smk78 commented:

On 1/26/2018 6:59 AM, Katie Weigandt wrote: Hi Paul and Matt et al,

I am not convinced that you should wait to release the 2D fitting update as it exists if it is found to be functional and corrects the problems and bugs from previous iterations. I think that there is a lot of power to this tool beyond fitting the orientation distribution. For instance, one might fit an annular average to determine the orientation distribution function and then load that distribution in as an array. Once the orientation distribution is determined it can be fixed as a fitting parameter and other form factor parameters can be fit.

That being said I wan't to be clear, that I agree that adding additional distribution averages more relevant to aligned particles is an excellent idea and should still be prioritized. I have an example system with two phases in coexistance where we think the best fit might be bimodal with a fully isotropic population and a partially aligned population. In this case, I would try to fit the data as a sum of two models, one with a fixed isotropic distribution and a second with a fitted orientation distribution. In fact, for maximum power and flexibility if it were possible to accommodate user defined distribution functions that are fittable that would be even better...

smk78 commented 5 years ago

Trac update at 2018/02/13 15:00:26: smk78 commented:

From: Matthew Helgeson

Yes, this is a good idea. The drawback will be that fitting to an annular average collapses the orientation distribution to a single (in-plane) orientation angle distribution, whereas the model fit calls for orientation distributions with two angles (one in-plane and one out-of-plane). What should one then do with the out of plane angle?

smk78 commented 5 years ago

Trac update at 2018/02/13 15:01:54: smk78 commented:

From: Richard Heenan

Dear Matt, Katie and others

Though Paul Butler may follow up with you directly, I have added some comments to ticket 1066, here http://trac.sasview.org/ticket/1066 We can set up others to have access to add to the ticket there if that will help.

I think the sasview team are going to need some help here to see what would be most useful to try code up.

There are 3 polydispersity or “jitter” integrations as Paul Kienzle calls them, for the particle orientation, which are now in particle coordinates, plus 3 angles theta, phi, psi to define the starting orientation of the particle in space. Thus if an integration is needed over only one angle then we should be able to do this in some way.

'''It would be very helpful to have some people write down exactly what calculations sasview should do and for what forms of distribution function, for say a cylinder and also for say an elliptical cylinder as prototype symmetric and asymmetric particles. [See for example eqns (6)-(9) in the Hardouin et.al. paper, though what is there may or may not be correct???]'''

We may need several different versions of distribution, and possibly even some new types of integration (though we will avoid this if we can as the underlying integration code will get even more complex).

It will be good to expand the usefulness of sasview for 2d data.

pkienzle commented 5 years ago

Trac update at 2018/09/12 21:20:56: pkienzle commented:

Here's a link to a gisaxs page with Ruland eta and Maier-Saupe distributions:

http://gisaxs.com/index.php/Circular_orientation_distribution_function

Both functions have a single parameter controlling the distribution width, and so a suitable for use in SasView.

The Maier-Saupe distribution is implemented in examples/weights/maier_saupe.py in the ticket-608-user-defined-weights branch of sasmodels.

pkienzle commented 2 years ago

Since this only needs to move code from sasmodels/examples/weights/maier_saupe.py to sasmodels/weights.py it is an easy first issue for someone interested in fitting weakly oriented systems.

pkienzle commented 2 years ago

It is better to use the cyclic gaussian distribution, which is equivalent to Maier-Saupe with parameter a = 1/(2σ²). Code for this is in cyclic_gaussian.py.

The cyclic gaussian behaves like a gaussian distribution for small σ and a uniform distribution for large σ, so it is easier to understand what it is doing. Maier-Saupe, unlike other distributions, gets broader as a gets smaller. It should be uniform over the circle for a=0 but sasmodels treats this case as no distribution present, so it will instead be completely oriented. We could "fix" this in sasmodels by setting the target value for no width on each distribution (a=∞ for Maier-Saupe) but this adds a lot of complexity for a single case.

Regardless, extracting the order parameter P₂ from σ or a will require additional code outlined at the top of maier_saupe.py. This transformation needs to be included in the distribution docs. It may be useful to calculate P₂ within the SasView, but this will need to be coded specially for this distribution.

A third possibility is to control the distribution from the order parameter, calculating the equivalent a within the weights function when needed. Code for computing a is included in maier_saupe.py. Checking, P₂(a) is monotonic increasing and P₂(a=0) = 0, so it will have the same confusing behaviour as Maier-Saupe.

pkienzle commented 2 years ago

Whichever distribution we choose we should add it as an option in sasmodels/jitter.py.

lucas-wilkins commented 2 years ago

If its just a reparameterisation of the probability density function, then simply using the circular gaussian seems pretty reasonable. Then again, it seems like best practice would be to avoid having parameters that have a special meaning if set to a certain value, and to use flags, or options instead.