Ticket #4394 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

quasielastic diffusion-in-a-sphere fitting algorithm

Reported by: Jose Borreguero Owned by: Jose Borreguero
Priority: major Milestone: Release 3.1
Component: Indirect Inelastic Keywords:
Cc: Blocked By:
Blocking: Tester: Andrei Savici

Description (last modified by Jose Borreguero) (diff)

Fitting function modelling the continuos diffusion of a particle confined to an spherical volume. More details in the corresponding WIKI page http://www.mantidproject.org/DiffSphere.

TESTING: Upload all attachments to your /tmp directory, and run the python script in the Script Window of MantidPlot. Look in data_Parameters workspace to check that the fitting parameters are close to the target values, namely:

Intensity = 0.74, Radius = 2.25, Diffusion = 0.024

Attachments

test.py (1.3 KB) - added by Jose Borreguero 7 years ago.
data.nxs (57.0 KB) - added by Jose Borreguero 7 years ago.
resolution.nxs (60.6 KB) - added by Jose Borreguero 7 years ago.

Change History

comment:1 Changed 9 years ago by Jose Borreguero

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 32 to Iteration 33

Moved to iteration 33 at iteration 32 code freeze

comment:3 Changed 9 years ago by Jose Borreguero

Refs #4394 updated header file, started source file

comment:4 Changed 9 years ago by Jose Borreguero

Refs #4394 updated header file, started source file

comment:5 Changed 9 years ago by Jose Borreguero

Need to test the speed and accuracy by comparing the (default) Levenberg–Marquardt and Simplex methods.
Levenberg–Marquardt requires partial derivatives with respect to the active parameters. This translates to three extra evaluations of the structure factor when the numerical derivative is invoked
Simplex does not require partial derivatives

comment:6 Changed 9 years ago by Jose Borreguero

Refs #4394 Updated main fitting funtion

comment:7 Changed 9 years ago by Jose Borreguero

Refs #4394 Major rewrite of the fitting function

  • helper functions initXnlCoeff, initAlphaCoeff, initLinJlist,

LorentzianCoefficients

Changeset: d41a9cf0b8cd794ed6598df14535f9b439b61a87

comment:8 Changed 9 years ago by Jose Borreguero

Refs #4394 Finished debugging. Test passes

comment:9 Changed 9 years ago by Jose Borreguero

Refs #4394 fix bug in DiffSphereTest

Changeset: 3d62b8698cc6e45f720e807fd74432d393fdcdef

comment:10 Changed 9 years ago by Jose Borreguero

Refs #4394 Partitioned DiffSphere into elastic and inelastic parts

Changeset: 4a22643b940c98920b696a6adbf755945db722ce

comment:11 Changed 9 years ago by Jose Borreguero

Refs #4394 Added ties between elastic and inelastic

Changeset: 6b2d650f515a28943c6c8f2837558e6ab4076948

comment:12 Changed 9 years ago by Jose Borreguero

Refs #4394 Tying parameters of Elastic part to Inelastic part

Changeset: 8f73f033ab9ce279d33fbd2dcbf16ccbe9d243fc

comment:13 Changed 9 years ago by Jose Borreguero

Refs #4394 HeightPrefactor must be defined as public member

Changeset: 52b7c907fa125f4b7672277d3f5d6c1f0843947e

comment:14 Changed 9 years ago by Jose Borreguero

Refs #4394 Add constraints

Constraint parameters Intensity, Diffusion, and Radius to positive values

Changeset: b98fb43ddb5680e0654ee2710b8c25cba14fa8f1

comment:15 Changed 9 years ago by Jose Borreguero

Refs #4394 Updated main fitting funtion

comment:16 Changed 9 years ago by Jose Borreguero

Refs #4394 Major rewrite of the fitting function

  • helper functions initXnlCoeff, initAlphaCoeff, initLinJlist,

LorentzianCoefficients

Changeset: d41a9cf0b8cd794ed6598df14535f9b439b61a87

comment:17 Changed 9 years ago by Jose Borreguero

Refs #4394 Finished debugging. Test passes

