diff --git a/Dipolar-Gas-Simulator/+Plotter/plotLive2D.m b/Dipolar-Gas-Simulator/+Plotter/plotLive2D.m index 1e339f4..d9cafa1 100644 --- a/Dipolar-Gas-Simulator/+Plotter/plotLive2D.m +++ b/Dipolar-Gas-Simulator/+Plotter/plotLive2D.m @@ -1,4 +1,4 @@ -function plotLive2D(psi, Params, Transf, Observ) +function plotLive2D(psi, Params, Transf, Observ, vrun) set(0,'defaulttextInterpreter','latex') set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex'); @@ -14,9 +14,10 @@ function plotLive2D(psi, Params, Transf, Observ) % Plotting figure(1); + set(gcf, 'Name', ['Variational Run: ', num2str(vrun)]) set(gcf,'Position', [100, 100, 1600, 900]) clf - + % Plot |psi(x,y)|^2 (density in x and y plane) ax1 = subplot('Position', [0.05, 0.55, 0.28, 0.4]); plotxy = pcolor(x,y,nxyScaled'); @@ -46,7 +47,6 @@ function plotLive2D(psi, Params, Transf, Observ) xlabel('$x$ [$\mu$m]', 'FontSize', 14); ylabel('$y$ [$\mu$m]', 'FontSize', 14); title('Im$\{\Psi_{xy}\}$', 'FontSize', 14); - % Plot residual (time steps vs -log10(residual)) subplot('Position', [0.05, 0.05, 0.26, 0.4]); plot(-log10(Observ.residual), '-b') diff --git a/Dipolar-Gas-Simulator/+Scripts/run_locally.m b/Dipolar-Gas-Simulator/+Scripts/run_locally.m index 5b818c8..f88b3c0 100644 --- a/Dipolar-Gas-Simulator/+Scripts/run_locally.m +++ b/Dipolar-Gas-Simulator/+Scripts/run_locally.m @@ -60,10 +60,10 @@ OptionsStruct.ScatteringLength = 98.0676; % Critical point: 102.515; OptionsStruct.TrapFrequencies = [10, 10, 72.4]; OptionsStruct.TrapPotentialType = 'None'; -OptionsStruct.NumberOfGridPoints = [256, 256]; +OptionsStruct.NumberOfGridPoints = [128, 128]; OptionsStruct.Dimensions = [7.5, 7.5]; % 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 = 200E-6; % in s -OptionsStruct.TimeCutOff = 100; % in s +OptionsStruct.TimeStepSize = 500E-6; % in s +OptionsStruct.TimeCutOff = 1E4; % in s OptionsStruct.EnergyTolerance = 5E-10; OptionsStruct.ResidualTolerance = 1E-05; diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/propagateWavefunction.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/propagateWavefunction.m index 10ad1f9..d02fcb8 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/propagateWavefunction.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/propagateWavefunction.m @@ -1,4 +1,4 @@ -function [psi, Observ] = propagateWavefunction(this, psi, Params, VParams, Transf, VDk, V, t_idx, Observ) +function [psi, Observ] = propagateWavefunction(this, psi, Params, VParams, Transf, VDk, V, t_idx, Observ, vrun) set(0,'defaulttextInterpreter','latex') set(groot, 'defaultAxesTickLabelInterpreter','latex'); set(groot, 'defaultLegendInterpreter','latex'); @@ -23,7 +23,7 @@ function [psi, Observ] = propagateWavefunction(this, psi, Params, VParams, Trans Observ.residual = [Observ.residual res]; if this.PlotLive - Plotter.plotLive2D(psi,Params,Transf,Observ) + Plotter.plotLive2D(psi,Params,Transf,Observ,vrun) drawnow end @@ -61,7 +61,7 @@ function [psi, Observ] = propagateWavefunction(this, psi, Params, VParams, Trans muchem = this.Calculator.calculateChemicalPotential(psi,Params,VParams,Transf,VDk,V); %Plotting loop - if mod(t_idx,500) == 0 + if mod(t_idx,250) == 0 % Change in Energy E = this.Calculator.calculateTotalEnergy(psi,Params,VParams,Transf,VDk,V); @@ -78,7 +78,7 @@ function [psi, Observ] = propagateWavefunction(this, psi, Params, VParams, Trans % Plotting if this.PlotLive - Plotter.plotLive2D(psi,Params,Transf,Observ) + Plotter.plotLive2D(psi,Params,Transf,Observ,vrun) drawnow end % diff --git a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/run.m b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/run.m index 0e64e1a..be697ab 100644 --- a/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/run.m +++ b/Dipolar-Gas-Simulator/+VariationalSolver2D/@DipolarGas/run.m @@ -48,7 +48,7 @@ function [Params, Transf, psi, V, VDk] = run(this) psi = psi + 0.25*noise; % --- Run --- - [psi, Observ] = this.propagateWavefunction(psi, Params, VParams, Transf, VDk, V, t_idx, Observ); + [psi, Observ] = this.propagateWavefunction(psi, Params, VParams, Transf, VDk, V, t_idx, Observ, nn); psi = gather(psi); % --- Constrained minimization ---