Applying additional constraints in esfit

General forum for EasySpin: questions, how to's, etc.
Post Reply
AlexTaguchi
User
Posts: 10
Joined: Tue Jan 06, 2015 9:59 pm

Applying additional constraints in esfit

Post by AlexTaguchi »

Hi,

I'm trying to simulate a CW biradical spectrum, and I'd like to be able to have a constraint so that the g-values of the two radicals are kept the same (although I still want to have EasySpin optimize the g-values). How would you do this?

Thanks,
Alex
(MatlabR2014b, EasySpin4.5.5, Windows7Pro)
Stefan Stoll
EasySpin Creator
Posts: 1057
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Applying additional constraints in esfit

Post by Stefan Stoll »

Alex,
that's quite simple: Create your own simulation function, say mysim.m that defines a function with the same syntax as all the ES simulation functions:

Code: Select all

function [x,y] = mysim(Sys,Exp,Opt)
% Here comes your code
In the body of the function, do whatever you need to do to constrain the values, then call the ES simulation function, and return the simulated spectrum.

All that remains is to call esfit with your custom simulation function:

Code: Select all

esfit('mysim',data,Sys,Sys0,Vary,Opt)
yvesjour
User
Posts: 10
Joined: Tue Mar 31, 2015 4:45 am

Re: Applying additional constraints in esfit

Post by yvesjour »

Actually I have the same problem with hyperfine constants of Copper ions in a dinuclear complex. I want to simulate the triplet spectrum of this complex and
I want to have identical A values for the two copper ions during the fitting procedure.

Unfortunately I really do not understand your answer. I must confess that I started to use easyspin last week and I never use MatLab before.

Do you mind to give more details about the solution you proposed to solve the problem

many thanks

Yves

Sys.  Nucs = ‘Cu,  Cu';
Sys. A = [30 245 ; 30 245] ;
Sys. S  = 1 ;
Sys. g = [2.0238 2.0815 2.2956] ;
Sys.  HStrain = [217 344 250] ;
Exp.  Range = [250 450] ;
Exp.  mwFreq = 9.47508 ;
SimOpt.  nKnots = 25 ;
SimOpt.  Method = 'perturb’;

Vary. A  = [0 100 ; 0 100] ;
Vary.  HStrain = [0 0 50] ;

FitOpt.  Method = 'simplex fcn';
FitOpt. Scaling = 'maxabs’; % scaling so that the maximum absolute values coincide

esfit(‘pepper’,spc  ,Sys ,Var y,Exp ,Sim Opt,Fit Opt);
Stefan Stoll
EasySpin Creator
Posts: 1057
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Applying additional constraints in esfit

Post by Stefan Stoll »

Here is how you should write the function for your case:

Code: Select all

function [x,y] = simCuCu(Sys,Exp,SimOpt)
Sys.A = [Sys.ACuCu; Sys.ACuCu];
[x,y] = pepper(Sys,Exp,SimOpt);
The call esfit in the following way:

Code: Select all

Sys.Nucs = 'Cu,Cu';
Sys.ACuCu = [30 245];
Sys.S = 1;
Sys.g = [2.0238 2.0815 2.2956];
Sys.HStrain = [217 344 250];
Exp.Range = [250 450];
Exp.mwFreq = 9.47508;
simOpt.nKnots = 35;
simOpt.Method = 'perturb';

Vary.ACuCu = [0 100];
Vary.HStrain = [0 0 50];

fitOpt.Method = 'simplex';
fitOpt.Scaling = 'maxabs';

esfit('simCuCu',ydata,Sys,Vary,Exp,simOpt,fitOpt)
yvesjour
User
Posts: 10
Joined: Tue Mar 31, 2015 4:45 am

Re: Applying additional constraints in esfit

Post by yvesjour »

Dear Colleague

Thank you very much for your rapid answer and your explanations.

I am very busy today and I will try your suggestions probably next week.

By the way, easy spin is just great and a lot better than the other software I used before. I am very grateful to you for this major contribution to the EPR community
AlexTaguchi
User
Posts: 10
Joined: Tue Jan 06, 2015 9:59 pm

Re: Applying additional constraints in esfit

Post by AlexTaguchi »

I too would like to thank you for your help. I still haven't gotten around to actually implementing it, but it makes sense.
Post Reply