Comparison of magn. susceptibility results from ES and Phi

General forum for EasySpin: questions, how to's, etc.
Post Reply
thanasis
Local Expert
Posts: 245
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Comparison of magn. susceptibility results from ES and Phi

Post by thanasis »

I have now tried several models to fit magn. susceptibility data. To make sure my code is correct, I have treated the same data with the Phi package.

In particular, I fit an all-ferric triangle (S1 = S2 = S3 = 5/2) under an isosceles magnetic model, including antisymmetric exchange: H = -2J (S1S2 + S2S3) - 2J'S1S3 - 2d(S1xS2 + S2xS3 + S3xS1) + HZeeman. For this type of antiferromagnetic triangles, there are normally two best-fit solutions, one with|J| > |J'| and one with |J| < |J'|. I always fix g = 2.

On the upside the results from both programs are comparable in the isotropic version of the Hamiltonian (d = 0). However, when I liberate d, while Phi gives reasonable values of 1.6-1.7 cm-1, ES gives 2.86 cm-1 for the one solution and 6.5 cm-1 for the other:
J J' d
A -22.9 -19.5 2.86
B -20.9 -25.6 6.49

While 2.86 cm-1 could be considered borderline reasonable, 6.5 cm-1 is way too high.

So:
-somewhere in my code there is a small error
-there are some details in ES's implementation of calculating magn. susceptibility that affects systems with antisymmetric exchange.

The ES code is:

Code: Select all

clear all;
close all;

cm=100*clight/1e6; % Conversion constant from cm-1 to MHz
% [T,chiSI] = textread('data_easyspin_chiSI.dat','%f %f'); % Data is x vs T in SI units
[T,chi] = textread('data_easyspin_chi.dat','%f %f'); chiSI = chi*4*pi*1e-6; % Data is x vs T in cgs units
chiSIT=chiSI.*T;
[m,n]=size(chiSI); % size of experimental data array
Exp.Field = 1000; Exp.Temperature = T;
format long;

Ja = -20.2;
Jb = -25.3;
gxy = 2;
gz = 2;
Gx = 0; Gy = 0; Gz = 3.0;

Sys1.S=[5/2 5/2 5/2];
Sys1.g=[gxy gz; gxy gz; gxy gz];
Sys1.Ja = -2*cm*Ja;
Sys1.Jb = -2*cm*Jb;
Sys1.Gz = 3*cm*Gz;

Vary1.g = [0 0];
Vary1.Ja = 2*cm;
Vary1.Jb = 2*cm;
Vary1.Gz = 2*cm;

% Fitting arguments
FitOpt.OutArg = [2 2];   % to fit the magnetic susceptibility chizz (second output)
FitOpt.Method = 'simplex fcn';
FitOpt.Scaling = 'none';
% Opt.nKnots = 501; % I have tried with no Opt.nKnots, with Opt.nKnots = 101, 301 and 501

% % Get graph
% esfit('constrainJgd_isosceles_xT',chiSIT,Sys1,Vary1,Exp,[],FitOpt);

% Get ascii
tic
[BestSys,BestSpc] = esfit('constrainJgd_isosceles_xT',chiSIT,Sys1,Vary1,Exp,[],FitOpt);
toc
calcdata = [T(:) BestSpc(:)/(4*pi*1e-6)];       % Arrange calculated data as an ascii file with chi in emu
datafname = ['Ja=',num2str(BestSys.Ja/(-2*cm),'%.3f'),'_Jb=',num2str(BestSys.Jb/(-2*cm),'%.3f'),'_d=',num2str(BestSys.Gz/(2*cm),'%.3f'),'_bestfit.txt'];
save(datafname,'calcdata','-ascii'); % Save the calculated curve as an ascii file
% Calculate error
chicalc = BestSpc.'; % Transpose BestSpc matrix to subtract from chiSI
residuals = (chiSIT-chicalc).^2./chiSIT.^2;
ressum = sum(residuals,1); % sum along the column
rfactor = ressum/m %divide by number of experimental points
And my custom fitting function is:

Code: Select all

