Ripples in Simulation

General forum for EasySpin: questions, how to's, etc.
Post Reply
riley22
Newbie
Posts: 1
Joined: Wed Nov 13, 2024 8:35 am

Ripples in Simulation

Post by riley22 »

Hello, I am currently using the pepper function to simulate a two component powder spectra. I have noticed that the simulation has pretty severe rippling in it. Per the user guide, I tried increasing the gridsize, but this doesn't really seem to help. I have included pictures of gridsizes of 19, 181, and 300. Included below is the script that I have. I was wondering if there was anything in the script that I might be missing that is inducing these ripples, since I am still new to EasySpin. I appreciate any insights on the matter!

clear
clc

Data = dlmread('file.txt', '\t', 1, 0);
B = Data(:, 1);
spc = Data(:, 2);
B = B(1:6000);
B = B/10;
spc=spc(1:6000);
Exp.CenterSweep =[320 600];
Exp.mwFreq = 9.353809;
Exp.nPoints = 6000;
Exp.ModAmp = 1;
Exp.Temperature = 10;

%Component 1
Sys0.S = 1/2;
Sys0.g = [5.75686557613257 5.58321373597561 1.99275217276477];
Sys0.lwpp = 2.14278494187109; %in mT 1.82172230612951
Sys0.HStrain = [423.142628549750 878.265239790310 11.4491219726372];
%Sys0.gStrain=[0 0.1 0];

SysVary0.g = [0.1 0.1 0.1];
SysVary0.HStrain = [150 180 50];
%SysVary0.gStrain=[0.18 0.043 0];
SysVary0.lwpp = 5;

%Component 2
Sys1.S = 1/2;
Sys1.g = [2.61766621912696 2.23007773414852 1.80619903241103];
Sys1.lwpp = 1.47293212084371;
Sys1.HStrain = [174.251758070979 39.2686298569257 157.628563641514];

SysVary1.g = [0.1 0.1 0.1];
SysVary1.HStrain = [10 10 10];
SysVary1.lwpp = 1;

%Weight each system in the spectra
Sys0.weight = 135;
Sys1.weight = 82;

SysVary0.weight = 15;
SysVary1.weight = 15;

FitOpt.Scaling = 'minmax';
Opt.GridSize = 181;

[Bsim,spcsim] = pepper({Sys0,Sys1},Exp);
plot(B,spc,Bsim,spcsim*11);
esfit(spc,@pepper,{{Sys0,Sys1},Exp},{{SysVary0,SysVary1}});

Attachments
Gridsize300.PNG
Gridsize300.PNG (41.32 KiB) Viewed 2694 times
Gridsize181.PNG
Gridsize181.PNG (46.86 KiB) Viewed 2694 times
Gridsize19.PNG
Gridsize19.PNG (38.64 KiB) Viewed 2694 times
thanasis
Local Expert
Posts: 260
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Re: Ripples in Simulation

Post by thanasis »

What happens if you entirely remove Exp.ModAmp = 1 from the experimental parameters?

Stefan Stoll
EasySpin Creator
Posts: 1120
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Ripples in Simulation

Post by Stefan Stoll »

Your Sys0 is very anisotropic and has a very narrow linewidth, particularly around the z axis. This will lead to ripples if your grid is too small. See here:

Code: Select all

clear, clc

Exp.CenterSweep = [320 600];  % mT
Exp.mwFreq = 9.353809;  % GHz
Exp.nPoints = 2000;
Exp.ModAmp = 1;  % mT
Exp.Temperature = 10;  % K

Sys0.S = 1/2;
Sys0.g = [5.76 5.58 1.99];
Sys0.lwpp = 2.1; % mT
Sys0.HStrain = [423 878 11];

Opt.GridSize = [19 4];  % equal to the default values
[B,spc1] = pepper(Sys0,Exp); 
Opt.GridSize = [31 4];
[B,spc2] = pepper(Sys0,Exp,Opt); 

plot(B,spc1,B,spc2)

You can eliminate the ripples by increasing Opt.GridSize, often substantially.

You can also increase the linewidth, but that might not be possible given your experimental spectrum.

Also, in general it is recommended not to use Sys.lwpp and Sys.HStrain at the same time.

Post Reply