Opened 6 years ago

Last modified 5 years ago

#1118 new enhancement

middle level - sort out P(Q)S(Q) including beta(Q)

Reported by: richardh Owned by: richardh
Priority: blocker Milestone: sasmodels Next Release +1
Component: sasmodels Keywords:
Cc: Work Package: Beta Approximation Project

Description

See general introduction to beta(Q) project in #1096

Need technical details here as to what to change in what order to develop product.py and other (?) routines to achieve immediate goals of simple sphere, cylinder & ellipsoid times simple S(Q) but keeping in mind some longer term goals for more options and improved usage of gpu (#1091#392 )

Ideally any calculation of I(Q) should only have one "flat background" at the end, but we may have to stick with each P(Q) carrying a flat background around with it. 

Some detail discussion and use cases are required here.

Attachments (4)

PS_test3_5July2018.svs (53.0 KB) - added by richardh 6 years ago.
P(Q)S(Q) default compared to plugin for ellipsoid*hard_sphere, local build of 4.2
PS_test5_from_4p2_5July2018.svs (53.0 KB) - added by richardh 6 years ago.
project P(Q)S(Q) test 5, from 4.2 local build
PS_test5_default_model.png (115.7 KB) - added by richardh 6 years ago.
PS_test5 default P(Q)S(Q)
PS_test5_plugin_model.png (113.9 KB) - added by richardh 6 years ago.
PS test5 Plugin model to compare

Download all attachments as: .zip

Change History (13)

comment:1 Changed 6 years ago by richardh

Suspect that we should first check that we are happy with the way the sum & product model parameters are being named, and that flat backgrounds and scale factors are being appropriately treated.

comment:2 Changed 6 years ago by butler

Scale and background were moved out of the model definition so that they can be more easily controlled for various combinations. Indeed I believe background is now only added ONCE to any combined model or it is supposed to be. Scale depends on whether it is a product or sum model: sums should have a scale for each since that allows for setting the fraction of I(Q) that is due to each model being summed incoherently, while the product model only has one scale factor I believe since 2 would be redundant.

This has caused a few other issue however, in that not all parts of the code may yet be aware yet that background and scale are added from outside the model code itself?

Changed 6 years ago by richardh

P(Q)S(Q) default compared to plugin for ellipsoid*hard_sphere, local build of 4.2

comment:3 Changed 6 years ago by richardh

Attached project, run from my local master build of 4.2, Fitpage1 & Fitpage2 ought to give identical fits, for ellipsoid x hard_sphere, though similar they are not the same! Nor do I yet understand the scale factor from the plugin model on Fitpage2, I am still investigating, but others might like to try different versions of the code.

Note the data set was loaded twice, once to send to each fit page, else the P(Q) and S(Q) overplots don't update as noted in other tickets. (Also I first checked that the default model gave same results on Fitpage2 as Fitpage1 when set up the same way.)

In terms of user functionality, the prefixed A_ and B_ strings on parameter names in the sum/multi could be chosen by the user.  For our default P(Q).S(Q) they could be an empty string for P(Q), ie unmodified, and say S(Q)_ for the S(Q) parameters.

comment:4 follow-up: Changed 6 years ago by richardh

Ahhh 4.1.2 sum/multi generates ellipsoidxhard_sphere with an extra "BackGround?" at the end of the parameters, with parameter names prefixed by p1_ and p2_.

Presume 4.2 mentioned in previous comment is supposed to be better.

Ahh going back to 4.2, just loading my 4.2 plugin model of ellipsoidxhard_sphere, I no longer get separate P(Q) and S(Q) in theories part of data window, which were previously there and updating, after I had previously used default P(Q)S(Q) on same Fitpage.

Is sum/multi plugin generator supposed to spot an S(Q) being used in 4.2 and take appropriate action?

Investigations continue …

Changed 6 years ago by richardh

project P(Q)S(Q) test 5, from 4.2 local build

comment:5 Changed 6 years ago by richardh

PS_test5 project, all from 4.2, you may need a plugin model for FitPage2, to multiply ellipsoidx hard_sphere. Two screenshots show the parameters and fits.

Params on FitPage2 are copied from FitPage1 default fit, plus computed value of ER, adjusting only scale and backgroun now gets very close to expected agreement with FitPage1. I am however so far mystified as to why scale parameter fits to same number as B_volfraction in the S(Q), might have expected it to be 1.0 ???

Changed 6 years ago by richardh

PS_test5 default P(Q)S(Q)

Changed 6 years ago by richardh

PS test5 Plugin model to compare

comment:6 follow-up: Changed 6 years ago by richardh

There are some comments on the development of sum/multi in #1099 , with saasview 3.1.2, 4.1.2 and 4.2 alll being different, so we should focus efforts on moving 4.2 forwards for anything in the beta(Q) project.

comment:7 in reply to: ↑ 4 Changed 6 years ago by butler

I don't believe sum/multiply pays attention to P vs S. I think the assumption is that P*S already existing there would be no reason to do that with sum/multiply…. of course for the case of P1 + (S*P2) there is no other way .. and one cannot save a standard P*S at the moment.

Replying to richardh:

Ahhh 4.1.2 sum/multi generates ellipsoidxhard_sphere with an extra "BackGround?" at the end of the parameters, with parameter names prefixed by p1_ and p2_.

Presume 4.2 mentioned in previous comment is supposed to be better.

Ahh going back to 4.2, just loading my 4.2 plugin model of ellipsoidxhard_sphere, I no longer get separate P(Q) and S(Q) in theories part of data window, which were previously there and updating, after I had previously used default P(Q)S(Q) on same Fitpage.

Is sum/multi plugin generator supposed to spot an S(Q) being used in 4.2 and take appropriate action?

Investigations continue …

comment:8 in reply to: ↑ 6 Changed 6 years ago by butler

Indeed - the 4.2 sum/multiply is a very different structure. Currently (4.2.0) we are supporting all 3 versions (3.1.2, 4.1.2 and 4.2) but release notes will say something about probably not supporting the earlier 2 by version 5.0.

Replying to richardh:

There are some comments on the development of sum/multi in #1099 , with saasview 3.1.2, 4.1.2 and 4.2 alll being different, so we should focus efforts on moving 4.2 forwards for anything in the beta(Q) project.

comment:9 Changed 5 years ago by pkienzle

  • Component changed from SasView to sasmodels
  • Milestone changed from SasView Next Release +1 to sasmodels Next Release +1
Note: See TracTickets for help on using tickets.