comment:18 Changed 9 years ago by Jose Borreguero

Refs #4394 fix bug in DiffSphereTest

Changeset: 3d62b8698cc6e45f720e807fd74432d393fdcdef

comment:19 Changed 9 years ago by Jose Borreguero

Refs #4394 Partitioned DiffSphere into elastic and inelastic parts

Changeset: 4a22643b940c98920b696a6adbf755945db722ce

comment:20 Changed 9 years ago by Jose Borreguero

Refs #4394 Added ties between elastic and inelastic

Changeset: 6b2d650f515a28943c6c8f2837558e6ab4076948

comment:21 Changed 9 years ago by Jose Borreguero

Refs #4394 Tying parameters of Elastic part to Inelastic part

Changeset: 8f73f033ab9ce279d33fbd2dcbf16ccbe9d243fc

comment:22 Changed 9 years ago by Jose Borreguero

Refs #4394 HeightPrefactor must be defined as public member

Changeset: 52b7c907fa125f4b7672277d3f5d6c1f0843947e

comment:23 Changed 9 years ago by Jose Borreguero

Refs #4394 Add constraints

Constraint parameters Intensity, Diffusion, and Radius to positive values

Changeset: b98fb43ddb5680e0654ee2710b8c25cba14fa8f1

comment:24 Changed 9 years ago by Jose Borreguero

Refs #4394 Correction: arrays can't have runtime sizes

Changeset: dd43340c7cf1f9eec075656688854915fb3eb09f

comment:25 Changed 9 years ago by Jose Borreguero

Refs #4394 Added ElasticDiffSphere test

Convolution of a Gaussian resolution function with ElasticDiffSphere

Changeset: ea57d5aab0678e8f9b1f38cd75e0aa2ce3e118ee

comment:26 Changed 9 years ago by Jose Borreguero

Refs #4394 Added test function testDiffSphereTies

assert the ties between the elastic and inelastic contributions

Changeset: 32356596a6331c3c4d5aea2d7eb33830e6397d0d

comment:27 Changed 9 years ago by Jose Borreguero

Refs #4394 Moved ties to the constructor

-Removed init( ) and moved ties to the constructor -Wrote part of testDiffSphere

Changeset: 536dd2d9cad207ccb0070b85bc9707654d211c91

comment:28 Changed 9 years ago by Jose Borreguero

Refs #4394 Added first part of test function testDiffSphere

Changeset: 2c7de59125eeaf19cfca048f868314cdcf6c1edb

comment:29 Changed 9 years ago by Jose Borreguero

Refs #4394 inserted the conversion to microseconds in convFact

comment:30 Changed 9 years ago by Jose Borreguero

Refs #4394 Added ElasticDiffSphere test

Convolution of a Gaussian resolution function with ElasticDiffSphere

Changeset: ea57d5aab0678e8f9b1f38cd75e0aa2ce3e118ee

comment:31 Changed 9 years ago by Jose Borreguero

Refs #4394 Added test function testDiffSphereTies

assert the ties between the elastic and inelastic contributions

Changeset: 32356596a6331c3c4d5aea2d7eb33830e6397d0d

comment:32 Changed 9 years ago by Jose Borreguero

Refs #4394 Moved ties to the constructor

-Removed init( ) and moved ties to the constructor -Wrote part of testDiffSphere

Changeset: 536dd2d9cad207ccb0070b85bc9707654d211c91

comment:33 Changed 9 years ago by Jose Borreguero

Refs #4394 Added first part of test function testDiffSphere

Changeset: 2c7de59125eeaf19cfca048f868314cdcf6c1edb

comment:34 Changed 9 years ago by Jose Borreguero

Refs #4394 inserted the conversion to microseconds in convFact

comment:35 Changed 8 years ago by Jose Borreguero

Refs #4394 modifications in testDiffSphere

Changeset: 7ba9de312387865b8f3affe941f103effc0e8aa6

comment:36 Changed 8 years ago by Jose Borreguero

Refs #4394 testDiffSphere works on Ubuntu 11.10

Passing and retrieving pointers to the Fit alg, instead of strings

