Update EPR_script.m

Added inputs for manual fitting.
This commit is contained in:
sakul-45 2021-04-24 20:25:51 +02:00
parent 2c530370ac
commit ce5262d6c5

View File

@ -105,21 +105,45 @@ xlabel('Magnetic Field / mT')
axis('tight') axis('tight')
box off box off
return %% Simulation section
%% Simulation section. Use the "Run Section" button to avoid running the previous section every time
Exp.mwFreq = params.mwFreq; % GHz Exp.mwFreq = params.mwFreq; % GHz
Exp.nPoints = length(params.Field_Vector); Exp.nPoints = length(params.Field_Vector);
Exp.CenterSweep = 0.1*[params.Field_Center params.Field_Sweep]; % mT (converted from Gauss) Exp.CenterSweep = 0.1*[params.Field_Center params.Field_Sweep]; % mT (converted from Gauss)
Exp.Harmonic = 0; % zeroth harmonic Exp.Harmonic = 0; % zeroth harmonic
Exp.Temperature = [0 0.67 0.33]; % populations of the triplet sub-levels. These need to be varied manually to get the right shape init_proceed = 'n';
while init_proceed == 'n'
% populations of the triplet sub-levels
% these need to be varied manually to get the right shape
Exp.Temperature = input('Input population of triplett sublevels as [T_x T_y T_z]: ');
% initial simulation settings
Sys.S = 1; % Total Spin
Sys.g = input('g value: '); % needs to be optimised
Sys.D = input('D and E value as [D E]: '); % mT, The D and E values need to be optimised
Sys.lw = input('Isotropic line broadening at FWHM as [Gaussian Lorentzian]: '); % mT, linewidth needs to be optimised
Sys.S = 1; % Total Spin [bfield,spec] = pepper(Sys,Exp); % perform a simulation with the parameters above
Sys.g = 1.9951; % needs to be optimised spec_norm = spec/max(spec); % normalize the simulation
Sys.D = [2148.02 75.35]; % mT; The D and E values need to be optimised
Sys.lw = [8.1034 0]; % mT; linewidth needs to be optimised
figure(3)
set (gcf,'PaperUnits','centimeters')
set (gcf,'Position',position) % set the position, size and shape of the plot
set (gcf,'InvertHardcopy','off','Color',[1 1 1])
set(0,'DefaultAxesFontSize', 16,'DefaultAxesLineWidth',1.5)
plot(0.1*params.Field_Vector,signal_baseline_time_field_mean_norm,'r', bfield,spec_norm,'b','LineWidth',1);
axis('tight')
legend('experimental','simulation')
legend boxoff
xlabel('Magnetic Field / mT')
ylabel('EPR signal / A. U.')
set(gca,'Box','Off', 'XMinorTick','On', 'YMinorTick','On', 'TickDir','Out', 'YColor','k')
init_proceed = input('Spectrum shape manually fitted? [y/n]: ','s');
end
return
% variation settings for simulation
Vary.g = 0.01; Vary.g = 0.01;
Vary.D = [10 10]; Vary.D = [10 10];
Vary.lw = [1 0]; Vary.lw = [1 0];
@ -139,19 +163,16 @@ set (gcf,'PaperUnits','centimeters')
set (gcf,'Position',position) % set the position, size and shape of the plot set (gcf,'Position',position) % set the position, size and shape of the plot
set (gcf,'InvertHardcopy','off','Color',[1 1 1]) set (gcf,'InvertHardcopy','off','Color',[1 1 1])
set(0,'DefaultAxesFontSize', 16,'DefaultAxesLineWidth',1.5) set(0,'DefaultAxesFontSize', 16,'DefaultAxesLineWidth',1.5)
plot(0.1*params.Field_Vector,signal_baseline_time_field_mean_norm,'r', bfield,spec_norm,'b','LineWidth',1); plot(0.1*params.Field_Vector,signal_baseline_time_field_mean_norm,'r', bfield,spec_norm,'b','LineWidth',1);
axis('tight') axis('tight')
legend('experimental','simulation') legend('experimental','simulation')
legend boxoff legend boxoff
xlabel('Magnetic Field / mT') xlabel('Magnetic Field / mT')
ylabel('EPR signal / A. U.') ylabel('EPR signal / A. U.')
set(gca,'Box','Off','XMinorTick','On',... set(gca,'Box','Off','XMinorTick','On',...
'YMinorTick','On','TickDir','Out','YColor','k') 'YMinorTick','On','TickDir','Out','YColor','k')
return
set(gcf,'Units','Inches'); % set(gcf,'Units','Inches');
pos = get(gcf,'Position'); % pos = get(gcf,'Position');
set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]); % set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]);
print(gcf,'..\Abbildungen\Regression5','-dpdf','-r0'); % print(gcf,'..\Abbildungen\Regression5','-dpdf','-r0');