diff --git a/MOT Capture Process Simulation/@MOTSimulator/MOTSimulator.m b/MOT Capture Process Simulation/@MOTSimulator/MOTSimulator.m index 479859d..ed27b99 100644 --- a/MOT Capture Process Simulation/@MOTSimulator/MOTSimulator.m +++ b/MOT Capture Process Simulation/@MOTSimulator/MOTSimulator.m @@ -6,8 +6,7 @@ classdef MOTSimulator < handle & matlab.mixin.Copyable SimulationTime; NumberOfAtoms; - InitialPositions; - InitialVelocities; + ParticleDynamicalQuantities; NozzleLength; NozzleRadius; @@ -188,17 +187,11 @@ classdef MOTSimulator < handle & matlab.mixin.Copyable ret = this.NumberOfAtoms; end - function set.InitialPositions(this,val) - this.InitialPositions = val; + function set.ParticleDynamicalQuantities(this,val) + this.ParticleDynamicalQuantities = val; end - function ret = get.InitialPositions(this) - ret = this.InitialPositions; - end - function set.InitialVelocities(this,val) - this.InitialVelocities = val; - end - function ret = get.InitialVelocities(this) - ret = this.InitialVelocities; + function ret = get.ParticleDynamicalQuantities(this) + ret = this.ParticleDynamicalQuantities; end function set.NozzleLength(this,val) @@ -603,7 +596,7 @@ classdef MOTSimulator < handle & matlab.mixin.Copyable function ret = get.AverageVelocity(this) %See Background collision probability section in Barbiero - ret = sqrt((8*Helper.PhysicsConstants.BoltzmannConstant*this.OvenTemperatureinKelvin)/ (pi*Helper.PhysicsConstants.Dy164Mass)); + ret = sqrt((8 * pi *Helper.PhysicsConstants.BoltzmannConstant*this.OvenTemperatureinKelvin)/ (9 * Helper.PhysicsConstants.Dy164Mass)); end function ret = get.AtomicBeamDensity(this) @@ -624,6 +617,8 @@ classdef MOTSimulator < handle & matlab.mixin.Copyable end % - getters for dependent properties + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + methods(Access = protected) function cp = copyElement(this) % Shallow copy object @@ -642,4 +637,18 @@ classdef MOTSimulator < handle & matlab.mixin.Copyable end end + methods (Static) + + % Creates an Instance of Class, ensures singleton behaviour (that there + % can only be one Instance of this class + function singleObj = getInstance(varargin) + % Creates an Instance of Class, ensures singleton behaviour + persistent localObj; + if isempty(localObj) || ~isvalid(localObj) + localObj = MOTSimulator(varargin{:}); + end + singleObj = localObj; + end + end + end