Page 1 of 1

Strange behaviour of esfit during fitting

Posted: Wed May 26, 2021 6:01 am
by katarkon

I have found that for some files experimental spectrum looks like scaled by negative factor. It is clearly visible on screenshot.

esfit.png
esfit.png (62.23 KiB) Viewed 7061 times

This behaviour is kept at any scaling mode, except 'no scaling' which throws an error

Code: Select all

Undefined function or variable "scalefactor".
Error in C:\easyspin-5.2.30\easyspin\rescale.p>rescale (line 140)
Error in C:\easyspin-5.2.30\easyspin\esfit.p>assess (line 843)
Error in C:\easyspin-5.2.30\easyspin\esfit_simplex.p>esfit_simplex (line 77)
Error in C:\easyspin-5.2.30\easyspin\esfit.p>runFitting (line 681)
Error while evaluating uicontrol Callback

For the other files with the same system esfit works properly (except error with no scaling).
I override the problem using Sys.weight=-1 where appropriate, but it does not look like good solution.


Re: Strange behaviour of esfit during fitting

Posted: Wed May 26, 2021 10:18 am
by Stefan Stoll

Please post the experimental data and the simulated spectrum that give the negative rescaling, and we'll look into this issue.


Re: Strange behaviour of esfit during fitting

Posted: Wed May 26, 2021 10:45 pm
by katarkon

Sorry, Stefan, the first issue isn't a bug in esfit. Real reason is incorrect units for Exp.Temperature (C instead of K) for custom simulation function. Correction of the temperature units solves the problem.
However, second issue is still actual. Example script basicfit.m with 'no scaling' throws an error

Code: Select all

Undefined function or variable "scalefactor".
Error in C:\easyspin-5.2.30\easyspin\rescale.p>rescale (line 140)
Error in C:\easyspin-5.2.30\easyspin\esfit.p>assess (line 843)
Error in C:\easyspin-5.2.30\easyspin\esfit_simplex.p>esfit_simplex (line 77)
Error in C:\easyspin-5.2.30\easyspin\esfit.p>runFitting (line 681)
Error while evaluating uicontrol Callback

It seems to be a bug.


Re: Strange behaviour of esfit during fitting

Posted: Thu May 27, 2021 1:55 pm
by Stefan Stoll

Yes, this is a bug, thanks for reporting. It will be fixed in the next patch release, 5.2.31