Compare commits

..

3 Commits

3 changed files with 247 additions and 15 deletions

View File

@ -23,7 +23,7 @@ function plotPhaseSpaceWithAccelerationField(OvenObj, MOTObj, MinimumVelocity, M
a=zeros(NumberOfBins+1,NumberOfBins+1,3);
MOTObj.restoreDefaults();
% MOTObj.restoreDefaults();
for i=1:length(X)
for j=1:length(Y)
@ -61,8 +61,12 @@ function plotPhaseSpaceWithAccelerationField(OvenObj, MOTObj, MinimumVelocity, M
hold on
count = 0;
for i=1:length(Y)
plot(DynamicalQuantities(i,:,1),DynamicalQuantities(i,:,4),'w','linewidth',1.3)
if DynamicalQuantities(i,end,2) > 0
plot(DynamicalQuantities(i,:,1),DynamicalQuantities(i,:,4),'w','linewidth',1.3)
count = count + 1;
end
end
hold off

View File

@ -4,10 +4,10 @@ OptionsStruct.NumberOfAtoms = 5000;
OptionsStruct.TimeStep = 50e-06; % in s
OptionsStruct.SimulationTime = 5e-03; % in s
OptionsStruct.SpontaneousEmission = true;
OptionsStruct.SidebandBeam = false;
OptionsStruct.SidebandBeam = true;
OptionsStruct.PushBeam = true;
OptionsStruct.Gravity = true;
OptionsStruct.BackgroundCollision = false;
OptionsStruct.BackgroundCollision = true;
OptionsStruct.SaveData = true;
% OptionsStruct.SaveDirectory = '';
options = Helper.convertstruct2cell(OptionsStruct);
@ -122,3 +122,115 @@ options = Helper.convertstruct2cell(
Plotter.plotResultForThreeParameterScan(DetuningArray, PowerArray, MagneticGradientArray, LoadingRateArray, options{:})
clear OptionsStruct
%%
MOT2D.NumberOfAtoms = 10000;
MOT2D.TotalPower = 0.4;
MOT2D.MagneticGradient = 0.4; 0;
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
CoolingBeam.Power = 0.2;
CoolingBeam.Detuning = -1.3*Helper.PhysicsConstants.BlueLinewidth;
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
SidebandBeam.Power = 0.2;
NumberOfPointsForFirstParam = 20; %iterations of the simulation
NumberOfPointsForSecondParam = 20;
DetuningArray = linspace(-1.0, -6.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
BeamWaistArray = linspace(10, 25, NumberOfPointsForSecondParam) * 1e-03;
tStart = tic;
LoadingRateArray = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam);
StandardErrorArray = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam);
ConfidenceIntervalArray = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam, 2);
for i=1:NumberOfPointsForFirstParam
eval(sprintf('SidebandBeam.Detuning = %d;', DetuningArray(i)));
for j=1:NumberOfPointsForSecondParam
eval(sprintf('CoolingBeam.Waist = %d;', BeamWaistArray(j)));
eval(sprintf('SidebandBeam.Waist = %d;', BeamWaistArray(j)));
[LoadingRateArray(i,j), StandardErrorArray(i,j), ConfidenceIntervalArray(i,j,:)] = MOT2D.runSimulation(Oven);
end
end
tEnd = toc(tStart);
fprintf('Total Computational Time: %0.1f seconds. \n', tEnd);
if MOT2D.DoSave
LoadingRate = struct;
LoadingRate.Values = LoadingRateArray;
MOT2D.Results = LoadingRate;
SaveFolder = [MOT2D.SaveDirectory filesep 'Results'];
Filename = ['TwoParameterScan_' datestr(now,'yyyymmdd_HHMM')];
eval([sprintf('%s_Object', Filename) ' = MOT2D;']);
mkdir(SaveFolder);
save([SaveFolder filesep Filename], sprintf('%s_Object', Filename));
end
% - Plot results
OptionsStruct = struct;
OptionsStruct.RescalingFactorForFirstParameter = (Helper.PhysicsConstants.BlueLinewidth)^-1;
OptionsStruct.XLabelString = 'Sideband Beam Detuning (\Delta/\Gamma)';
OptionsStruct.RescalingFactorForSecondParameter = 1000;
OptionsStruct.YLabelString = 'Beam Waist (mW)';
OptionsStruct.RescalingFactorForQuantityOfInterest = 1e-10;
% OptionsStruct.ZLabelString = 'Enhancement Factor (\eta)';
OptionsStruct.ZLabelString = 'Loading rate (x 10^{9} atoms/s)';
OptionsStruct.TitleString = sprintf('Magnetic Gradient = %.0f (G/cm)', MOT2D.MagneticGradient * 100);
options = Helper.convertstruct2cell(OptionsStruct);
Plotter.plotResultForTwoParameterScan(DetuningArray, BeamWaistArray, LoadingRateArray, options{:})
%%
MOT2D.NumberOfAtoms = 10000;
MOT2D.TotalPower = 0.4;
MOT2D.MagneticGradient = 0.4; 0;
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
CoolingBeam.Power = 0.2;
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
SidebandBeam.Power = 0.2;
NumberOfPointsForFirstParam = 20; %iterations of the simulation
NumberOfPointsForSecondParam = 20;
DetuningArray = linspace(-1.0, -5.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
BeamWaistArray = linspace(10, 25, NumberOfPointsForSecondParam) * 1e-03;
tStart = tic;
LoadingRateArray = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam);
StandardErrorArray = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam);
ConfidenceIntervalArray = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam, 2);
for i=1:NumberOfPointsForFirstParam
eval(sprintf('CoolingBeam.Detuning = %d;', DetuningArray(i)));
eval(sprintf('SidebandBeam.Detuning = %d;', DetuningArray(i) - (1.0 * Helper.PhysicsConstants.BlueLinewidth)));
for j=1:NumberOfPointsForSecondParam
eval(sprintf('CoolingBeam.Waist = %d;', BeamWaistArray(j)));
eval(sprintf('SidebandBeam.Waist = %d;', BeamWaistArray(j)));
[LoadingRateArray(i,j), StandardErrorArray(i,j), ConfidenceIntervalArray(i,j,:)] = MOT2D.runSimulation(Oven);
end
end
tEnd = toc(tStart);
fprintf('Total Computational Time: %0.1f seconds. \n', tEnd);
if MOT2D.DoSave
LoadingRate = struct;
LoadingRate.Values = LoadingRateArray;
MOT2D.Results = LoadingRate;
SaveFolder = [MOT2D.SaveDirectory filesep 'Results'];
Filename = ['TwoParameterScan_' datestr(now,'yyyymmdd_HHMM')];
eval([sprintf('%s_Object', Filename) ' = MOT2D;']);
mkdir(SaveFolder);
save([SaveFolder filesep Filename], sprintf('%s_Object', Filename));
end
% - Plot results
OptionsStruct = struct;
OptionsStruct.RescalingFactorForFirstParameter = (Helper.PhysicsConstants.BlueLinewidth)^-1;
OptionsStruct.XLabelString = 'Beam Detuning (\Delta/\Gamma)';
OptionsStruct.RescalingFactorForSecondParameter = 1000;
OptionsStruct.YLabelString = 'Beam Waist (mW)';
OptionsStruct.RescalingFactorForQuantityOfInterest = 1e-10;
% OptionsStruct.ZLabelString = 'Enhancement Factor (\eta)';
OptionsStruct.ZLabelString = 'Loading rate (x 10^{9} atoms/s)';
OptionsStruct.TitleString = sprintf('Magnetic Gradient = %.0f (G/cm)', MOT2D.MagneticGradient * 100);
options = Helper.convertstruct2cell(OptionsStruct);
Plotter.plotResultForTwoParameterScan(DetuningArray, BeamWaistArray, LoadingRateArray, options{:})

