Cosmetic changes only.

This commit is contained in:
Karthik 2021-07-14 20:07:40 +02:00
parent 039b1c36ec
commit b5f9a1b44a

View File

@ -2,24 +2,23 @@ function [LoadingRate, StandardError, ConfidenceInterval] = runSimulation(this)
%% - Sampling for initial positions and velocities %% - Sampling for initial positions and velocities
% - sampling the position distribution % - sampling the position distribution
this.InitialPositions = this.initialPositionSampling(); Positions = this.initialPositionSampling();
% - sampling the velocity distribution % - sampling the velocity distribution
this.InitialVelocities = this.initialVelocitySampling(); Velocities = this.initialVelocitySampling();
%% Solve ODE %% Solve ODE
progressbar = Helper.parforNotifications(); progressbar = Helper.parforNotifications();
progressbar.PB_start(this.NumberOfAtoms,'Message',['Simulating capture process for ' num2str(this.NumberOfAtoms,'%.0f') ' atoms:']); progressbar.PB_start(this.NumberOfAtoms,'Message',['Simulating capture process for ' num2str(this.NumberOfAtoms,'%.0f') ' atoms:']);
% calculate the final position of the atoms % calculate the final position of the atoms
ParticleDynamicalQuantities = zeros(this.NumberOfAtoms,int64(this.SimulationTime/this.TimeStep),6); DynamicalQuantities = zeros(this.NumberOfAtoms,int64(this.SimulationTime/this.TimeStep),6);
Positions = this.InitialPositions;
Velocities = this.InitialVelocities;
parfor Index = 1:this.NumberOfAtoms parfor Index = 1:this.NumberOfAtoms
ParticleDynamicalQuantities(Index,:, :) = this.solver(Positions(Index,:), Velocities(Index,:)); DynamicalQuantities(Index,:, :) = this.solver(Positions(Index,:), Velocities(Index,:));
progressbar.PB_iterate(); progressbar.PB_iterate();
end end
clear Index clear Index
this.ParticleDynamicalQuantities = DynamicalQuantities;
%% Calculate the Loading Rate %% Calculate the Loading Rate
[LoadingRate, StandardError, ConfidenceInterval] = this.calculateLoadingRate(ParticleDynamicalQuantities); [LoadingRate, StandardError, ConfidenceInterval] = this.calculateLoadingRate();
end end