diff --git a/MOT Capture Process Simulation/@MOTSimulator/calculateReducedClausingFactor.m b/MOT Capture Process Simulation/@MOTSimulator/calculateReducedClausingFactor.m new file mode 100644 index 0000000..e994c16 --- /dev/null +++ b/MOT Capture Process Simulation/@MOTSimulator/calculateReducedClausingFactor.m @@ -0,0 +1,17 @@ +function [ReducedClausingFactor, NormalizationConstantForAngularDistribution] = calculateReducedClausingFactor(this) + ThetaArray = linspace(0.0001, pi/2, 1000); + AngularDistribution = zeros(1,length(ThetaArray)); + parfor k = 1:length(ThetaArray) + AngularDistribution(k) = this.angularDistributionFunction(ThetaArray(k)); + end + + NormalizationConstantForAngularDistribution = max(2 * pi .* sin(ThetaArray) .* AngularDistribution); + + ReducedClausingFactor = 0; % We have to calculate the probability of an atom coming out of the oven subject to the physical constraint + parfor p = 1:length(ThetaArray) % that the angle of divergence is not more than the angle subtended at the mouth of the nozzle + if ThetaArray(p) <= this.NozzleExitDivergence + ReducedClausingFactor = ReducedClausingFactor + (2 * pi * sin(ThetaArray(p)) * AngularDistribution(p) * (ThetaArray(2)-ThetaArray(1))); + end + end + ReducedClausingFactor = ReducedClausingFactor / pi; +end \ No newline at end of file