Closed stestoll closed 1 year ago
The reason for this is that EasySpin first constructs the stick spectrum. In this case, the stick spectra are delta peaks. For the small g change and the low field resolution, the delta peaks for the two spectra end up in the same bin. The difference of the two spectra now reveals only the difference in intensities (which depend on g), but not the change in resonance field.
The only way to improve accuracy here is to directly bin the lineshape instead of a delta peak.
Thank you very much for pointing out this issue. For our research, we are unfortunately dealing with tiny changes in g (1e-6
to 1e-5
) which obviously requires a huge number of grid points in the simulations. I took your example and modified it a little bit (see below) to further investigate the necessary grid size (Exp.nPoints
) for a given value of Δg. Besides your recommendation to increase the number of grid points, there is also a significant difference in the results depending on an odd/even number of grid points used (I guess also due to the binning). Lastly, I can reproduce the identical spectra in every test run, which supports the idea that the issue is mainly based on the binning and can be solved by taking a huge number of grid points into account when dealing with small changes in g.
clc, clear, clf
lwGL = [10 10];
deltaG = [1.0e-4 1.0e-5 1.0e-6];
SysB.g = 2.0;
SysA.lw = lwGL;
SysB.lw = lwGL;
Exp.mwFreq = 9.5;
Exp.Range = [320 360];
Exp.Harmonic = 0;
N = [1000 10000 100000 1000000 10000000];
tiledlayout(numel(deltaG), 2);
for g = 1:numel(deltaG)
SysA.g = 2.0 + deltaG(g);
for p = 1:2
nexttile(p + (g-1)*2); hold on
lgd = legend; legend show;
lgd.Title.String = sprintf("dg = %.0e", deltaG(g));
for k = 1:numel(N)
Exp.nPoints = N(k) + (p-1);
[B_,spcA] = pepper(SysA,Exp);
[B_,spcB] = pepper(SysB,Exp);
plotlabel = char(sprintf("nPoints = %i", Exp.nPoints));
plot(B_,spcA-spcB,'DisplayName', plotlabel)
display(Exp.nPoints);
end
end
end
pepper
uses delta peak binning only for isotropic powder spectra with isotropic width and for single-crystal spectra with isotropic width. It could probably just use the width info to bin lineshapes directly. This would resolve this issue.
This is not an issue for garlic
, since delta-peak binning can be switched off using Opt.AccumMethod
.
When taking the difference of two spectra that differ minimally in their g values, the difference depends on the number of points. If the number of points is too small, the result is incorrect. As
Exp.nPoints
is increased, the correctness improves, though not monotonically.