Changeset: 8988a2d707bf6a7cc3cb1a15b53baf67c29cdd32

comment:37 Changed 8 years ago by Jose Borreguero

Refs #4394 modifications in testDiffSphere

Changeset: 7ba9de312387865b8f3affe941f103effc0e8aa6

comment:38 Changed 8 years ago by Jose Borreguero

Refs #4394 testDiffSphere works on Ubuntu 11.10

Passing and retrieving pointers to the Fit alg, instead of strings

Changeset: 8988a2d707bf6a7cc3cb1a15b53baf67c29cdd32

comment:39 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.1 to Release 2.2

comment:40 Changed 8 years ago by Jose Borreguero

  • Description modified (diff)

comment:41 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.2 to Release 2.3

comment:42 Changed 8 years ago by Jose Borreguero

Refs #4394 Added global Q attribute

modified ParameterTie.h modified DiffSphere.h modified DiffSphere.cpp modified Fit.cpp modified DiffSphereTest.h

Changeset: 40bc658ec1ef4534c078f858d10e67bf0a547fa2

comment:43 Changed 8 years ago by Russell Taylor

Re #4394. Remove print statement.

It was causing a performance test to crash.

Changeset: 11e0c290edced54e8a156b3da25621eab9443842

comment:44 Changed 8 years ago by Jose Borreguero

Refs #4394 test works with conv->asString now

modified: CMakeLists.txt modified: DiffSphereTest.h

We can pass the Function property as a strings, instead of as a pointer to IFunction

Changeset: b7421d90ece40d08019c5579ac8d9613fa9635d9

comment:45 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.3 to Release 2.4

comment:46 Changed 8 years ago by Jose Borreguero

Refs #4394 Added global Q attribute

modified ParameterTie.h modified DiffSphere.h modified DiffSphere.cpp modified Fit.cpp modified DiffSphereTest.h

Changeset: 40bc658ec1ef4534c078f858d10e67bf0a547fa2

comment:47 Changed 8 years ago by Russell Taylor

Re #4394. Remove print statement.

It was causing a performance test to crash.

Changeset: 11e0c290edced54e8a156b3da25621eab9443842

comment:48 Changed 8 years ago by Jose Borreguero

Refs #4394 test works with conv->asString now

modified: CMakeLists.txt modified: DiffSphereTest.h

We can pass the Function property as a strings, instead of as a pointer to IFunction

Changeset: b7421d90ece40d08019c5579ac8d9613fa9635d9

comment:49 Changed 8 years ago by Jose Borreguero

  • Milestone changed from Release 2.4 to Release 2.5

comment:50 Changed 7 years ago by Jose Borreguero

  • Milestone changed from Release 2.5 to Release 2.6

comment:51 Changed 7 years ago by Nick Draper

  • Status changed from accepted to assigned

comment:52 Changed 7 years ago by Nick Draper

  • Status changed from assigned to new

comment:53 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:54 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to backlog at the code freeze for R2.6

comment:55 Changed 7 years ago by Jose Borreguero

  • Status changed from new to inprogress

Refs #4394 moved initialization steps from constructor to init

Changeset: a193f37414449809c1e00f9f72622f0cde394cdb

comment:56 Changed 7 years ago by Jose Borreguero

Refs #4394 Moved ElasticDiffSphere inside of DiffSphere

Changeset: 3ba74a5f3d2cd262d0a01b58ab12b8ac785a89df

comment:57 Changed 7 years ago by Jose Borreguero

Refs #4394 Moved some initialization steps to init

These changes for the elastic part

Changeset: a1c3b36f241fd99c7486207c707bf33d062b4cd5

comment:58 Changed 7 years ago by Jose Borreguero

Refs #4394 Moved inelastic part under DiffSphere files

Changeset: 4d5d49c652594c964b271194712f6dba91e26996

comment:59 Changed 7 years ago by Jose Borreguero

Refs #4394 Some refactoring

Changeset: 90cd7672a625ecd74ee68dd5ba7d5408fc72a23e