View File

@ -75,15 +75,16 @@ Plotter.plotAngularDistributionForDifferentBeta(Oven, Beta)
Plotter.plotCaptureVelocityVsAngle(Oven, MOT2D); % Takes a long time to plot!
%% - Plot Phase Space with Acceleration Field
MOT2D.SidebandBeam = true;
MOT2D.SidebandBeam = false;
MOT2D.MagneticGradient = 0.4;
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
CoolingBeam.Power = 0.2;
CoolingBeam.Detuning = -1.5*Helper.PhysicsConstants.BlueLinewidth;
CoolingBeam.Waist = 16e-03;
CoolingBeam.Power = 0.3;
CoolingBeam.Detuning = -1.64*Helper.PhysicsConstants.BlueLinewidth;
CoolingBeam.Waist = 15e-03;
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
SidebandBeam.Power = 0.6;
SidebandBeam.Detuning = -5*Helper.PhysicsConstants.BlueLinewidth;
SidebandBeam.Waist = 16e-03;
SidebandBeam.Power = 0.5;
SidebandBeam.Detuning = -4*Helper.PhysicsConstants.BlueLinewidth;
SidebandBeam.Waist = 15e-03;
MOT2D.NumberOfAtoms = 50;
MinimumVelocity = 0;
MaximumVelocity = 150;
@ -265,8 +266,9 @@ clear OptionsStruct
MOT2D.NumberOfAtoms = 10000;
MOT2D.SidebandBeam = false;
MOT2D.PushBeam = false;
MOT2D.BackgroundCollision = false;
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
CoolingBeam.Power = 0.7;
CoolingBeam.Power = 0.4;
NumberOfPointsForFirstParam = 10; %iterations of the simulation
NumberOfPointsForSecondParam = 10;
NumberOfPointsForThirdParam = 6;
@ -300,3 +302,117 @@ options = Helper.convertstruct2cell(
Plotter.plotResultForThreeParameterScan(FirstParameterArray, SecondParameterArray, ThirdParameterArray, LoadingRateArray, options{:})
clear OptionsStruct
%% Local Saturation Intensity distribution
WaveVectorEndPoint = zeros(2,3);
WaveVectorEndPoint(1,:) = [1,0,1];
WaveVectorEndPoint(1,:) = WaveVectorEndPoint(1,1:3)/norm(WaveVectorEndPoint(1,:));
WaveVectorEndPoint(2,:) = [-1,0,1];
WaveVectorEndPoint(2,:) = WaveVectorEndPoint(2,1:3)/norm(WaveVectorEndPoint(2,:));
Origin = [0,0,0];
BeamNumber = 2; %Selects one of the two wave vectors defined above
BeamRadius = 17.5e-03;
BeamWaist = 15e-03;
Power = 0.4;
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
SaturationIntensity = CoolingBeam.SaturationIntensity;
SaturationParameter = 0.1 * (8 * Power) / (pi*BeamWaist^2 * SaturationIntensity); % two beams are reflected
n = 1000;
t = 2*pi*rand(n,1);
r = BeamRadius*sqrt(rand(n,1));
% xmin = -15e-03;
% xmax = 15e-03;
% x = xmin+rand(n,1)*(xmax-xmin);
x = r.*cos(t);
y = ones(n,1) * 2e-03;
z = r.*sin(t);
PositionVector = horzcat(x, y, z); %scatter3(zeros(n,1), y, z)
CoolingBeamLocalSaturationIntensity = @(x) MOT2D.calculateLocalSaturationIntensity(0.25 * SaturationParameter, x, Origin, WaveVectorEndPoint(BeamNumber,:), BeamRadius, BeamWaist);
IntensityProfile = zeros(n,1);
for i=1:n
IntensityProfile(i) = CoolingBeamLocalSaturationIntensity(PositionVector(i, :));
end
v = IntensityProfile; % Extract intensity value
rows = 100;
columns = 100;
Image = zeros(rows, columns);
for k = 1 : length(x)
row = ceil((x(k) - min(x)) * columns / (max(x) - min(x)));
column = ceil((z(k) - min(z)) * rows / (max(z) - min(z)));
if (row == 0)
row = 1;
end
if (column == 0)
column = 1;
end
Image(row, column) = v(k);
end
f_h = Helper.getFigureByTag('Intensity Profile');
set(groot,'CurrentFigure',f_h);
a_h = get(f_h, 'CurrentAxes');
if ~isempty(get(a_h, 'Children'))
clf(f_h);
end
f_h.Name = 'Intensity Profile';
f_h.Units = 'pixels';
set(0,'units','pixels');
screensize = get(0,'ScreenSize');
f_h.Position = [[screensize(3)/3.5 screensize(4)/3.5] 750 600];
imagesc(linspace(min(x),max(x),row) * 1e+03, linspace(min(z),max(z),column) * 1e+03, Image);
set(gca,'YDir','normal');
hXLabel = xlabel('x-direction (distance in mm)');
hYLabel = ylabel('z-direction (distance in mm)');
shading flat;
c = colorbar;
c.Label.String= 'Local Saturation Intensity';
c.Label.FontSize = 14;
hTitle = sgtitle('Intensity Distribution');
set([hXLabel, hYLabel] , ...
'FontSize' , 14 );
set( hTitle , ...
'FontSize' , 18 );
Helper.bringFiguresWithTagInForeground();
%% Beam Shape in Three dimensions
f_h = Helper.getFigureByTag('Intensity Profile');
set(groot,'CurrentFigure',f_h);
a_h = get(f_h, 'CurrentAxes');
if ~isempty(get(a_h, 'Children'))
clf(f_h);
end
f_h.Name = 'Intensity Profile';
f_h.Units = 'pixels';
set(0,'units','pixels');
screensize = get(0,'ScreenSize');
f_h.Position = [[screensize(3)/3.5 screensize(4)/3.5] 750 600];
[xq,zq] = meshgrid(linspace(-BeamWaist, BeamWaist, n), linspace(-BeamWaist, BeamWaist, n));
vq = griddata(x,z,v,xq,zq);
mesh(xq,zq,vq)
hold on
plot3(x,z,v,'o', 'MarkerSize', 1.5)
hXLabel = xlabel('x-direction (distance in mm)');
hYLabel = ylabel('z-direction (distance in mm)');
shading flat;
c = colorbar;
c.Label.String= 'Local Saturation Intensity';
c.Label.FontSize = 14;
hTitle = sgtitle('Intensity Distribution');
set([hXLabel, hYLabel] , ...
'FontSize' , 14 );
set( hTitle , ...
'FontSize' , 18 );
Helper.bringFiguresWithTagInForeground();