Fit using curry matrix error

General forum for EasySpin: questions, how to's, etc.
Post Reply
marco
Newbie
Posts: 2
Joined: Fri Aug 18, 2017 12:24 am

Fit using curry matrix error

Post by marco »

Hello everyone,

when trying to fit Magnetisation over B-Field data with the esfit 'curr' function without scaling I receive an error message I do not really understand. It says some matrices do not have the right dimension, but I do not know how to fix this error:

"Error using vertcat
Dimensions of matrices being concatenated are not consistent.

Error in esfit

Error in esfit_simplex

Error in esfit

Error while evaluating UIControl Callback.
"

My code is the following:

Sys.g = [1.99, 1.99];
Sys.S = [1, 1];
Sys.J = -27504;
Dvar = -4760;
Sys.D = [Dvar Dvar];

[Bexp_raw, Mexp_raw] = textread('mydata.txt', '%f %f'); %imported in Oersted und Bohrmagneton
Bexp = Bexp_raw * 0.1; %Oersted to mT

Vary.D = [10000, 10000];
Vary.J = 10000;
Exp.CrystalOrientation = [];
Exp.Temperature = 2;
Exp.Field = Bexp(1:end);
SimOpt = [];
FitOpt.OutArg = [1 1];
esfit('curry', Mexp_raw(1:end), Sys, Vary, Exp, SimOpt, FitOpt);


However, fitting with scaling does not produce the error above, so it probably also has something to do with the choice of no scaling.... hopefully someone of you knows this error and can provide help. I would be very thankful!
Stefan Stoll
EasySpin Creator
Posts: 1041
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Fit using curry matrix error

Post by Stefan Stoll »

Please provide your data file mydata.txt, so we can reproduce the error and investigate it.
marco
Newbie
Posts: 2
Joined: Fri Aug 18, 2017 12:24 am

Re: Fit using curry matrix error

Post by marco »

of course! Somehow I can not upload .dat or .txt files in here, I always get a "The extension dat/txt ist not allowed" message, so I just put the data in here (sorry for the long post). The first column is the magnetic field in Oersted and the second column is the magnetization in Bohrmagneton.

250 0.06384
500 0.12967
750 0.19667
1000 0.26461
1500 0.39921
2000 0.52899
2500 0.65654
3000 0.78093
3500 0.90004
4000 1.01503
4500 1.12487
5000 1.23037
6000 1.42516
7000 1.59767
8000 1.74975
9000 1.88236
10000 1.99831
15000 2.38478
20000 2.5881
25000 2.70811
30000 2.78986
35000 2.8492
40000 2.89458
45000 2.93128
50000 2.96176
45000 2.93163
40000 2.89552
35000 2.85061
30000 2.79185
25000 2.71163
20000 2.59139
15000 2.38854
10000 2.0023
9000 1.88611
8000 1.75245
7000 1.60095
6000 1.42504
5000 1.23213
4500 1.1278
4000 1.01679
3500 0.9018
3000 0.78187
2500 0.65795
2000 0.5304
1500 0.39956
1000 0.26649
750 0.19949
500 0.13166
250 0.06266
-250 -0.06923
-500 -0.13624
-750 -0.20324
-1000 -0.27048
-1500 -0.40261
-2000 -0.53439
-2500 -0.66147
-3000 -0.78492
-3500 -0.90473
-4000 -1.02008
-4500 -1.12956
-5000 -1.23494
-6000 -1.4295
-7000 -1.60306
-8000 -1.7555
-9000 -1.88823
-10000 -2.00394
-15000 -2.39112
-20000 -2.59373
-25000 -2.71409
-30000 -2.79397
-35000 -2.85261
-40000 -2.89752
-45000 -2.93433
-50000 -2.96469
-45000 -2.93386
-40000 -2.89752
-35000 -2.85272
-30000 -2.79444
-25000 -2.71468
-20000 -2.5942
-15000 -2.39147
-10000 -2.00382
-9000 -1.88741
-8000 -1.75433
-7000 -1.60201
-6000 -1.42798
-5000 -1.23248
-4500 -1.12722
-4000 -1.01679
-3500 -0.9018
-3000 -0.78187
-2500 -0.65807
-2000 -0.53016
-1500 -0.39979
-1000 -0.26649
-750 -0.19937
-500 -0.1319
-250 -0.06442
Stefan Stoll
EasySpin Creator
Posts: 1041
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Fit using curry matrix error

Post by Stefan Stoll »

Replace Mexp_raw(1:end) in the esfit call with Mexp_raw.' (using the transpose .').
Post Reply