Compare commits
No commits in common. "372690b158ab340955eac63ffbd6106d216e727f" and "5f068db1c12abb6d5f61c74ed3370f7831b877b4" have entirely different histories.
372690b158
...
5f068db1c1
@ -47,10 +47,6 @@ function plotResultForTwoParameterScan(XParameter, YParameter, ZQuantity, vararg
|
|||||||
|
|
||||||
imagesc(RescaledXParameter, RescaledYParameter, RescaledZQuantity(:,:)');
|
imagesc(RescaledXParameter, RescaledYParameter, RescaledZQuantity(:,:)');
|
||||||
|
|
||||||
% hold on
|
|
||||||
%
|
|
||||||
% contour(RescaledXParameter, RescaledYParameter, RescaledZQuantity(:,:)', 'Color', 'r', 'Linewidth', 4, 'ShowText','on')
|
|
||||||
|
|
||||||
set(gca,'YDir','normal');
|
set(gca,'YDir','normal');
|
||||||
|
|
||||||
caxis([min(min(min(RescaledZQuantity))) max(max(max(RescaledZQuantity)))]);
|
caxis([min(min(min(RescaledZQuantity))) max(max(max(RescaledZQuantity)))]);
|
||||||
|
@ -2,12 +2,12 @@ OptionsStruct = struct;
|
|||||||
OptionsStruct.ErrorEstimationMethod = 'bootstrap'; % 'jackknife' | 'bootstrap'
|
OptionsStruct.ErrorEstimationMethod = 'bootstrap'; % 'jackknife' | 'bootstrap'
|
||||||
OptionsStruct.NumberOfAtoms = 5000;
|
OptionsStruct.NumberOfAtoms = 5000;
|
||||||
OptionsStruct.TimeStep = 50e-06; % in s
|
OptionsStruct.TimeStep = 50e-06; % in s
|
||||||
OptionsStruct.SimulationTime = 5e-03; % in s
|
OptionsStruct.SimulationTime = 4e-03; % in s
|
||||||
OptionsStruct.SpontaneousEmission = true;
|
OptionsStruct.SpontaneousEmission = true;
|
||||||
OptionsStruct.SidebandBeam = false;
|
OptionsStruct.SidebandBeam = true;
|
||||||
OptionsStruct.PushBeam = true;
|
OptionsStruct.PushBeam = true;
|
||||||
OptionsStruct.Gravity = true;
|
OptionsStruct.Gravity = true;
|
||||||
OptionsStruct.BackgroundCollision = false;
|
OptionsStruct.BackgroundCollision = true;
|
||||||
OptionsStruct.SaveData = true;
|
OptionsStruct.SaveData = true;
|
||||||
% OptionsStruct.SaveDirectory = '';
|
% OptionsStruct.SaveDirectory = '';
|
||||||
options = Helper.convertstruct2cell(OptionsStruct);
|
options = Helper.convertstruct2cell(OptionsStruct);
|
||||||
@ -15,46 +15,21 @@ clear OptionsStruct
|
|||||||
|
|
||||||
Oven = Simulator.Oven(options{:});
|
Oven = Simulator.Oven(options{:});
|
||||||
MOT2D = Simulator.TwoDimensionalMOT(options{:});
|
MOT2D = Simulator.TwoDimensionalMOT(options{:});
|
||||||
Beams = MOT2D.Beams;
|
|
||||||
|
|
||||||
%%
|
%%
|
||||||
MOT2D.NumberOfAtoms = 10000;
|
MOT2D.NumberOfAtoms = 5000;
|
||||||
MOT2D.TotalPower = 0.8;
|
MOT2D.TotalPower = 0.4;
|
||||||
MOT2D.MagneticGradient = 0.4; 0;
|
MOT2D.SidebandBeam = true;
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
||||||
CoolingBeam.Waist = 15e-03;
|
NumberOfPointsForSecondParam = 10;
|
||||||
CoolingBeam.Detuning = -1.67*Helper.PhysicsConstants.BlueLinewidth;
|
DetuningArray = linspace(-0.5, -5.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
|
||||||
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
|
PowerArray = linspace(0.1, 1.0, NumberOfPointsForSecondParam) * MOT2D.TotalPower;
|
||||||
SidebandBeam.Waist = 15e-03;
|
|
||||||
|
|
||||||
NumberOfPointsForFirstParam = 20; %iterations of the simulation
|
|
||||||
NumberOfPointsForSecondParam = 20;
|
|
||||||
DetuningArray = linspace(-1.0, -6.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
|
|
||||||
PowerArray = linspace(0, 0.8, NumberOfPointsForSecondParam) * MOT2D.TotalPower;
|
|
||||||
|
|
||||||
tStart = tic;
|
tStart = tic;
|
||||||
[LoadingRateArray, ~, ~] = Scripts.scanForSidebandEnhancement(Oven, MOT2D, 'Blue', 'BlueSideband', DetuningArray, PowerArray);
|
[LoadingRateArray, ~, ~] = Scripts.scanForSidebandEnhancement(Oven, MOT2D, 'Blue', 'BlueSideband', DetuningArray, PowerArray);
|
||||||
tEnd = toc(tStart);
|
tEnd = toc(tStart);
|
||||||
fprintf('Total Computational Time: %0.1f seconds. \n', tEnd);
|
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
|
|
||||||
|
|
||||||
MOT2D.SidebandBeam = false;
|
|
||||||
MOT2D.PushBeam = false;
|
|
||||||
CoolingBeam.Power = MOT2D.TotalPower;
|
|
||||||
[LoadingRate, ~] = MOT2D.runSimulation(Oven);
|
|
||||||
|
|
||||||
EnhancementFactorArray = LoadingRateArray ./ LoadingRate;
|
|
||||||
|
|
||||||
% - Plot results
|
% - Plot results
|
||||||
|
|
||||||
OptionsStruct = struct;
|
OptionsStruct = struct;
|
||||||
@ -62,63 +37,12 @@ OptionsStruct.RescalingFactorForFirstParameter = (Helper.PhysicsConstants.B
|
|||||||
OptionsStruct.XLabelString = 'Sideband Beam Detuning (\Delta/\Gamma)';
|
OptionsStruct.XLabelString = 'Sideband Beam Detuning (\Delta/\Gamma)';
|
||||||
OptionsStruct.RescalingFactorForSecondParameter = 1000;
|
OptionsStruct.RescalingFactorForSecondParameter = 1000;
|
||||||
OptionsStruct.YLabelString = 'Sideband Beam Power (mW)';
|
OptionsStruct.YLabelString = 'Sideband Beam Power (mW)';
|
||||||
OptionsStruct.RescalingFactorForQuantityOfInterest = 1;
|
OptionsStruct.RescalingFactorForQuantityOfInterest = 1e-9;
|
||||||
OptionsStruct.ZLabelString = 'Enhancement Factor (\eta)';
|
OptionsStruct.ZLabelString = 'Loading rate (x 10^{9} atoms/s)';
|
||||||
% OptionsStruct.ZLabelString = 'Loading rate (x 10^{9} atoms/s)';
|
|
||||||
OptionsStruct.TitleString = sprintf('Magnetic Gradient = %.0f (G/cm)', MOT2D.MagneticGradient * 100);
|
OptionsStruct.TitleString = sprintf('Magnetic Gradient = %.0f (G/cm)', MOT2D.MagneticGradient * 100);
|
||||||
|
|
||||||
options = Helper.convertstruct2cell(OptionsStruct);
|
options = Helper.convertstruct2cell(OptionsStruct);
|
||||||
Plotter.plotResultForTwoParameterScan(DetuningArray, PowerArray, EnhancementFactorArray, options{:})
|
|
||||||
|
|
||||||
%% Magnetic gradient scan
|
Plotter.plotResultForTwoParameterScan(DetuningArray, PowerArray, LoadingRateArray, options{:})
|
||||||
|
|
||||||
MOT2D.NumberOfAtoms = 10000;
|
|
||||||
MOT2D.TotalPower = 0.4;
|
|
||||||
MOT2D.SidebandBeam = true;
|
|
||||||
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
|
||||||
NumberOfPointsForSecondParam = 10;
|
|
||||||
NumberOfPointsForThirdParam = 6;
|
|
||||||
DetuningArray = linspace(-0.5, -5.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
|
|
||||||
PowerArray = linspace(0.1, 1.0, NumberOfPointsForSecondParam) * MOT2D.TotalPower;
|
|
||||||
MagneticGradientArray = linspace(30, 50, NumberOfPointsForThirdParam) * 1e-02;
|
|
||||||
Beams = MOT2D.Beams;
|
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
|
||||||
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
|
|
||||||
LoadingRateArray = {};
|
|
||||||
|
|
||||||
tStart = tic;
|
|
||||||
for k=1:NumberOfPointsForThirdParam
|
|
||||||
eval(sprintf('MOT2D.%s = %d;', 'MagneticGradient', MagneticGradientArray(k)));
|
|
||||||
lrmatrix = zeros(NumberOfPointsForFirstParam, NumberOfPointsForSecondParam);
|
|
||||||
for i=1:NumberOfPointsForFirstParam
|
|
||||||
eval(sprintf('SidebandBeam.%s = %d;', 'Detuning', DetuningArray(i)));
|
|
||||||
for j=1:NumberOfPointsForSecondParam
|
|
||||||
eval(sprintf('SidebandBeam.%s = %d;', 'Power', PowerArray(j)));
|
|
||||||
eval(sprintf('CoolingBeam.%s = %d;', 'Power', MOT2D.TotalPower - PowerArray(j)));
|
|
||||||
[lrmatrix(i,j), ~, ~] = MOT2D.runSimulation(Oven);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
LoadingRateArray{end+1} = lrmatrix;
|
|
||||||
end
|
|
||||||
|
|
||||||
tEnd = toc(tStart);
|
|
||||||
fprintf('Total Computational Time: %0.1f seconds. \n', tEnd);
|
|
||||||
|
|
||||||
% - Plot results
|
|
||||||
|
|
||||||
OptionsStruct = struct;
|
|
||||||
OptionsStruct.RescalingFactorForFirstParameter = (Helper.PhysicsConstants.BlueLinewidth)^-1;
|
|
||||||
OptionsStruct.XLabelString = 'Sideband Beam Detuning (\Delta/\Gamma)';
|
|
||||||
OptionsStruct.RescalingFactorForSecondParameter = 1000;
|
|
||||||
OptionsStruct.YLabelString = 'Sideband Beam Waist (mm)';
|
|
||||||
OptionsStruct.RescalingFactorForThirdParameter = 100;
|
|
||||||
OptionsStruct.RescalingFactorForQuantityOfInterest = 1e-9;
|
|
||||||
OptionsStruct.ZLabelString = 'Loading rate (x 10^{9} atoms/s)';
|
|
||||||
OptionsStruct.PlotTitleString = 'Magnetic Gradient = %.0f (G/cm)';
|
|
||||||
OptionsStruct.FigureTitleString = sprintf('Oven-2DMOT Distance = %.1f (mm); Total Beam Power = %d (mW)', Oven.OvenDistance * 1000, MOT2D.TotalPower*1000);
|
|
||||||
|
|
||||||
options = Helper.convertstruct2cell(OptionsStruct);
|
|
||||||
|
|
||||||
Plotter.plotResultForThreeParameterScan(DetuningArray, PowerArray, MagneticGradientArray, LoadingRateArray, options{:})
|
|
||||||
|
|
||||||
clear OptionsStruct
|
clear OptionsStruct
|
@ -4,9 +4,9 @@ classdef Beams < handle & matlab.mixin.Copyable
|
|||||||
|
|
||||||
BlueBeamDefault = struct('Alias', 'Blue', ...
|
BlueBeamDefault = struct('Alias', 'Blue', ...
|
||||||
'Power', 400e-3, ...
|
'Power', 400e-3, ...
|
||||||
'Detuning', -1.64*Helper.PhysicsConstants.BlueLinewidth, ...
|
'Detuning', -1.39*Helper.PhysicsConstants.BlueLinewidth, ...
|
||||||
'Radius', 17.5e-3, ...
|
'Radius', 35e-3, ...
|
||||||
'Waist', 15e-3, ...
|
'Waist', 16.67e-3, ...
|
||||||
'WaveNumber',2*pi/Helper.PhysicsConstants.BlueWavelength, ...
|
'WaveNumber',2*pi/Helper.PhysicsConstants.BlueWavelength, ...
|
||||||
'Linewidth', Helper.PhysicsConstants.BlueLinewidth, ...
|
'Linewidth', Helper.PhysicsConstants.BlueLinewidth, ...
|
||||||
'SaturationIntensity', 0.1 * (2 * pi^2 / 3) * ...
|
'SaturationIntensity', 0.1 * (2 * pi^2 / 3) * ...
|
||||||
@ -15,10 +15,10 @@ classdef Beams < handle & matlab.mixin.Copyable
|
|||||||
Helper.PhysicsConstants.BlueLinewidth) / (Helper.PhysicsConstants.BlueWavelength)^3));
|
Helper.PhysicsConstants.BlueLinewidth) / (Helper.PhysicsConstants.BlueWavelength)^3));
|
||||||
|
|
||||||
BlueSidebandBeamDefault = struct('Alias', 'BlueSideband', ...
|
BlueSidebandBeamDefault = struct('Alias', 'BlueSideband', ...
|
||||||
'Power', 400e-3, ...
|
'Power', 200e-3, ...
|
||||||
'Detuning', -3*Helper.PhysicsConstants.BlueLinewidth, ...
|
'Detuning', -3*Helper.PhysicsConstants.BlueLinewidth, ...
|
||||||
'Radius', 17.5e-3, ...
|
'Radius', 35e-3, ...
|
||||||
'Waist', 15e-3, ...
|
'Waist', 16.67e-3, ...
|
||||||
'WaveNumber',2*pi/Helper.PhysicsConstants.BlueWavelength, ...
|
'WaveNumber',2*pi/Helper.PhysicsConstants.BlueWavelength, ...
|
||||||
'Linewidth', Helper.PhysicsConstants.BlueLinewidth, ...
|
'Linewidth', Helper.PhysicsConstants.BlueLinewidth, ...
|
||||||
'SaturationIntensity', 0.1 * (2 * pi^2 / 3) * ...
|
'SaturationIntensity', 0.1 * (2 * pi^2 / 3) * ...
|
||||||
@ -27,10 +27,10 @@ classdef Beams < handle & matlab.mixin.Copyable
|
|||||||
Helper.PhysicsConstants.BlueLinewidth) / (Helper.PhysicsConstants.BlueWavelength)^3));
|
Helper.PhysicsConstants.BlueLinewidth) / (Helper.PhysicsConstants.BlueWavelength)^3));
|
||||||
|
|
||||||
PushBeamDefault = struct('Alias', 'Push', ...
|
PushBeamDefault = struct('Alias', 'Push', ...
|
||||||
'Power', 25e-3 , ...
|
'Power', 10e-3 , ...
|
||||||
'Detuning', 104.2*Helper.PhysicsConstants.RedLinewidth, ...
|
'Detuning', 0*Helper.PhysicsConstants.RedLinewidth, ...
|
||||||
'Radius', 1.2e-03, ...
|
'Radius', 1.2e-03, ...
|
||||||
'Waist', 1.0e-03, ...
|
'Waist', 20.001e-3, ...
|
||||||
'WaveNumber',2*pi/Helper.PhysicsConstants.RedWavelength, ...
|
'WaveNumber',2*pi/Helper.PhysicsConstants.RedWavelength, ...
|
||||||
'Linewidth', Helper.PhysicsConstants.RedLinewidth, ...
|
'Linewidth', Helper.PhysicsConstants.RedLinewidth, ...
|
||||||
'SaturationIntensity', 0.1 * (2 * pi^2 / 3) * ...
|
'SaturationIntensity', 0.1 * (2 * pi^2 / 3) * ...
|
||||||
@ -163,7 +163,7 @@ classdef Beams < handle & matlab.mixin.Copyable
|
|||||||
|
|
||||||
methods
|
methods
|
||||||
function ret = get.SaturationParameter(this)
|
function ret = get.SaturationParameter(this)
|
||||||
ret = 0.1 * (8 * this.Power) / (pi*this.Waist^2 * this.SaturationIntensity); % two beams are reflected
|
ret = 0.1 * (4 * this.Power) / (pi*this.Waist^2 * this.SaturationIntensity); % two beams are reflected
|
||||||
end
|
end
|
||||||
end % - getters for dependent properties
|
end % - getters for dependent properties
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ classdef MOTCaptureProcess < handle & matlab.mixin.Copyable
|
|||||||
ret = this.SimulationTime;
|
ret = this.SimulationTime;
|
||||||
end
|
end
|
||||||
function set.NumberOfAtoms(this, val)
|
function set.NumberOfAtoms(this, val)
|
||||||
assert(val <= 50000, '!!Not time efficient to compute for atom numbers larger than 50,000!!');
|
assert(val <= 20000, 'Not time efficient to compute for atom numbers larger than 20,000!');
|
||||||
this.NumberOfAtoms = val;
|
this.NumberOfAtoms = val;
|
||||||
end
|
end
|
||||||
function ret = get.NumberOfAtoms(this)
|
function ret = get.NumberOfAtoms(this)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
classdef TwoDimensionalMOT < Simulator.MOTCaptureProcess & matlab.mixin.Copyable
|
classdef TwoDimensionalMOT < Simulator.MOTCaptureProcess & matlab.mixin.Copyable
|
||||||
|
|
||||||
properties (Access = private)
|
properties (Access = private)
|
||||||
MagneticGradienDefault = 0.40; % T/m
|
MagneticGradienDefault = 0.425; % T/m
|
||||||
ExitDivergenceDefault = 15e-3;
|
ExitDivergenceDefault = 16e-3;
|
||||||
DistanceBetweenPushBeamAnd3DMOTCenterDefault = 0;
|
DistanceBetweenPushBeamAnd3DMOTCenterDefault = 0;
|
||||||
PushBeamDistanceDefault = 0.32;
|
PushBeamDistanceDefault = 0.32;
|
||||||
end
|
end
|
||||||
@ -19,8 +19,6 @@ classdef TwoDimensionalMOT < Simulator.MOTCaptureProcess & matlab.mixin.Copyable
|
|||||||
TimeSpentInInteractionRegion;
|
TimeSpentInInteractionRegion;
|
||||||
ParticleDynamicalQuantities;
|
ParticleDynamicalQuantities;
|
||||||
InitialParameters;
|
InitialParameters;
|
||||||
BootstrapSampleLength;
|
|
||||||
BootstrapSampleNumber;
|
|
||||||
Results;
|
Results;
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -52,8 +50,7 @@ classdef TwoDimensionalMOT < Simulator.MOTCaptureProcess & matlab.mixin.Copyable
|
|||||||
this.InitialParameters.LandegFactor = this.LandegFactor;
|
this.InitialParameters.LandegFactor = this.LandegFactor;
|
||||||
this.InitialParameters.MagneticSubLevel= this.MagneticSubLevel;
|
this.InitialParameters.MagneticSubLevel= this.MagneticSubLevel;
|
||||||
this.InitialParameters.MagneticGradient= this.MagneticGradient;
|
this.InitialParameters.MagneticGradient= this.MagneticGradient;
|
||||||
this.BootstrapSampleLength = 0.5 * this.NumberOfAtoms;
|
|
||||||
this.BootstrapSampleNumber = 1000;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function restoreDefaults(this)
|
function restoreDefaults(this)
|
||||||
@ -134,18 +131,6 @@ classdef TwoDimensionalMOT < Simulator.MOTCaptureProcess & matlab.mixin.Copyable
|
|||||||
function ret = get.InitialParameters(this)
|
function ret = get.InitialParameters(this)
|
||||||
ret = this.InitialParameters;
|
ret = this.InitialParameters;
|
||||||
end
|
end
|
||||||
function set.BootstrapSampleLength(this,val)
|
|
||||||
this.BootstrapSampleLength = val;
|
|
||||||
end
|
|
||||||
function ret = get.BootstrapSampleLength(this)
|
|
||||||
ret = this.BootstrapSampleLength;
|
|
||||||
end
|
|
||||||
function set.BootstrapSampleNumber(this,val)
|
|
||||||
this.BootstrapSampleNumber = val;
|
|
||||||
end
|
|
||||||
function ret = get.BootstrapSampleNumber(this)
|
|
||||||
ret = this.BootstrapSampleNumber;
|
|
||||||
end
|
|
||||||
function set.Results(this, val)
|
function set.Results(this, val)
|
||||||
this.Results = val;
|
this.Results = val;
|
||||||
end
|
end
|
||||||
|
@ -1,22 +1,39 @@
|
|||||||
function [LoadingRate, StandardError, ConfidenceInterval] = bootstrapErrorEstimation(this, ovenObj, NumberOfLoadedAtoms)
|
function [LoadingRate, StandardError, ConfidenceInterval] = bootstrapErrorEstimation(this, ovenObj, NumberOfLoadedAtoms)
|
||||||
n = this.NumberOfAtoms;
|
n = this.NumberOfAtoms;
|
||||||
SampleLength = this.BootstrapSampleLength;
|
NumberOfTimeSteps = int64(this.SimulationTime/this.TimeStep);
|
||||||
NumberOfBootsrapSamples = this.BootstrapSampleNumber;
|
|
||||||
MeanCaptureRatioInEachSample = zeros(1,NumberOfBootsrapSamples);
|
Autocorrelation = autocorr(NumberOfLoadedAtoms,'NumLags', double(NumberOfTimeSteps - 1));
|
||||||
for SampleNumber = 1:NumberOfBootsrapSamples
|
|
||||||
BoostrapSample = datasample(NumberOfLoadedAtoms, SampleLength); % Sample with replacement
|
if Autocorrelation(1)~=0
|
||||||
MeanCaptureRatioInEachSample(SampleNumber) = mean(BoostrapSample) / n; % Empirical bootstrap distribution of sample means
|
CorrelationFactor = table(Helper.findAllZeroCrossings(linspace(1, double(NumberOfTimeSteps), double(NumberOfTimeSteps)), Autocorrelation)).Var1(1);
|
||||||
|
if ~isnan(CorrelationFactor)
|
||||||
|
SampleLength = floor(CorrelationFactor);
|
||||||
|
NumberOfBootsrapSamples = 1000;
|
||||||
|
MeanCaptureRatioInEachSample = zeros(1,NumberOfBootsrapSamples);
|
||||||
|
for SampleNumber = 1:NumberOfBootsrapSamples
|
||||||
|
BoostrapSample = datasample(NumberOfLoadedAtoms, SampleLength); % Sample with replacement
|
||||||
|
MeanCaptureRatioInEachSample(SampleNumber) = mean(BoostrapSample) / n; % Empirical bootstrap distribution of sample means
|
||||||
|
end
|
||||||
|
|
||||||
|
LoadingRate = mean(MeanCaptureRatioInEachSample) * ovenObj.ReducedFlux;
|
||||||
|
|
||||||
|
Variance = 0; % Bootstrap Estimate of Variance
|
||||||
|
for SampleNumber = 1:NumberOfBootsrapSamples
|
||||||
|
Variance = Variance + (MeanCaptureRatioInEachSample(SampleNumber) - mean(MeanCaptureRatioInEachSample))^2;
|
||||||
|
end
|
||||||
|
|
||||||
|
StandardError = sqrt((1 / (NumberOfBootsrapSamples-1)) * Variance) * ovenObj.ReducedFlux;
|
||||||
|
|
||||||
|
ts = tinv([0.025 0.975],NumberOfBootsrapSamples-1); % T-Score
|
||||||
|
ConfidenceInterval = LoadingRate + ts*StandardError; % 95% Confidence Intervals
|
||||||
|
else
|
||||||
|
LoadingRate = nan;
|
||||||
|
StandardError = nan;
|
||||||
|
ConfidenceInterval = [nan nan];
|
||||||
|
end
|
||||||
|
else
|
||||||
|
LoadingRate = nan;
|
||||||
|
StandardError = nan;
|
||||||
|
ConfidenceInterval = [nan nan];
|
||||||
end
|
end
|
||||||
|
|
||||||
LoadingRate = mean(MeanCaptureRatioInEachSample) * ovenObj.ReducedFlux;
|
|
||||||
|
|
||||||
Variance = 0; % Bootstrap Estimate of Variance
|
|
||||||
for SampleNumber = 1:NumberOfBootsrapSamples
|
|
||||||
Variance = Variance + (MeanCaptureRatioInEachSample(SampleNumber) - mean(MeanCaptureRatioInEachSample))^2;
|
|
||||||
end
|
|
||||||
|
|
||||||
StandardError = sqrt((1 / (NumberOfBootsrapSamples-1)) * Variance) * ovenObj.ReducedFlux;
|
|
||||||
|
|
||||||
ts = tinv([0.025 0.975],NumberOfBootsrapSamples-1); % T-Score
|
|
||||||
ConfidenceInterval = LoadingRate + ts*StandardError; % 95% Confidence Intervals
|
|
||||||
end
|
end
|
@ -26,16 +26,11 @@ Beams = MOT2D.Beams;
|
|||||||
|
|
||||||
%% - Run Simulation
|
%% - Run Simulation
|
||||||
MOT2D.NumberOfAtoms = 5000;
|
MOT2D.NumberOfAtoms = 5000;
|
||||||
MOT2D.SidebandBeam = true;
|
MOT2D.SidebandBeam = false;
|
||||||
MOT2D.PushBeam = false;
|
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
||||||
CoolingBeam.Power = 0.2;
|
CoolingBeam.Power = 0.4;
|
||||||
CoolingBeam.Waist = 16.67e-03;
|
CoolingBeam.Waist = 13.3e-03;
|
||||||
CoolingBeam.Detuning = -1.33*Helper.PhysicsConstants.BlueLinewidth;
|
CoolingBeam.Detuning = -1.67*Helper.PhysicsConstants.BlueLinewidth;
|
||||||
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
|
|
||||||
SidebandBeam.Power = 0.4;
|
|
||||||
SidebandBeam.Waist = 16.67e-03;
|
|
||||||
SidebandBeam.Detuning = -2.66*Helper.PhysicsConstants.BlueLinewidth;
|
|
||||||
PushBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Push'), Beams)};
|
PushBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Push'), Beams)};
|
||||||
PushBeam.Power = 0.025;
|
PushBeam.Power = 0.025;
|
||||||
PushBeam.Waist = 0.81e-03;
|
PushBeam.Waist = 0.81e-03;
|
||||||
@ -78,12 +73,10 @@ Plotter.plotCaptureVelocityVsAngle(Oven, MOT2D); % Takes a long time to plot!
|
|||||||
MOT2D.SidebandBeam = true;
|
MOT2D.SidebandBeam = true;
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
||||||
CoolingBeam.Power = 0.2;
|
CoolingBeam.Power = 0.2;
|
||||||
CoolingBeam.Detuning = -1.5*Helper.PhysicsConstants.BlueLinewidth;
|
CoolingBeam.Detuning = -1.67*Helper.PhysicsConstants.BlueLinewidth;
|
||||||
CoolingBeam.Waist = 16e-03;
|
|
||||||
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
|
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
|
||||||
SidebandBeam.Power = 0.6;
|
SidebandBeam.Power = 0.2;
|
||||||
SidebandBeam.Detuning = -5*Helper.PhysicsConstants.BlueLinewidth;
|
SidebandBeam.Detuning = -3.35*Helper.PhysicsConstants.BlueLinewidth;
|
||||||
SidebandBeam.Waist = 16e-03;
|
|
||||||
MOT2D.NumberOfAtoms = 50;
|
MOT2D.NumberOfAtoms = 50;
|
||||||
MinimumVelocity = 0;
|
MinimumVelocity = 0;
|
||||||
MaximumVelocity = 150;
|
MaximumVelocity = 150;
|
||||||
@ -109,8 +102,6 @@ Plotter.plotDynamicalQuantities(Oven, MOT2D, MaximumVelocity, IncidentAtomDirect
|
|||||||
|
|
||||||
MOT2D.NumberOfAtoms = 5000;
|
MOT2D.NumberOfAtoms = 5000;
|
||||||
MOT2D.TotalPower = 0.4;
|
MOT2D.TotalPower = 0.4;
|
||||||
MOT2D.SidebandBeam = false;
|
|
||||||
MOT2D.PushBeam = false;
|
|
||||||
NumberOfPointsForFirstParam = 5; %iterations of the simulation
|
NumberOfPointsForFirstParam = 5; %iterations of the simulation
|
||||||
ParameterArray = linspace(0.1, 1.0, NumberOfPointsForFirstParam) * MOT2D.TotalPower;
|
ParameterArray = linspace(0.1, 1.0, NumberOfPointsForFirstParam) * MOT2D.TotalPower;
|
||||||
|
|
||||||
@ -139,56 +130,6 @@ Plotter.plotResultForOneParameterScan(ParameterArray, LoadingRateArray, options{
|
|||||||
|
|
||||||
clear OptionsStruct
|
clear OptionsStruct
|
||||||
|
|
||||||
%% - Scan parameters: One-Parameter Scan
|
|
||||||
MOT2D.NumberOfAtoms = 10000;
|
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
|
||||||
CoolingBeam.Power = 0.4;
|
|
||||||
MOT2D.SidebandBeam = false;
|
|
||||||
MOT2D.PushBeam = false;
|
|
||||||
% ParameterArray = [10 20 30 40 50 60 70 80 90 100];
|
|
||||||
ParameterArray = [500 1000 1500 2000 2500 3000 3500 4000 4500 5000 5500 6000 6500 7000 7500 8000 8500 9000 9500];
|
|
||||||
NumberOfPointsForParam = length(ParameterArray); %iterations of the simulation
|
|
||||||
|
|
||||||
LoadingRateArray = zeros(1,NumberOfPointsForParam);
|
|
||||||
StandardErrorArray = zeros(1,NumberOfPointsForParam);
|
|
||||||
ConfidenceIntervalArray = zeros(NumberOfPointsForParam, 2);
|
|
||||||
tStart = tic;
|
|
||||||
for i=1:NumberOfPointsForParam
|
|
||||||
MOT2D.BootstrapSampleLength = ParameterArray(i);
|
|
||||||
[LoadingRateArray(i), StandardErrorArray(i), ConfidenceIntervalArray(i,:)] = MOT2D.runSimulation(Oven);
|
|
||||||
end
|
|
||||||
tEnd = toc(tStart);
|
|
||||||
fprintf('Total Computational Time: %0.1f seconds. \n', tEnd);
|
|
||||||
|
|
||||||
|
|
||||||
% - Plot results
|
|
||||||
|
|
||||||
OptionsStruct = struct;
|
|
||||||
OptionsStruct.RescalingFactorForParameter = 1;
|
|
||||||
OptionsStruct.XLabelString = 'Bootstrap Sample Length';
|
|
||||||
OptionsStruct.RescalingFactorForYQuantity = 1e-10;
|
|
||||||
OptionsStruct.ErrorsForYQuantity = true;
|
|
||||||
OptionsStruct.ErrorsArray = StandardErrorArray;
|
|
||||||
OptionsStruct.CIForYQuantity = true;
|
|
||||||
OptionsStruct.CIArray = ConfidenceIntervalArray;
|
|
||||||
OptionsStruct.RemoveOutliers = false;
|
|
||||||
OptionsStruct.YLabelString = 'Loading rate (x 10^{10} atoms/s)';
|
|
||||||
OptionsStruct.TitleString = sprintf('Cooling Beam Power = %d (mW); Magnetic Gradient = %.0f (G/cm)', CoolingBeam.Power*1000, MOT2D.MagneticGradient * 100);
|
|
||||||
|
|
||||||
options = Helper.convertstruct2cell(OptionsStruct);
|
|
||||||
|
|
||||||
Plotter.plotResultForOneParameterScan(ParameterArray, LoadingRateArray, options{:})
|
|
||||||
|
|
||||||
MeanLR = mean(LoadingRateArray(:)) * 1e-10;
|
|
||||||
|
|
||||||
yline(MeanLR, 'LineStyle', '--', 'Linewidth', 2.5)
|
|
||||||
textstring = [sprintf('%1.2e', MeanLR * 1e+10) ' atoms'];
|
|
||||||
% txt = text((ParameterArray(2) + 0.05*ParameterArray(2)), (max(MeanLR) + 0.05*MeanLR), textstring, 'Interpreter','latex', 'FontSize', 14);
|
|
||||||
|
|
||||||
% xlim([0 100])
|
|
||||||
ylim([0 3.5])
|
|
||||||
|
|
||||||
clear OptionsStruct
|
|
||||||
%% - Scan parameters: Two-Parameter Scan
|
%% - Scan parameters: Two-Parameter Scan
|
||||||
|
|
||||||
% COOLING BEAM POWER VS DETUNING
|
% COOLING BEAM POWER VS DETUNING
|
||||||
@ -223,12 +164,9 @@ Plotter.plotResultForTwoParameterScan(FirstParameterArray, SecondParameterArray,
|
|||||||
clear OptionsStruct
|
clear OptionsStruct
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%% COOLING BEAM WAIST VS DETUNING
|
% COOLING BEAM WAIST VS DETUNING
|
||||||
|
|
||||||
MOT2D.NumberOfAtoms = 20000;
|
MOT2D.NumberOfAtoms = 5000;
|
||||||
MOT2D.MagneticGradient = 0.38;
|
|
||||||
MOT2D.SidebandBeam = false;
|
|
||||||
MOT2D.PushBeam = false;
|
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
||||||
CoolingBeam.Power = 0.4;
|
CoolingBeam.Power = 0.4;
|
||||||
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
||||||
@ -262,18 +200,15 @@ clear OptionsStruct
|
|||||||
|
|
||||||
% COOLING BEAM WAIST VS DETUNING FOR DIFFERENT MAGNETIC FIELD GRADIENTS
|
% COOLING BEAM WAIST VS DETUNING FOR DIFFERENT MAGNETIC FIELD GRADIENTS
|
||||||
|
|
||||||
MOT2D.NumberOfAtoms = 10000;
|
MOT2D.NumberOfAtoms = 5000;
|
||||||
MOT2D.SidebandBeam = false;
|
|
||||||
MOT2D.PushBeam = false;
|
|
||||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
||||||
CoolingBeam.Power = 0.7;
|
CoolingBeam.Power = 0.4;
|
||||||
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
||||||
NumberOfPointsForSecondParam = 10;
|
NumberOfPointsForSecondParam = 10;
|
||||||
NumberOfPointsForThirdParam = 6;
|
NumberOfPointsForThirdParam = 6;
|
||||||
FirstParameterArray = linspace(-0.5, -2.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
|
FirstParameterArray = linspace(-0.5, -2.0, NumberOfPointsForFirstParam) * Helper.PhysicsConstants.BlueLinewidth;
|
||||||
SecondParameterArray = linspace(10, 25, NumberOfPointsForSecondParam) * 1e-03;
|
SecondParameterArray = linspace(10, 25, NumberOfPointsForSecondParam) * 1e-03;
|
||||||
ThirdParameterArray = linspace(30, 50, NumberOfPointsForThirdParam) * 1e-02;
|
ThirdParameterArray = linspace(30, 50, NumberOfPointsForThirdParam) * 1e-02;
|
||||||
MOT2D.BootstrapSampleLength = 500;
|
|
||||||
|
|
||||||
tStart = tic;
|
tStart = tic;
|
||||||
LoadingRateArray = Simulator.Scan.doThreeParameters(Oven, MOT2D, 'Blue', 'Detuning', FirstParameterArray, ...
|
LoadingRateArray = Simulator.Scan.doThreeParameters(Oven, MOT2D, 'Blue', 'Detuning', FirstParameterArray, ...
|
||||||
|
Loading…
Reference in New Issue
Block a user