Page 1 of 2

esfit problem with the 6.0.0-dev.19 version

Posted: Fri Jan 10, 2020 4:48 am
by Cleto
Good morning,

I tried to use the "esfit" keyword in my script. Unfortunately, I received the following string as output: "Error using esfit. The simulation function (1st input) must be a function handle" even if I thought the script was ok. Later I tried to run the same script with the previous version (6.0.0-dev.18) and everything worked: the esfit window appeared and I could start the fitting of my parameters. Thus I believe that maybe there is a problem with the last develop version.
I report my script below.

clear all
[x,y,Params] = eprload('/home/paolo/Documenti/CuCHA/Spectra simulations/Cu_CHA_new samples/Cu_CHA 1/Cu_CHA1_25db_10G_70K_baseline.spc')

Sys0.g = [2.087 2.422];
Sys0.lwpp = 2.7;
Sys0.Nucs = 'Cu';
Sys0.A = [37 390];
Sys0.gStrain = [0.012 0.005];
Sys0.AStrain = [19 6];
Sys0.weight = 0.41;
Sys1.g = [2.079 2.385];
Sys1.Nucs = 'Cu';
Sys1.lwpp = 2.7;
Sys1.A = [12 447];
Sys1.gStrain = [0.007 0.019];
Sys1.AStrain = [10 10];
Sys1.weight = 0.59;
Sys0.gAStrainCorr = +1;
Sys1.gAStrainCorr = +1;
Vary0.gStrain = [0.002 0.015];
Vary0.AStrain = [5 5];
Vary0.weight = 0.2;
Vary1.gStrain = [0.04 0.06];
Vary1.AStrain = [30 40];
Vary1.weight = 0.2;
Exp.CenterSweep = [340 200]; %in mT
Exp.mwFreq = 9.420875;
Exp.ModAmp = 0.5; %in mT
Exp.nPoints = 6000;
Exp.Temperature = 70;
[xb,yb] = pepper({Sys0,Sys1},Exp);
sim = yb/max(yb);
B = x/10;
spc = y/max(y);
esfit('pepper',spc,{Sys0,Sys1},{Vary0,Vary1},Exp);

hold off

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Fri Jan 10, 2020 12:52 pm
by Stefan Stoll
Please attach you data files as well so we can reproduce this.

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Sat Jan 11, 2020 4:08 am
by Cleto
I cannot attach the .spc file because it has an invalid extension.
May I can send it by email?

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Sat Jan 11, 2020 11:18 am
by Stefan Stoll
Please try again. We corrected the attachment settings.

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Sun Jan 12, 2020 2:21 am
by Cleto
Thank you Stefan!

I attach the .spc file

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Mon Jan 13, 2020 7:07 am
by Stefan Stoll
The .par file is needed as well.

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Mon Jan 20, 2020 4:18 am
by Cleto
Sorry for the late reply.
Here it is!

Thank you for your help

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Wed Jan 22, 2020 12:48 pm
by Stefan Stoll
Use esfit(@pepper,...) instead of esfit('pepper',...). This is a change in 6.0. It is described in the 6.0 documentation. Keep in mind that 6.0 is not finalized yet, and changes like these can be introduced.

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Fri Jan 24, 2020 3:19 am
by Cleto
Thank you very much for your help!

Re: esfit problem with the 6.0.0-dev.19 version

Posted: Sat Feb 08, 2020 6:00 am
by thanasis
Just a small observation from running esfit of versions of 6.0.0-dev10 and 6.0.0-dev20.

In doing a minimization of line widths, the fitting starts normally, but at some point dev10 throws an error:
Error using pepper
Lorentzian linewidth is smaller than increment - cannot perform convolution.
In turn, with dev20 the error (for the same code and data) is:
Undefined function or variable 'out'.
If the source of the error is the same, the dev10 error message is much more informative as to what the user can do to avoid it.

Update: Actually the same holds for all other errors that used to come with a description and the line number where they occurred.