diff --git a/EPR_script.m b/EPR_script.m index 216e1f3..ea76a8a 100644 --- a/EPR_script.m +++ b/EPR_script.m @@ -105,21 +105,45 @@ xlabel('Magnetic Field / mT') axis('tight') box off -return -%% Simulation section. Use the "Run Section" button to avoid running the previous section every time +%% Simulation section Exp.mwFreq = params.mwFreq; % GHz Exp.nPoints = length(params.Field_Vector); Exp.CenterSweep = 0.1*[params.Field_Center params.Field_Sweep]; % mT (converted from Gauss) 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 - -Sys.S = 1; % Total Spin -Sys.g = 1.9951; % needs to be optimised -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 +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 + + [bfield,spec] = pepper(Sys,Exp); % perform a simulation with the parameters above + spec_norm = spec/max(spec); % normalize the simulation + + 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.D = [10 10]; 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,'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') -return -set(gcf,'Units','Inches'); -pos = get(gcf,'Position'); -set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]); -print(gcf,'..\Abbildungen\Regression5','-dpdf','-r0'); \ No newline at end of file +% set(gcf,'Units','Inches'); +% pos = get(gcf,'Position'); +% set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]); +% print(gcf,'..\Abbildungen\Regression5','-dpdf','-r0'); \ No newline at end of file