However the results from the same code (with the exception of the new CrystalOrientations syntax) produce different results in the new version.
The code is fairly simple (single absoption spectrum for a given spin system and crystal orientation displayed alongside an experimental measurement).
Code: Select all
clear;
clf;
clc;
Sys.S = 7/2;
Sys.g = 1.992;
b4 = -145.3;
b6 = -0.3;
Sys.B4 = [5./60.*b4 0 0 0 b4/60. 0 0 0 0]; % q = +4,+3,+2,+1,0,-1,-2,-3,-4
Sys.B6 = [0 0 -21./1260.*b6 0 0 0 b6/1260. 0 0 0 0 0 0]; % q = +4,+3,+2,+1,0,-1,-2,-3,-4
Sys.lwpp = 2.3;
Exp.mwFreq = 1.4956;
Exp.Temperature = 4.2;
Exp.Harmonic = 0;
Exp.nPoints = 1000;
Exp.Range = [0 200]; % in mT
load('./140908_11R_FGd_bz_sweep_4_folder/spec.mat') %Experiment data for comparison
expSpec = 10.^(expSpec/10.);
expSpec = expSpec - max(expSpec);
expSpec = expSpec/abs(min(expSpec))+1;
Opt.Output = 'separate'; % make sure spectra are not added up
theta = 42.25/180*pi;
phi =0;
%Exp.Orientations = [phi ; theta];
Exp.CrystalOrientation = [phi ; theta];
[Field1,Spec1] = pepper(Sys,Exp,Opt);
Field1 = Field1/1000;
Spec1 = -Spec1;
Spec1 = Spec1 - max(Spec1);
Spec1 = Spec1/abs(min(Spec1))+1;
plot(expB, expSpec, Field1,Spec1-1);
axis([0 0.1 -1 1.1]);
mytitle = strcat('theta = ', num2str(theta/pi*180), ' phi = ', num2str(phi/pi*180));
title(mytitle);
myfilename = strcat('./matlab_figs/plot_',sprintf('%03d',1),'.png');
print('-dpng', myfilename);
clear Sys Exp;
I suspect that it may have something to do with how the crystal orientation is specified. I always found it odd that the documentation specifies that "CrystalOrientations" should contain "one set of three angles per row", but the example file "crystalorientations.m" uses:
Code: Select all
% Generate orientations in a single rotation plane
rotN = [0 1 0]; % rotation axis
[phi,theta] = rotplane(rotN,[0 pi],31);
Exp.CrystalOrientation = [phi; theta];
I have also tried sweeping the angles in order to find the spectrum I obtained in 4.5.5 but I have had no success so far.
Thank you in advance