Ticket #5597 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

Fit test of DiffSphereTest fails when tried on MantidPlot

Reported by: Jose Borreguero Owned by: Jose Borreguero
Priority: trivial Milestone: Release 3.1
Component: Indirect Inelastic Keywords:
Cc: Blocked By:
Blocking: Tester: Russell Taylor

Description (last modified by Jose Borreguero) (diff)

Resolution of this ticket is dependent on resolution of ticket #4394

Resolution of this ticket is dependent on resolution of ticket #5603

The fit test in DiffSphereTest test the convolution of a Gaussian resolution function with a DiffSphere function. The target parameters are:
Gaussian c=0 h=3.0 sigma=0.62
DiffSphere I=2.9 Q=0.70 R=2.3 D=0.45

The initial parameters are:
Gaussian c=0 h=3.0 sigma=0.62
DiffSphere I=1.3 Q=0.70 R=1.4 D=1.5

Fitting in MantidPlot produces the following error:
Error in execution of algorithm Fit:
GSLVector index is out of range

Starting with different initial parameters, very close to the target ones:
Gaussian c=0 h=3.0 sigma=0.62
DiffSphere I=2.7 Q=0.70 R=2.5 D=0.46

results in another error:
Error in execution of algorithm Fit:
Error in function boost::math::sph_bessel_j<e>(e,e): Got x = -29910.0084641663015645, but function requires x > 0.

Attachments

DiffSphere1.dat (3.0 KB) - added by Roman Tolchenov 8 years ago.

Change History

comment:1 Changed 8 years ago by Jose Borreguero

  • Status changed from new to accepted

comment:2 Changed 8 years ago by Jose Borreguero

  • Description modified (diff)

comment:3 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.2 to Release 2.3

comment:4 Changed 8 years ago by Jose Borreguero

  • Status changed from accepted to verify
  • Resolution set to fixed

DiffSphere now correctly inherits from ImmutableCompositeFunction and outputs a string representation akin to a non-composite function

comment:5 Changed 8 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

Changed 8 years ago by Roman Tolchenov

comment:6 Changed 8 years ago by Roman Tolchenov

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Fitted in MantidPlot to the data extracted from DiffSphereTest. If the initial values are close to the given it works fine. Although the following function gives the error message of the second type.

(composite=Convolution;name=Gaussian,Height=3,PeakCentre=0,Sigma=0.62;
(name=DiffSphere,NumDeriv=true,Q=0.69999999999999996,Intensity=16.0614,
Radius=5.97427,Diffusion=1908.43))

comment:7 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.3 to Release 2.4

comment:8 Changed 8 years ago by Jose Borreguero

Refs #5597 Substitute pointer by string representation

modified: DiffSphere.h modified: DiffSphere.cpp modified: DiffSphereTest.h

Changeset: 7d1348d31656f6ee4aba72e9344a2728832a2770

comment:9 Changed 8 years ago by Jose Borreguero

Refs #5597 Substitute pointer by string representation

modified: DiffSphere.h modified: DiffSphere.cpp modified: DiffSphereTest.h

Changeset: 7d1348d31656f6ee4aba72e9344a2728832a2770

comment:10 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.4 to Release 2.5

comment:11 Changed 7 years ago by Jose Borreguero

  • Milestone changed from Release 2.5 to Release 2.6

comment:12 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:13 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to the Backlog after the code freeze for R2.6

comment:14 Changed 7 years ago by Nick Draper

  • Milestone changed from Backlog to Release 3.0

moved to Release 3.0 as these all seem to be active

comment:15 Changed 7 years ago by Jose Borreguero

  • Description modified (diff)
  • Milestone changed from Release 3.0 to Release 3.1

comment:16 Changed 7 years ago by Jose Borreguero

  • Description modified (diff)

comment:17 Changed 7 years ago by Jose Borreguero

  • Description modified (diff)

comment:18 Changed 7 years ago by Jose Borreguero

  • Description modified (diff)

comment:19 Changed 7 years ago by Jose Borreguero

  • Status changed from reopened to verify
  • Resolution set to fixed

The unit tests in DiffSphereTest are working now, after closing of ticket #4394.

Negative arguments being passed on to the spherical Bessel functions are now prevented by assigning an "infinite" Chi-square to the fit. Negative arguments are unphysical.

TESTER:

There's nothing to test, but you can review the code and note in particular that numeric_limits<double>::infinity() is assigned to the output of DiffSphere.cpp:InelasticDiffSphere::function1D() when either of the fit parameters become negative.

comment:20 Changed 7 years ago by Jose Borreguero

  • Priority changed from major to trivial

comment:21 Changed 7 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester changed from Roman Tolchenov to Russell Taylor

comment:22 Changed 7 years ago by Russell Taylor

  • Status changed from verifying to closed

Looked over the mentioned code, though it's been in master for ages.

comment:23 Changed 7 years ago by Jose Borreguero

  • Component changed from Framework to Indirect Inelastic

comment:24 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6443

Note: See TracTickets for help on using tickets.