Latest working version - fixed issue of bounds not being properly defined for fmincon.
This commit is contained in:
parent
e767baf3ca
commit
0889d1178b
@ -76,10 +76,10 @@ OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-05;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||
|
||||
OptionsStruct.MaxIterations = 10;
|
||||
OptionsStruct.VariationalWidth = 5.0;
|
||||
@ -137,23 +137,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||
OptionsStruct.ScatteringLength = 100.0289;
|
||||
|
||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||
OptionsStruct.TrapPotentialType = 'None';
|
||||
|
||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-04;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
OptionsStruct.ResidualTolerance = 1E-05;
|
||||
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||
|
||||
OptionsStruct.MaxIterations = 1;
|
||||
OptionsStruct.VariationalWidth = 5.5;
|
||||
OptionsStruct.WidthLowerBound = 0.2;
|
||||
OptionsStruct.MaxIterations = 10;
|
||||
OptionsStruct.VariationalWidth = 5;
|
||||
OptionsStruct.WidthLowerBound = 1;
|
||||
OptionsStruct.WidthUpperBound = 12;
|
||||
OptionsStruct.WidthCutoff = 1e-2;
|
||||
OptionsStruct.WidthCutoff = 5e-3;
|
||||
|
||||
OptionsStruct.PlotLive = true;
|
||||
OptionsStruct.JobNumber = 1;
|
||||
@ -179,23 +179,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||
OptionsStruct.ScatteringLength = 101.9903;
|
||||
|
||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||
OptionsStruct.TrapPotentialType = 'None';
|
||||
|
||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-04;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
OptionsStruct.ResidualTolerance = 1E-05;
|
||||
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||
|
||||
OptionsStruct.MaxIterations = 1;
|
||||
OptionsStruct.VariationalWidth = 7.5;
|
||||
OptionsStruct.WidthLowerBound = 0.2;
|
||||
OptionsStruct.MaxIterations = 10;
|
||||
OptionsStruct.VariationalWidth = 5;
|
||||
OptionsStruct.WidthLowerBound = 1;
|
||||
OptionsStruct.WidthUpperBound = 12;
|
||||
OptionsStruct.WidthCutoff = 1e-2;
|
||||
OptionsStruct.WidthCutoff = 5e-3;
|
||||
|
||||
OptionsStruct.PlotLive = true;
|
||||
OptionsStruct.JobNumber = 1;
|
||||
|
@ -10,7 +10,6 @@
|
||||
% as = ((as/add)*Params.add)/Params.a0
|
||||
% Critical point: 102.5133; Triangular phase: 98.0676; Stripe phase: 100.0289; Honeycomb phase: 101.9903
|
||||
|
||||
%{
|
||||
%% - Create Variational2D and Calculator object with specified options
|
||||
|
||||
OptionsStruct = struct;
|
||||
@ -20,23 +19,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||
OptionsStruct.ScatteringLength = 98.0676;
|
||||
|
||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||
OptionsStruct.TrapPotentialType = 'None';
|
||||
|
||||
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 100E-6; % in s
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-04;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
OptionsStruct.ResidualTolerance = 1E-05;
|
||||
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||
|
||||
OptionsStruct.MaxIterations = 20;
|
||||
OptionsStruct.VariationalWidth = 4;
|
||||
OptionsStruct.WidthLowerBound = 0.2;
|
||||
OptionsStruct.MaxIterations = 10;
|
||||
OptionsStruct.VariationalWidth = 5;
|
||||
OptionsStruct.WidthLowerBound = 1;
|
||||
OptionsStruct.WidthUpperBound = 12;
|
||||
OptionsStruct.WidthCutoff = 1e-3;
|
||||
OptionsStruct.WidthCutoff = 5e-3;
|
||||
|
||||
OptionsStruct.PlotLive = false;
|
||||
OptionsStruct.JobNumber = 1;
|
||||
@ -62,23 +61,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||
OptionsStruct.ScatteringLength = 100.0289;
|
||||
|
||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||
OptionsStruct.TrapPotentialType = 'None';
|
||||
|
||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 100E-6; % in s
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-04;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
OptionsStruct.ResidualTolerance = 1E-05;
|
||||
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||
|
||||
OptionsStruct.MaxIterations = 20;
|
||||
OptionsStruct.MaxIterations = 10;
|
||||
OptionsStruct.VariationalWidth = 5;
|
||||
OptionsStruct.WidthLowerBound = 0.2;
|
||||
OptionsStruct.WidthLowerBound = 1;
|
||||
OptionsStruct.WidthUpperBound = 12;
|
||||
OptionsStruct.WidthCutoff = 1e-2;
|
||||
OptionsStruct.WidthCutoff = 5e-3;
|
||||
|
||||
OptionsStruct.PlotLive = false;
|
||||
OptionsStruct.JobNumber = 2;
|
||||
@ -104,23 +103,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||
OptionsStruct.ScatteringLength = 101.9903;
|
||||
|
||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||
OptionsStruct.TrapPotentialType = 'None';
|
||||
|
||||
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 100E-6; % in s
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-04;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
OptionsStruct.ResidualTolerance = 1E-05;
|
||||
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||
|
||||
OptionsStruct.MaxIterations = 20;
|
||||
OptionsStruct.VariationalWidth = 6.5;
|
||||
OptionsStruct.WidthLowerBound = 0.2;
|
||||
OptionsStruct.WidthUpperBound = 30;
|
||||
OptionsStruct.WidthCutoff = 1e-3;
|
||||
OptionsStruct.MaxIterations = 10;
|
||||
OptionsStruct.VariationalWidth = 5;
|
||||
OptionsStruct.WidthLowerBound = 1;
|
||||
OptionsStruct.WidthUpperBound = 12;
|
||||
OptionsStruct.WidthCutoff = 5e-3;
|
||||
|
||||
OptionsStruct.PlotLive = false;
|
||||
OptionsStruct.JobNumber = 3;
|
||||
@ -136,49 +135,10 @@ solver.Potential = pot.trap();
|
||||
|
||||
%-% Run Solver %-%
|
||||
[Params, Transf, psi, V, VDk] = solver.run();
|
||||
%}
|
||||
%% - Create Variational2D and Calculator object with specified options
|
||||
|
||||
OptionsStruct = struct;
|
||||
|
||||
OptionsStruct.NumberOfAtoms = 2.0030e+07;
|
||||
OptionsStruct.DipolarPolarAngle = 0;
|
||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||
OptionsStruct.ScatteringLength = 98.0676;
|
||||
|
||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
||||
OptionsStruct.TrapPotentialType = 'None';
|
||||
|
||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||
OptionsStruct.Dimensions = [100, 100];
|
||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
||||
OptionsStruct.EnergyTolerance = 5E-10;
|
||||
OptionsStruct.ResidualTolerance = 1E-04;
|
||||
OptionsStruct.NoiseScaleFactor = 4;
|
||||
|
||||
OptionsStruct.MaxIterations = 1;
|
||||
OptionsStruct.VariationalWidth = 5.0;
|
||||
OptionsStruct.WidthLowerBound = 0.2;
|
||||
OptionsStruct.WidthUpperBound = 12;
|
||||
OptionsStruct.WidthCutoff = 1e-2;
|
||||
|
||||
OptionsStruct.PlotLive = false;
|
||||
OptionsStruct.JobNumber = 1;
|
||||
OptionsStruct.RunOnGPU = true;
|
||||
OptionsStruct.SaveData = true;
|
||||
OptionsStruct.SaveDirectory = './Data_TriangularPhase';
|
||||
options = Helper.convertstruct2cell(OptionsStruct);
|
||||
clear OptionsStruct
|
||||
|
||||
solver = VariationalSolver2D.DipolarGas(options{:});
|
||||
pot = VariationalSolver2D.Potentials(options{:});
|
||||
solver.Potential = pot.trap();
|
||||
|
||||
%-% Run Solver %-%
|
||||
[Params, Transf, psi, V, VDk] = solver.run();
|
||||
%%
|
||||
|
||||
%{
|
||||
% Solve BdG equations
|
||||
% Load data
|
||||
Data = load(sprintf(horzcat(solver.SaveDirectory, '/Run_%03i/psi_gs.mat'),solver.JobNumber),'psi','Transf','Params','VParams','V');
|
||||
@ -204,3 +164,4 @@ muchem = solver.Calculator.calculateChemicalPotential(psi,Params,VParams,Transf,
|
||||
|
||||
% Save the eigenvalues and eigenvectors to a .mat file
|
||||
save(sprintf(strcat(solver.SaveDirectory, '/Run_%03i/bdg_eigen_data.mat'),solver.JobNumber), 'evals', 'modes', '-v7.3');
|
||||
%}
|
@ -7,7 +7,7 @@ function VDk = calculateVDkWithCutoff(~, Transf, Params, ell)
|
||||
|
||||
Qsq = QX.^2 + QY.^2;
|
||||
absQ = sqrt(Qsq);
|
||||
QDsq = QX.^2*cos(Params.phi)^2 + QY.^2*sin(Params.phi)^2;
|
||||
QDsq = QX.^2*cos(Params.eta)^2 + QY.^2*sin(Params.eta)^2;
|
||||
|
||||
% Bare interaction
|
||||
Fpar = -1 + 3*sqrt(pi)*QDsq.*erfcx(absQ)./absQ; % Scaled complementary error function erfcx(x) = e^(x^2) * erfc(x)
|
||||
@ -15,7 +15,7 @@ function VDk = calculateVDkWithCutoff(~, Transf, Params, ell)
|
||||
Fpar(absQ == 0) = -1;
|
||||
|
||||
% Full DDI
|
||||
VDk = (Fpar*sin(Params.theta)^2 + Fperp*cos(Params.theta)^2);
|
||||
VDk = Fpar*sin(Params.theta)^2 + Fperp*cos(Params.theta)^2;
|
||||
|
||||
% Implementing a cutoff:
|
||||
VDr = ifftn(VDk);
|
||||
|
@ -114,7 +114,7 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
||||
|
||||
this.MaxIterations = p.Results.MaxIterations;
|
||||
this.VariationalWidth = p.Results.VariationalWidth;
|
||||
this.WidthLowerBound = p.Results.WidthUpperBound;
|
||||
this.WidthLowerBound = p.Results.WidthLowerBound;
|
||||
this.WidthUpperBound = p.Results.WidthUpperBound;
|
||||
this.VariationalWidthTolerance = p.Results.VariationalWidthTolerance;
|
||||
this.VariationalEnergyTolerance = p.Results.VariationalEnergyTolerance;
|
||||
|
@ -24,8 +24,8 @@ function [Params] = setupParameters(this)
|
||||
Params.N = this.NumberOfAtoms;
|
||||
|
||||
% Dipole angle
|
||||
Params.theta = this.DipolarPolarAngle; % pi/2 dipoles along x, theta=0 dipoles along z
|
||||
Params.phi = this.DipolarAzimuthAngle;
|
||||
Params.theta = this.DipolarPolarAngle; % pi/2 dipoles along X-axis, theta = 0 dipoles along Z-axis
|
||||
Params.eta = this.DipolarAzimuthAngle; % tilt in to the X-Y plane away from the X-axis by this angle
|
||||
|
||||
% Dipole lengths (units of muB)
|
||||
Params.mu = CONSTANTS.DyMagneticMoment;
|
||||
@ -72,8 +72,8 @@ function [Params] = setupParameters(this)
|
||||
|
||||
% Dipole lengths
|
||||
Params.add = mu0*Params.mu^2*Params.m/(12*pi*hbar^2);
|
||||
Params.ppum2 = Params.N/(Params.Lx*Params.Ly*(l0*1e6)^2);% Particles per squared micron
|
||||
Params.ppadd2 = Params.ppum2*(Params.add*1e6)^2; % Particles per squared add
|
||||
Params.ppum2 = Params.N/(Params.Lx*Params.Ly*(l0*1e6)^2); % Particles per squared micron
|
||||
Params.ppadd2 = Params.ppum2*(Params.add*1e6)^2; % Particles per squared add
|
||||
|
||||
% DDI strength
|
||||
Params.gdd = 4*pi*Params.add/l0; % sometimes the 12 is a 4 --> depends on how Vdk (DDI) is defined
|
||||
|
Loading…
Reference in New Issue
Block a user