function [x,y] = constrainJgd_isosceles_xT(Sys1,Exp,Opt);
Gx = 0; Gy = 0;
fullSys = Sys1;
fullSys.g = [Sys1.g];
fullSys.ee = [
    Sys1.Ja Sys1.Gz -Gy; -Sys1.Gz Sys1.Ja Gx; Gy -Gx Sys1.Ja;
    Sys1.Ja Sys1.Gz -Gy; -Sys1.Gz Sys1.Ja Gx; Gy -Gx Sys1.Ja;
    Sys1.Jb -Sys1.Gz Gy; Sys1.Gz Sys1.Jb -Gx; -Gy Gx Sys1.Jb]; % Because S1xS3 = -S3xS1
[x,y] = curry(fullSys,Exp,Opt);
T = Exp.Temperature;
[x,y] = curry(fullSys,Exp,Opt);
y = y.';
y = y.*T;
y = y.';
return
The data for ES is here:
data_easyspin_chi.dat.zip
chi vs T data in cgs units
(1.63 KiB) Downloaded 267 times
In the following post I will upload the the Phi files.

Thanks a lot!

UPDATE: On the above, I must also note that I have plotted the Zeeman diagrams for the same parameter sets and they are identical.
Last edited by thanasis on Tue May 31, 2016 2:09 am, edited 2 times in total.
thanasis
Local Expert
Posts: 245
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Re: Comparison of magn. susceptibility results from ES and P

Post by thanasis »

And the Phi files:
phi.zip
(4.12 KiB) Downloaded 312 times
UPDATE: After a small correction in the input files
Last edited by thanasis on Wed Jun 01, 2016 2:29 pm, edited 1 time in total.
Stefan Stoll
EasySpin Creator
Posts: 1073
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Comparison of magn. susceptibility results from ES and P

Post by Stefan Stoll »

Have you checked whether ES and PHI give the same susceptibility for a given parameter set?
thanasis
Local Expert
Posts: 245
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Re: Comparison of magn. susceptibility results from ES and P

Post by thanasis »

For the parameter set: J = -19 cm-1, J' = -23, g = 2, d = 1.5 cm-1, for H = 1 T, according to the above-mentioned Hamiltonian, I get two very close but not identical chi*T vs T datasets:

Code: Select all

