diff --git a/MOT Capture Process Simulation/@MOTSimulator/runSimulation.m b/MOT Capture Process Simulation/@MOTSimulator/runSimulation.m index e3fdad4..3ff2a4d 100644 --- a/MOT Capture Process Simulation/@MOTSimulator/runSimulation.m +++ b/MOT Capture Process Simulation/@MOTSimulator/runSimulation.m @@ -2,24 +2,23 @@ function [LoadingRate, StandardError, ConfidenceInterval] = runSimulation(this) %% - Sampling for initial positions and velocities % - sampling the position distribution - this.InitialPositions = this.initialPositionSampling(); + Positions = this.initialPositionSampling(); % - sampling the velocity distribution - this.InitialVelocities = this.initialVelocitySampling(); + Velocities = this.initialVelocitySampling(); %% Solve ODE progressbar = Helper.parforNotifications(); progressbar.PB_start(this.NumberOfAtoms,'Message',['Simulating capture process for ' num2str(this.NumberOfAtoms,'%.0f') ' atoms:']); % calculate the final position of the atoms - ParticleDynamicalQuantities = zeros(this.NumberOfAtoms,int64(this.SimulationTime/this.TimeStep),6); - Positions = this.InitialPositions; - Velocities = this.InitialVelocities; + DynamicalQuantities = zeros(this.NumberOfAtoms,int64(this.SimulationTime/this.TimeStep),6); parfor Index = 1:this.NumberOfAtoms - ParticleDynamicalQuantities(Index,:, :) = this.solver(Positions(Index,:), Velocities(Index,:)); + DynamicalQuantities(Index,:, :) = this.solver(Positions(Index,:), Velocities(Index,:)); progressbar.PB_iterate(); end clear Index + this.ParticleDynamicalQuantities = DynamicalQuantities; %% Calculate the Loading Rate - [LoadingRate, StandardError, ConfidenceInterval] = this.calculateLoadingRate(ParticleDynamicalQuantities); + [LoadingRate, StandardError, ConfidenceInterval] = this.calculateLoadingRate(); end \ No newline at end of file