esfit chili of TEMPOL with two components

A place to report and discuss potential bugs
Post Reply
kwhitco0
Newbie
Posts: 1
Joined: Fri Jun 28, 2024 9:25 am

esfit chili of TEMPOL with two components

Post by kwhitco0 »

Hello!
I have been working with Easyspin for awhile now and with the update to easyspin 6 my previous simulation code no longer converges for several of my EPR spectra. I have updated to the new syntax of esfit and chili, but the simulation times have increased and some simulations do not converge, especially at low temperatures. My thought is that I might need to adjust my LLMK, but those values worked previously before the easyspin 6 update.

New code (Easyspin 6 update):

B1=B/10;
expSpc=EPRSpec_240_up; % spectrum file
Params=Params_EPRSpec_240_up; % parameters file
%
Sys1.g=[2.0120 2.0130 2.0073];
Sys1.Nucs='14N';
Sys1.A=[20.9 19.26 103.2];
Sys1.weight=0.51412; %
Sys1.lw=0.78; %
Sys1.logtcorr=-7.8282; %
%
Sys2.g=[2.0120 2.0130 2.0073];
Sys2.Nucs='14N';
Sys2.A=[20.9 19.26 103.2];
Sys2.weight=1 - Sys1.weight; %
Sys2.lw=0.34182; %
Sys2.logtcorr=-8.6787; %
%
Sys = {Sys1,Sys2};
% Enter experimental parameters
Exp.mwFreq =9.5186; % units: GHz
Exp.Range = [331.83 345.83]; % No correction: [332.3 346.3]; Field correction is -4.7 Gauss= -0.47 mT
Exp.ModAmp = 0.2;% units, mT
Exp.Temperature = 240; % units, K
%
% Enter simulation vary & fix constant info (# entry is ± range; fix=0)

Vary1.g=[0 0 0];
Vary1.A=[0 0 0];
Vary1.weight=0.1;
Vary1.lw=0.1;
Vary1.logtcorr=0.1;
%
Vary2.g=[0 0 0];
Vary2.A=[0 0 0];
Vary2.weight=0.1;
Vary2.lw=0.05;
Vary2.logtcorr=0.1;
Vary = {Vary1, Vary2};
%
Opt.LLMK=[28,15,4,12]; % Previously it was [28 14 12 4] but Lodd does not seem to accept even numbers anymore and the M and K switched places
FitOpt.Method = 'simplex fcn'; % If I try to run just fcn, the simulation crashes unless I type an algorithm keyword
% Run simulation
BestSys=esfit(expSpc, @chili,{Sys,Exp,Opt},{Vary},FitOpt);

Previous code (everything else the same except for the last few lines):

Options.LLKM=[28,14,12,4];
FitOpt.Method = 'fcn'; % I did not have to specify the algorithm previously
% Run simulation
[BestSys,BestSpc]=esfit('chili',expSpc,{Sys1,Sys2},{Vary1,Vary2},Exp,Options,FitOpt);

If you have any ideas, please let me know!

Stefan Stoll
EasySpin Creator
Posts: 1085
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: esfit chili of TEMPOL with two components

Post by Stefan Stoll »

I don't have your experimental data to test esfit, but here is the chili simulation. In this particular case, the values for LLMK can be a lot smaller, which speeds up the simulation. The script demonstrates this. Of course, you need to carefully check this again if you change parameter values, but as long as they stay similar and you don't introduce ordering potentials, I don't expect that big changes are necessary.

Code: Select all

clear, clc

Sys1.g = [2.0120 2.0130 2.0073];
Sys1.Nucs = '14N';
Sys1.A = [20.9 19.26 103.2];
Sys1.weight = 0.51412;
Sys1.lw = 0.78;
Sys1.logtcorr = -7.8282;

Sys2.g = [2.0120 2.0130 2.0073];
Sys2.Nucs = '14N';
Sys2.A = [20.9 19.26 103.2];
Sys2.weight = 1 - Sys1.weight;
Sys2.lw = 0.34182;
Sys2.logtcorr = -8.6787;

Sys = {Sys1,Sys2};

Exp.mwFreq = 9.5186;
Exp.Range = [331.83 345.83];
Exp.ModAmp = 0.2;
Exp.Temperature = 240;

Opt.LLMK = [28,15,4,12];
[B,spc1] = chili(Sys,Exp,Opt);
Opt.LLMK = [6,1,2,0];
[B,spc2] = chili(Sys,Exp,Opt);
plot(B,spc1,B,spc2);
Post Reply