From 47a93001c839a930275e1a427d23d4aac0d49668 Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Sun, 11 Jul 2021 06:36:49 +0200 Subject: [PATCH] Added a switch to change between 2D and 3D MOT cases to allow for this code to be expanded and generalized in the future. --- .../@MOTSimulator/initialPositionSampling.m | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/MOT Capture Process Simulation/@MOTSimulator/initialPositionSampling.m b/MOT Capture Process Simulation/@MOTSimulator/initialPositionSampling.m index 85af394..197912f 100644 --- a/MOT Capture Process Simulation/@MOTSimulator/initialPositionSampling.m +++ b/MOT Capture Process Simulation/@MOTSimulator/initialPositionSampling.m @@ -1,7 +1,12 @@ function ret = initialPositionSampling(this) - n = this.NumberOfAtoms; - phi = 2 * pi * rand(n,1); - rho = this.Beta * 0.5 * this.NozzleLength * sqrt(rand(n,1)); - ret = [-this.OvenDistance * ones(n,1), rho.*cos(phi), rho.*sin(phi)]; + switch this.SimulationMode + case "2D" + n = this.NumberOfAtoms; + phi = 2 * pi * rand(n,1); + rho = this.Beta * 0.5 * this.NozzleLength * sqrt(rand(n,1)); + ret = [-this.OvenDistance * ones(n,1), rho.*cos(phi), rho.*sin(phi)]; + case "3D" + % Development In progress + end end