T Easyspin Phi
1.929848 0.29378079 0.243623
2.935006 0.31533935 0.265935
3.996075 0.32671028 0.281723
4.996569 0.33429287 0.294473
6.000272 0.34073978 0.306465
7.002722 0.34677564 0.318114
8.009593 0.35295418 0.329753
9.016638 0.35972642 0.341547
10.0206 0.36750752 0.353649
11.02408 0.37668114 0.366263
12.00835 0.38729451 0.379282
13.01846 0.40000425 0.393423
14.02266 0.41451022 0.408343
15.05694 0.43134912 0.424657
16.06374 0.44946736 0.441472
17.07634 0.46923665 0.459294
18.08368 0.49024805 0.477891
19.05964 0.51169503 0.49668
20.10923 0.53575408 0.517662
22.1416 0.58455358 0.560274
23.99962 0.63089666 0.601095
25.99472 0.68172788 0.646427
27.99741 0.73334088 0.693082
29.99592 0.78510018 0.740469
31.99532 0.83693853 0.788468
33.9856 0.88847992 0.836665
35.97505 0.93986704 0.885133
37.97182 0.99125834 0.933975
40.08871 1.045492 0.98588
42.19395 1.0991285 1.03755
44.13424 1.1482616 1.08515
46.27557 1.2021115 1.13759
48.40406 1.2552112 1.18957
50.52772 1.3077308 1.24123
52.63876 1.3594534 1.29231
54.68681 1.4091473 1.34158
56.78806 1.4596165 1.3918
58.91848 1.5102385 1.44233
61.00851 1.5593552 1.4915
63.07794 1.6074497 1.53977
64.97372 1.6510369 1.58361
66.9448 1.6958781 1.6288
68.86943 1.7391956 1.67253
71.26348 1.7924409 1.72638
73.35313 1.8383465 1.77287
75.4245 1.8833355 1.81848
77.49612 1.9278267 1.86364
79.55527 1.9715617 1.90807
81.6083 2.0146926 1.95192
83.66188 2.0573725 1.99534
85.67995 2.0988747 2.03759
87.68941 2.1397774 2.07924
89.74612 2.1812166 2.12145
91.77834 2.2217507 2.16275
93.78647 2.261413 2.20317
95.79801 2.3007631 2.24328
97.81792 2.3399046 2.28318
99.83339 2.3785984 2.32262
101.8126 2.4162536 2.36101
103.7736 2.4532365 2.39871
105.7164 2.4895645 2.43574
107.6066 2.5246189 2.47147
109.4233 2.558047 2.50554
111.3943 2.5940298 2.54221
113.637 2.6346219 2.58357
115.4738 2.6675961 2.61716
117.4359 2.7025566 2.65277
119.8465 2.7451461 2.69614
121.819 2.7797057 2.73133
123.8604 2.8152049 2.76747
125.8322 2.8492416 2.80211
127.84 2.8836509 2.83713
129.8464 2.9177911 2.87186
131.8324 2.9513483 2.90599
133.8176 2.9846627 2.93987
135.834 3.018271 2.97404
137.8622 3.0518474 3.00817
139.9391 3.0859976 3.04288
141.9715 3.1191933 3.07661
144.0222 3.152469 3.11041
146.4322 3.1912999 3.14985
149.3188 3.2374281 3.19668
151.7226 3.2755311 3.23536
153.7962 3.3081789 3.26849
158.7851 3.3859106 3.34735
163.5809 3.4595833 3.42205
168.5323 3.5346092 3.4981
173.5146 3.6090801 3.57355
178.5326 3.6830849 3.64849
183.5187 3.7556599 3.72196
188.2558 3.8237536 3.79087
193.3167 3.8956073 3.86356
198.1736 3.9637209 3.93243
203.2034 4.0334126 4.00289
208.1701 4.1014068 4.07161
212.8174 4.1643058 4.13516
217.8071 4.2310795 4.2026
223.062 4.300571 4.27278
227.9082 4.3639184 4.33673
232.5121 4.4234546 4.39682
237.4964 4.4872161 4.46116
242.4254 4.5495734 4.52408
247.2765 4.6102806 4.58532
252.1301 4.6703703 4.64591
257.0793 4.7309861 4.70704
262.0056 4.7906723 4.76721
266.7629 4.8477054 4.82469
271.6167 4.9052911 4.88274
276.4323 4.9618284 4.93971
281.234 5.0176203 4.99592
286.1843 5.0745382 5.05326
291.5212 5.1352269 5.11438
295.6907 5.1821597 5.16166
300.2205 5.2326758 5.21252
305.3089 5.2888415 5.26908
310.6186 5.3468034 5.32743
Stefan Stoll
EasySpin Creator
Posts: 1073
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Comparison of magn. susceptibility results from ES and P

Post by Stefan Stoll »

EasySpin and PHI should give the same result.

It looks like your input for Sys.ee is wrong. Use this:

Code: Select all

% S1 = S2 = S3 = 5/2 
% g1 = g2 = g3 = 2
% J = -19 cm-1, J' = -23, d = 1.5 cm-1
% H = -2J (S1S2 + S2S3) - 2J'S1S3 - 2d(S1xS2 + S2xS3 + S3xS1) + HZeeman

cm = 100*clight/1e6; % cm^-1 -> MHz conversion
J = -19*cm;
Jp = -23*cm;
dx = 0*cm;
dy = 0*cm;
dz = 1.5*cm;
d = [0 dz -dy; -dz 0 dx; dy -dx 0];
ee12 = -2*J *eye(3) - 2*d;
ee23 = -2*J *eye(3) - 2*d;
ee13 = -2*Jp*eye(3) + 2*d;
Fe3.ee = [ee12; ee13; ee23];
Fe3.S = [5/2 5/2 5/2];
Fe3.g = [2 2 2];
thanasis
Local Expert
Posts: 245
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Re: Comparison of magn. susceptibility results from ES and P

Post by thanasis »

YES!

Identical!

Thanks for correcting this. I'll try to track the bug in my code to see what went wrong and publish asap.
Post Reply