comment:60 Changed 7 years ago by Jose Borreguero

Refs #4394 redoing the unit test

Changeset: 2e13235a989e3955980c618ed074bdc19f56acd4

comment:61 Changed 7 years ago by Jose Borreguero

Refs #4394 Explicit check of boundaries

Changeset: 47e5376b9e4ea557039f35a86cc8d003e20fe7f5

comment:62 Changed 7 years ago by Jose Borreguero

Refs #4394 correct silly format syntax

Changeset: f253e120a3d30d71c4c345a16313b0dd071985d1

comment:63 Changed 7 years ago by Jose Borreguero

Refs #4394 Wrote four unit tests

Changeset: cc22d30b1f8a5d74edc1b202d2ce800f8213702e

comment:64 Changed 7 years ago by Jose Borreguero

Refs #4394 add numeric header

Changeset: 245a3c3eaa3e2b015bdcef697b4d598509924c61

comment:65 Changed 7 years ago by Jose Borreguero

Refs #4394 Reduced random variability in initial guess

Changeset: 8eb3bdfcc0c4305ba8adee9325ca5535d576aa53

comment:66 Changed 7 years ago by Jose Borreguero

Refs #4394 Added WIKI header

Changeset: a17c250595225d0a54c2cdcbbaa2446a62b63e1d

comment:67 Changed 7 years ago by Jose Borreguero

  • Description modified (diff)

Changed 7 years ago by Jose Borreguero

Changed 7 years ago by Jose Borreguero

Changed 7 years ago by Jose Borreguero

comment:68 Changed 7 years ago by Jose Borreguero

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

comment:69 Changed 7 years ago by Jose Borreguero

TESTING: Upload all attachments to your /tmp directory, and run the python script in the Script Window of MantidPlot. Look in data_Parameters workspace to check that the fitting parameters are close to the target values, namely:

Intensity = 0.74, Radius = 2.25, Diffusion = 0.024

comment:70 Changed 7 years ago by Alex Buts

  • Status changed from verify to reopened
  • Resolution fixed deleted

I think CurveFittingTest.DiffSphereTest.testDiffSphereInelastic fails randomly on Ubuntu:

https://builds.sns.gov/job/ornl_ubuntu12.04_develop/893/ https://builds.sns.gov/job/ornl_ubuntu12.04_develop/899/

comment:71 Changed 7 years ago by Jose Borreguero

  • Status changed from reopened to inprogress

Refs #4394 Reduced random variability in initial guess

The initial guess can be too far from the optimal parameters so that the fitting procedure is unable to converge

Changeset: 6ae6ddece863f4c52d9836a07b8eb3c2d07da6dc

comment:72 Changed 7 years ago by Jose Borreguero

Refs #4394 Return infinity for negative parameters

Change return zero for return infinity. Garanteed a bad chi-square

Changeset: aac58a5f84374461b51a79258ecfa7ad29a9da6e

comment:73 Changed 7 years ago by Jose Borreguero

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

comment:74 Changed 7 years ago by Jose Borreguero

TESTING: Upload all attachments to your /tmp directory, and run the python script in the Script Window of MantidPlot. Look in data_Parameters workspace to check that the fitting parameters are close to the target values, namely:

Intensity = 0.74, Radius = 2.25, Diffusion = 0.024

comment:75 Changed 7 years ago by Jose Borreguero

  • Milestone changed from Backlog to Release 3.1

comment:76 Changed 7 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester set to Andrei Savici

comment:77 Changed 7 years ago by Andrei Savici

Needs some updates to wiki

comment:78 Changed 7 years ago by Jose Borreguero

Refs #4394 More details for the WIKI page

Changeset: 0916210d668ecb7941486c8694abe9b897ff854d

comment:79 Changed 7 years ago by Andrei Savici

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/4394_diffusion_sphere'

Full changeset: d71ca69a8c0d0c7ca7f3e19dee76d9d8d348494f

comment:80 Changed 7 years ago by Jose Borreguero

  • Component changed from Framework to Indirect Inelastic

comment:81 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5241

Note: See TracTickets for help on using tickets.