Fitting mwPhase for multicomponent spectrum?

General forum for EasySpin: questions, how to's, etc.
Post Reply
howie
Newbie
Posts: 3
Joined: Sat Nov 09, 2019 4:30 pm

Fitting mwPhase for multicomponent spectrum?

Post by howie »

Hello,

Can anyone offer advice on how to fit the microwave phase for multicomponent spectra? I can follow the EasySpin documentation for mwPhase fitting for single component spectra, but when I try to add a second component, the code doesn't work. Is there a way to add a second Sys in the 'mymy' function to make the code work? Thanks in advance!

Code: Select all

Sys1.g = 2.01652;
Sys1.lwpp = [0 152.28];
Sys1.S = 1/2;
Sys1.mwPhase = -0.117033;
Sys1.weight = 2.99768;
Vary1.g = 0.2;
Vary1.lwpp = [0 50];
Vary1.weight = 0.2;
Vary1.mwPhase = 20*pi/180;


% carbon
SysC.g = 1.99574;
SysC.lwpp = 12.1384;
SysC.weight = 0.00082928;
VaryC.g = 0.02;
VaryC.lwpp = 5;
VaryC.weight = 0.0005;

esfit('mymy',data{y1:y2,2},{Sys1,SysC},{Vary1,VaryC},Exp); 

function y = mymy(Sys,Exp,Opt);
Exp.mwPhase = Sys.mwPhase;
[x,y] = pepper(Sys,Exp,Opt);
katarkon
Local Expert
Posts: 186
Joined: Mon Jan 12, 2015 4:01 am

Re: Fitting mwPhase for multicomponent spectrum?

Post by katarkon »

You have to take in account that the parameter Sys in custom similation function is cell array in the case of multicomponent fitting. Try to use Exp.mwPhase = Sys{1}.mwPhase;

howie
Newbie
Posts: 3
Joined: Sat Nov 09, 2019 4:30 pm

Re: Fitting mwPhase for multicomponent spectrum?

Post by howie »

Thank you!

Post Reply