Opened 6 years ago

Closed 6 years ago

#1099 closed defect (fixed)

Erratic behaviour of Sum|Multi model in 4.1.2

Reported by: smk78 Owned by:
Priority: critical Milestone: SasView 4.2.0
Component: sasmodels Keywords:
Cc: Work Package: SasView Bug Fixing

Description

Affects 4.1.2.

This is a bit difficult to describe so bear with me:

One of my users wanted to fit the attached dataset to extract the peak position and width but in the presence of the power law regime at low-Q. Only later did they spot the broad_peak model, but this combines a power law and a Lorentzian. They wanted to fit a Gaussian to the peak so used Sum|Multi to sum power_law and gaussian_peak (generating the attached broadgaussian plugin).

At some level this model can be used to generate a fit, but it is very 'clunky' and changes to the parameters do not always result in the model curve or Chisq/Npts updating. We tried L-M and N-M optimisers.

Puzzled, I went off and tried the same thing in 3.1.2, summing powerlawabs and peakgauss (generating the attached broadgaussianold plugin). This works very nicely. It's crisp and responsive.

You need to try what I've just described to see what I mean.

As a workaround the user is installing 3.1.2. alongside 4.1.2.

Attachments (4)

4801p0mm1D_rear.xml (15.6 KB) - added by smk78 6 years ago.
Example data file to fit
broadgaussian.py (10.9 KB) - added by smk78 6 years ago.
Sum|Multi model created in 4.1.2
broadgaussianold.py (10.9 KB) - added by smk78 6 years ago.
Sum|Multi model created in 3.1.2
broadgaussian_SumMulti4p2.py (303 bytes) - added by butler 6 years ago.
Sum|Multi model created in 4.2

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by smk78

Example data file to fit

Changed 6 years ago by smk78

Sum|Multi model created in 4.1.2

Changed 6 years ago by smk78

Sum|Multi model created in 3.1.2

comment:1 Changed 6 years ago by butler

follow up from meeting at IPRIME where I met Peter Schmidt from Lodge and Bates group who complained about a similar problem. Suggested it looks like it was fitting only one of the two models in the combo. Hitting fit gets a plot then hit compute with calculated parameters and the plots change. He also says that going back to 4.0 works but after that the problem seems to have crept in.

comment:2 Changed 6 years ago by butler

After some "extensive" testing it appears that the specific problems are resolved already in 4.2. Users should be asked to check to ensure we have not missed something. I used the release versions of 3.1.2 and 4.1.2 and the June 15 windows 64 build from Jenkins for the 4.2 tests. I used the files attached here plus, for 4.2, I created a new sum/multiply model with the same two functions. I will attach that to this ticket next. Some important notes:

  1. The sum/multiply model went through an intermediate stage in 4.1.2 so that the file created by 3.1.2 is different from that created by 4.1.2 is different from 4.2. This last now only has ~6 lines, the first two being import statements, indicating the two models being combined and with what operator along with the name to give it and a description string. The sasmodels infrastructure now takes care of everything else.
    1. SasView 3.1.2 only recognizes the sum/multiply created by 3.1.2 and before
    2. SasView 4.1.2 recognizes both the sum/multiply created by 3.1.2 and 4.1.2
    3. SasView 4.2 recognizes all three (those created by 3.1.2, 4.1.2 and 4.2). With 5.0 we maybe should stop supporting at least the old 3.1.2 sum/multiply models?
  2. SasView 4.1.2 seems to have several issues - most of which seem to be resolved in 4.2.
    1. Fit runs the fit and returns values but does not update the plot until either Fit is run again or the Compute button is hit.
    2. From time to time it appears that hitting fitting does nothing and needs to be pressed a second time to launch. This also seemed to happen in 4.2 but much less frequently?
    3. Very annoyingly, if the tab is started as a fit tab, the residual tab displays TWO … different curves — no idea what the second is actually plotting. If instead the tab is started as a theory tab and then the data sent to the tab, the residual plot behaves correctly.
  3. Note that a Guassian peak may not be the best way to model this broad shoulder in log space — to capture that the width needs to be pretty large forcing the center of the Gaussian to be negative 0.05!! it can be fit reasonably by enforcing a q peak minimum of 0 but …

Changed 6 years ago by butler

Sum|Multi model created in 4.2

comment:3 Changed 6 years ago by butler

I have pinged Peter Schmidt of UMN to verify that 4.2 has resolved the issues of this ticket. We need to follow up with the user that first reported the issue as well. Assuming they confirm we can resolve this ticket as fixed.

comment:4 Changed 6 years ago by smk78

Testing 4.2 Build 368 on W7 this issue now seems to be resolved, or at least greatly improved.

The L-M optimiser is perhaps not the best for this kind of model; N-M-S worked much better.

I have told the original user who reported the issue.

comment:5 Changed 6 years ago by smk78

After discussion with Paul I am closing this ticket. If the User reports adverse problems we will reopen.

comment:6 Changed 6 years ago by smk78

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.