2021-07-14 20:23:00 +02:00
|
|
|
function [LoadingRate, StandardError, ConfidenceInterval] = runSimulation(this, ovenObj)
|
2021-06-29 15:44:28 +02:00
|
|
|
|
2021-07-11 14:46:19 +02:00
|
|
|
%% - Sampling for initial positions and velocities
|
2021-06-29 15:44:28 +02:00
|
|
|
% - sampling the position distribution
|
2021-07-14 20:23:00 +02:00
|
|
|
Positions = ovenObj.initialPositionSampling();
|
2021-06-29 15:44:28 +02:00
|
|
|
% - sampling the velocity distribution
|
2021-07-14 20:23:00 +02:00
|
|
|
Velocities = ovenObj.initialVelocitySampling(this);
|
2021-06-29 15:44:28 +02:00
|
|
|
|
|
|
|
%% Solve ODE
|
|
|
|
progressbar = Helper.parforNotifications();
|
2021-07-14 20:23:00 +02:00
|
|
|
progressbar.PB_start(this.NumberOfAtoms,'Message',['Simulating 2-D MOT capture process for ' num2str(this.NumberOfAtoms,'%.0f') ' atoms:']);
|
2021-06-29 15:44:28 +02:00
|
|
|
|
|
|
|
% calculate the final position of the atoms
|
2021-07-14 20:07:40 +02:00
|
|
|
DynamicalQuantities = zeros(this.NumberOfAtoms,int64(this.SimulationTime/this.TimeStep),6);
|
2021-07-11 14:46:19 +02:00
|
|
|
parfor Index = 1:this.NumberOfAtoms
|
2021-07-14 20:07:40 +02:00
|
|
|
DynamicalQuantities(Index,:, :) = this.solver(Positions(Index,:), Velocities(Index,:));
|
2021-06-29 15:44:28 +02:00
|
|
|
progressbar.PB_iterate();
|
|
|
|
end
|
|
|
|
clear Index
|
2021-07-14 20:07:40 +02:00
|
|
|
this.ParticleDynamicalQuantities = DynamicalQuantities;
|
2021-07-11 14:46:19 +02:00
|
|
|
|
2021-06-29 15:44:28 +02:00
|
|
|
%% Calculate the Loading Rate
|
2021-07-14 20:23:00 +02:00
|
|
|
[LoadingRate, StandardError, ConfidenceInterval] = this.calculateLoadingRate(ovenObj);
|
2021-06-29 15:44:28 +02:00
|
|
|
end
|