From 869d2a405078dd395512a6432a3d4e477a502126 Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Tue, 19 Nov 2024 10:02:38 +0100 Subject: [PATCH] Tweaked parameters again and added exception handling for when the computed Vdk size is incommensurate with specified grid points. --- Dipolar-Gas-Simulator/+Scripts/run_locally.m | 9 +++++---- .../+VariationalSolver2D/@DipolarGas/initialize.m | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dipolar-Gas-Simulator/+Scripts/run_locally.m b/Dipolar-Gas-Simulator/+Scripts/run_locally.m index ea593e6..3eb7143 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_locally.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_locally.m @@ -60,9 +60,9 @@ OptionsStruct.ScatteringLength = 102.2518; % Critical point: 102.5 OptionsStruct.TrapFrequencies = [10, 10, 72.4]; OptionsStruct.TrapPotentialType = 'None'; -OptionsStruct.NumberOfGridPoints = [256, 256]; +OptionsStruct.NumberOfGridPoints = [128, 128]; OptionsStruct.Dimensions = [100, 100]; % Critical point: 6.996; Triangular phase: 7.5; Stripe phase: 6.972; Honeycomb phase: 6.239 for both for Atom Number fixed to 1E5 -OptionsStruct.TimeStepSize = 500E-6; % in s +OptionsStruct.TimeStepSize = 100E-6; % in s OptionsStruct.MinimumTimeStepSize = 1E-5; % in s OptionsStruct.TimeCutOff = 2E6; % in s OptionsStruct.EnergyTolerance = 5E-10; @@ -70,7 +70,7 @@ OptionsStruct.ResidualTolerance = 1E-04; OptionsStruct.NoiseScaleFactor = 4; OptionsStruct.MaxIterations = 20; -OptionsStruct.VariationalWidth = 4; +OptionsStruct.VariationalWidth = 5.7; OptionsStruct.WidthLowerBound = 0.2; OptionsStruct.WidthUpperBound = 12; OptionsStruct.WidthCutoff = 1e-2; @@ -97,4 +97,5 @@ solver.Potential = pot.trap(); %% - Plot initial wavefunction Plotter.visualizeWavefunction2D(psi,Params,Transf) %% - Plot GS wavefunction -Plotter.visualizeGSWavefunction2D(Params.njob) +% Plotter.visualizeGSWavefunction2D(Params.njob) +Plotter.visualizeGSWavefunction2D(1) diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m index 75a536b..d39f778 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/initialize.m @@ -8,6 +8,12 @@ function [psi,V,VDk] = initialize(this,Params,VParams,Transf) if isfile(strcat(this.SaveDirectory, '/VDk_M.mat')) VDk = load(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat'))); VDk = VDk.VDk; + VDkSize = size(VDk); + if VDkSize(1) ~= Params.Nx && VDkSize(2) ~= Params.Ny + VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams); + save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk'); + fprintf('Saved VDk incomensurate with specified grid points: Computed and saved DDI potential for new grid size in Fourier space with cutoff.\n') + end else VDk = this.Calculator.calculateVDkWithCutoff(Transf, Params, VParams); save(sprintf(strcat(this.SaveDirectory, '/VDk_M.mat')),'VDk');