Minor changes to scripting style.
This commit is contained in:
parent
c19a514027
commit
27fe40068e
@ -6,6 +6,7 @@
|
||||
% - Create MOTCaptureProcess object with specified options
|
||||
% - Automatically creates Beams objects
|
||||
OptionsStruct = struct;
|
||||
OptionsStruct.ErrorEstimationMethod = 'bootstrap'; % 'jackknife' | 'bootstrap'
|
||||
OptionsStruct.NumberOfAtoms = 10000;
|
||||
OptionsStruct.TimeStep = 50e-06; % in s
|
||||
OptionsStruct.SimulationTime = 4e-03; % in s
|
||||
@ -24,12 +25,8 @@ MOT2D = Simulator.TwoDimensionalMOT(options{:});
|
||||
Beams = MOT2D.Beams;
|
||||
|
||||
%% - Run Simulation
|
||||
% poolobj = gcp('nocreate'); % Check if pool is open
|
||||
% if isempty(poolobj)
|
||||
% parpool;
|
||||
% end
|
||||
MOT2D.NumberOfAtoms = 5000;
|
||||
MOT2D.Sideband = false;
|
||||
MOT2D.SidebandBeam = false;
|
||||
CoolingBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'Blue'), Beams)};
|
||||
CoolingBeam.Power = 0.4;
|
||||
CoolingBeam.Waist = 13.3e-03;
|
||||
@ -73,7 +70,7 @@ Plotter.plotAngularDistributionForDifferentBeta(Oven, Beta)
|
||||
Plotter.plotCaptureVelocityVsAngle(Oven, MOT2D); % Takes a long time to plot!
|
||||
|
||||
%% - Plot Phase Space with Acceleration Field
|
||||
MOT2D.Sideband = false;
|
||||
MOT2D.SidebandBeam = false;
|
||||
MOT2D.NumberOfAtoms = 50;
|
||||
MinimumVelocity = 0;
|
||||
MaximumVelocity = 150;
|
||||
@ -128,13 +125,13 @@ QuantityOfInterestArray = LoadingRateArray;
|
||||
OptionsStruct = struct;
|
||||
OptionsStruct.RescalingFactorForParameter = 1000;
|
||||
OptionsStruct.XLabelString = 'Cooling Beam Power (mW)';
|
||||
OptionsStruct.RescalingFactorForYQuantity = 1e-11;
|
||||
OptionsStruct.RescalingFactorForYQuantity = 1e-10;
|
||||
OptionsStruct.ErrorsForYQuantity = true;
|
||||
OptionsStruct.ErrorsArray = StandardErrorArray;
|
||||
OptionsStruct.CIForYQuantity = true;
|
||||
OptionsStruct.CIArray = ConfidenceIntervalArray;
|
||||
OptionsStruct.RemoveOutliers = true;
|
||||
OptionsStruct.YLabelString = 'Loading rate (x 10^{11} atoms/s)';
|
||||
OptionsStruct.YLabelString = 'Loading rate (x 10^{10} atoms/s)';
|
||||
OptionsStruct.TitleString = sprintf('Magnetic Gradient = %.0f (G/cm)', MOT2D.MagneticGradient * 100);
|
||||
|
||||
options = Helper.convertstruct2cell(OptionsStruct);
|
||||
@ -143,11 +140,24 @@ Plotter.plotResultForOneParameterScan(ParameterArray, QuantityOfInterestArray, o
|
||||
|
||||
clear OptionsStruct
|
||||
|
||||
if MOT2D.DoSave
|
||||
LoadingRate = struct;
|
||||
LoadingRate.Values = LoadingRateArray;
|
||||
LoadingRate.Errors = StandardErrorArray;
|
||||
LoadingRate.CI = ConfidenceIntervalArray;
|
||||
MOT2D.Results = LoadingRate;
|
||||
SaveFolder = [MOT2D.SaveDirectory filesep 'Results'];
|
||||
Filename = ['OneParameterScan_' datestr(now,'yyyymmdd_HHMM')];
|
||||
eval([sprintf('%s_Object', Filename) ' = MOT2D;']);
|
||||
mkdir(SaveFolder);
|
||||
save([SaveFolder filesep Filename], sprintf('%s_Object', Filename));
|
||||
end
|
||||
|
||||
%% - Scan parameters: Two-Parameter Scan
|
||||
|
||||
MOT2D.NumberOfAtoms = 50;
|
||||
MOT2D.TotalPower = 0.6;
|
||||
MOT2D.Sideband = false;
|
||||
MOT2D.SidebandBeam = false;
|
||||
SidebandBeam = Beams{cellfun(@(x) strcmpi(x.Alias, 'BlueSideband'), Beams)};
|
||||
|
||||
NumberOfPointsForFirstParam = 10; %iterations of the simulation
|
||||
@ -197,3 +207,16 @@ options = Helper.convertstruct2cell(
|
||||
Plotter.plotResultForTwoParameterScan(FirstParameterArray, SecondParameterArray, QuantityOfInterestArray, options{:})
|
||||
|
||||
clear OptionsStruct
|
||||
|
||||
if MOT2D.DoSave
|
||||
LoadingRate = struct;
|
||||
LoadingRate.Values = LoadingRateArray;
|
||||
LoadingRate.Errors = StandardErrorArray;
|
||||
LoadingRate.CI = ConfidenceIntervalArray;
|
||||
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
|
Loading…
Reference in New Issue
Block a user