Tag Archive | Magneto-Optical Trap

MATLAB Code for MOT Lifetime – Linear Fitting

% #1 read .cvs file
C=uiimport(‘FileFolder\C2mot-gradient200032.txt’);

x=1:length(C.data(:,1));
plot(x,C.data(:,2));

% #2 find I_max
B=C.data(14000:17000,2);
I_max=mean(B);

w=log(I_max-C.data(:,2));

% #5 linear fit =>> slope is -1/tau =>> This is the first return value of
%polyfit
p_flu=polyfit(C.data(7200:10000,1),w(7200:10000),1);
tau=-1/p_flu(1)

MLoad= I_max-(exp(p_flu(2)).*(exp(-C.data(:,1)/tau)));
plot(x(5000:25000),C.data(5000:25000,2),x(5000:25000),MLoad(5000:25000))