From c0e96006d75bceda63f5175130db557c8b87d1a4 Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Sat, 22 Jun 2024 23:36:13 +0200 Subject: [PATCH] Latest working version. --- Dipolar-Gas-Simulator/+Plotter/visualizeSpace.m | 14 +++++--------- Dipolar-Gas-Simulator/+Scripts/run_locally.m | 6 +++--- .../+Simulator/@DipolarGas/setupWavefunction.m | 2 +- .../+Simulator/@Potentials/setupParameters.m | 4 ++-- .../bwhpc_matlab_gpe_sim_gpu.slurm | 4 ++-- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Dipolar-Gas-Simulator/+Plotter/visualizeSpace.m b/Dipolar-Gas-Simulator/+Plotter/visualizeSpace.m index ac5646c..dfe5c4b 100644 --- a/Dipolar-Gas-Simulator/+Plotter/visualizeSpace.m +++ b/Dipolar-Gas-Simulator/+Plotter/visualizeSpace.m @@ -4,8 +4,6 @@ function visualizeSpace(Transf) y = Transf.y; z = Transf.z; - [X,Y] = meshgrid(x,y); - height = 20; width = 45; figure(1) @@ -15,13 +13,13 @@ function visualizeSpace(Transf) set(gcf, 'PaperPositionMode', 'auto') subplot(1,2,1) - zlin = ones(size(X, 1)) * z(1); % Generate z data + zlin = ones(size(y, 2), size(x, 2)) * z(1); % Generate z data mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface hold on for idx = 2:length(z) - zlin = ones(size(X, 1))* z(idx); % Generate z data - mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface + zlin = ones(size(y, 2), size(x, 2)) * z(idx); % Generate z data + mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface end % set the axes labels' properties @@ -54,15 +52,13 @@ function visualizeSpace(Transf) y = Transf.ky; z = Transf.kz; - [X,Y] = meshgrid(x,y); - subplot(1,2,2) - zlin = ones(size(X, 1)) * z(1); % Generate z data + zlin = ones(size(y, 2), size(x, 2)) * z(1); % Generate z data mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface hold on for idx = 2:length(z) - zlin = ones(size(X, 1))* z(idx); % Generate z data + zlin = ones(size(y, 2), size(x, 2)) * z(idx); % Generate z data mesh(x, y, zlin, 'EdgeColor','b') % Plot the surface end diff --git a/Dipolar-Gas-Simulator/+Scripts/run_locally.m b/Dipolar-Gas-Simulator/+Scripts/run_locally.m index 71b625b..cd55b4b 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_locally.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_locally.m @@ -9,14 +9,14 @@ OptionsStruct = struct; OptionsStruct.NumberOfAtoms = 1.24E5; OptionsStruct.DipolarPolarAngle = 0; OptionsStruct.DipolarAzimuthAngle = 0; -OptionsStruct.ScatteringLength = 86; +OptionsStruct.ScatteringLength = 90; OptionsStruct.TrapFrequencies = [44.97, 10.4, 126.3]; OptionsStruct.TrapDepth = 5; OptionsStruct.BoxSize = 15; OptionsStruct.TrapPotentialType = 'Harmonic'; -OptionsStruct.NumberOfGridPoints = [32, 64, 32]; +OptionsStruct.NumberOfGridPoints = [128, 256, 128]; OptionsStruct.Dimensions = [50, 120, 150]; OptionsStruct.CutoffType = 'Cylindrical'; OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution' @@ -42,7 +42,7 @@ sim.Potential = pot.trap(); % + pot.repulsive_chopstick(); %% - Plot numerical grid Plotter.visualizeSpace(Transf) %% - Plot trap potential -Plotter.visualizeTrapPotential(V,Params,Transf) +Plotter.visualizeTrapPotential(sim.Potential,Params,Transf) %% - Plot initial wavefunction Plotter.visualizeWavefunction(psi,Params,Transf) %% - Plot GS wavefunction diff --git a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupWavefunction.m b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupWavefunction.m index f4c73be..3d604a4 100644 --- a/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupWavefunction.m +++ b/Dipolar-Gas-Simulator/+Simulator/@DipolarGas/setupWavefunction.m @@ -6,7 +6,7 @@ function [psi] = setupWavefunction(~,Params,Transf) elly = sqrt(Params.hbar/(Params.m*Params.wy))/Params.l0; ellz = sqrt(Params.hbar/(Params.m*Params.wz))/Params.l0; - Rx = 8*ellx; Ry = 8*elly; Rz = 8*ellz; + Rx = 4*ellx; Ry = 4*elly; Rz = 4*ellz; X0 = 0.0*Transf.Xmax; Y0 = 0.0*Transf.Ymax; Z0 = 0*Transf.Zmax; psi = exp(-(X-X0).^2/Rx^2-(Y-Y0).^2/Ry^2-(Z-Z0).^2/Rz^2); diff --git a/Dipolar-Gas-Simulator/+Simulator/@Potentials/setupParameters.m b/Dipolar-Gas-Simulator/+Simulator/@Potentials/setupParameters.m index 0c4797a..c574d9b 100644 --- a/Dipolar-Gas-Simulator/+Simulator/@Potentials/setupParameters.m +++ b/Dipolar-Gas-Simulator/+Simulator/@Potentials/setupParameters.m @@ -23,8 +23,8 @@ function [Params] = setupParameters(this) Params.wz = 2*pi*this.TrapFrequencies(3); % Trap depth and box size for box potentials - Params.boxdepth = this.TrapDepth/(Params.wz/w0); % The depth of the box - Params.boxsize = this.BoxSize; % The size of the box + Params.boxdepth = this.TrapDepth; % The depth of the box + Params.boxsize = this.BoxSize; % The size of the box % ================ Parameters defined by those above ================ % diff --git a/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm b/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm index 902b020..e02ef1a 100644 --- a/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm +++ b/Dipolar-Gas-Simulator/bwhpc_matlab_gpe_sim_gpu.slurm @@ -4,11 +4,11 @@ #SBATCH --partition=single # Request number of nodes and GPU for job #SBATCH --nodes=1 -#SBATCH --ntasks-per-node=10 +#SBATCH --ntasks-per-node=1 #SBATCH --gres=gpu:4 #SBATCH --mem=24G # Estimated wallclock time for job -#SBATCH --time=12:00:00 +#SBATCH --time=72:00:00 #SBATCH --job-name=simulation #SBATCH --error=simulation.err #SBATCH --output=simulation.out