diff --git a/MOT Capture Process Simulation/@MOTSimulator/calculateLoadingRate.m b/MOT Capture Process Simulation/@MOTSimulator/calculateLoadingRate.m index d40d249..89ba894 100644 --- a/MOT Capture Process Simulation/@MOTSimulator/calculateLoadingRate.m +++ b/MOT Capture Process Simulation/@MOTSimulator/calculateLoadingRate.m @@ -1,7 +1,8 @@ -function [LoadingRate, StandardError, ConfidenceInterval] = calculateLoadingRate(this, ParticleDynamicalQuantities) +function [LoadingRate, StandardError, ConfidenceInterval] = calculateLoadingRate(this) switch this.SimulationMode case "2D" n = this.NumberOfAtoms; + DynamicalQuantities = this.ParticleDynamicalQuantities; NumberOfTimeSteps = int64(this.SimulationTime/this.TimeStep); NumberOfLoadedAtoms = zeros(1, NumberOfTimeSteps); TimeCounts = zeros(1, n); @@ -9,7 +10,7 @@ function [LoadingRate, StandardError, ConfidenceInterval] = calculateLoadingRate % Include the stochastic process of background collisions for AtomIndex = 1:n - TimeCounts(AtomIndex) = this.computeTimeSpentInInteractionRegion(squeeze(ParticleDynamicalQuantities(AtomIndex,:,1:3))); + TimeCounts(AtomIndex) = this.computeTimeSpentInInteractionRegion(squeeze(DynamicalQuantities(AtomIndex,:,1:3))); end this.TimeSpentInInteractionRegion = mean(TimeCounts); for AtomIndex = 1:n @@ -22,8 +23,8 @@ function [LoadingRate, StandardError, ConfidenceInterval] = calculateLoadingRate NumberOfLoadedAtoms(TimeIndex) = NumberOfLoadedAtoms(TimeIndex-1); end for AtomIndex = 1:n - Position = squeeze(ParticleDynamicalQuantities(AtomIndex, TimeIndex, 1:3))'; - Velocity = squeeze(ParticleDynamicalQuantities(AtomIndex, TimeIndex, 4:6))'; + Position = squeeze(DynamicalQuantities(AtomIndex, TimeIndex, 1:3))'; + Velocity = squeeze(DynamicalQuantities(AtomIndex, TimeIndex, 4:6))'; if this.exitCondition(Position, Velocity, CollisionEvents(AtomIndex)) NumberOfLoadedAtoms(TimeIndex) = NumberOfLoadedAtoms(TimeIndex) + 1; end