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.Dimensions = [100, 100];
|
||||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-05;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
OptionsStruct.NoiseScaleFactor = 4;
|
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||||
|
|
||||||
OptionsStruct.MaxIterations = 10;
|
OptionsStruct.MaxIterations = 10;
|
||||||
OptionsStruct.VariationalWidth = 5.0;
|
OptionsStruct.VariationalWidth = 5.0;
|
||||||
@ -137,23 +137,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
|||||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||||
OptionsStruct.ScatteringLength = 100.0289;
|
OptionsStruct.ScatteringLength = 100.0289;
|
||||||
|
|
||||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||||
OptionsStruct.TrapPotentialType = 'None';
|
OptionsStruct.TrapPotentialType = 'None';
|
||||||
|
|
||||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||||
OptionsStruct.Dimensions = [100, 100];
|
OptionsStruct.Dimensions = [100, 100];
|
||||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-04;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
OptionsStruct.NoiseScaleFactor = 4;
|
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||||
|
|
||||||
OptionsStruct.MaxIterations = 1;
|
OptionsStruct.MaxIterations = 10;
|
||||||
OptionsStruct.VariationalWidth = 5.5;
|
OptionsStruct.VariationalWidth = 5;
|
||||||
OptionsStruct.WidthLowerBound = 0.2;
|
OptionsStruct.WidthLowerBound = 1;
|
||||||
OptionsStruct.WidthUpperBound = 12;
|
OptionsStruct.WidthUpperBound = 12;
|
||||||
OptionsStruct.WidthCutoff = 1e-2;
|
OptionsStruct.WidthCutoff = 5e-3;
|
||||||
|
|
||||||
OptionsStruct.PlotLive = true;
|
OptionsStruct.PlotLive = true;
|
||||||
OptionsStruct.JobNumber = 1;
|
OptionsStruct.JobNumber = 1;
|
||||||
@ -179,23 +179,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
|||||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||||
OptionsStruct.ScatteringLength = 101.9903;
|
OptionsStruct.ScatteringLength = 101.9903;
|
||||||
|
|
||||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||||
OptionsStruct.TrapPotentialType = 'None';
|
OptionsStruct.TrapPotentialType = 'None';
|
||||||
|
|
||||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
OptionsStruct.NumberOfGridPoints = [128, 128];
|
||||||
OptionsStruct.Dimensions = [100, 100];
|
OptionsStruct.Dimensions = [100, 100];
|
||||||
OptionsStruct.TimeStepSize = 500E-6; % in s
|
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||||
OptionsStruct.TimeCutOff = 1E6; % in s
|
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-04;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
OptionsStruct.NoiseScaleFactor = 4;
|
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||||
|
|
||||||
OptionsStruct.MaxIterations = 1;
|
OptionsStruct.MaxIterations = 10;
|
||||||
OptionsStruct.VariationalWidth = 7.5;
|
OptionsStruct.VariationalWidth = 5;
|
||||||
OptionsStruct.WidthLowerBound = 0.2;
|
OptionsStruct.WidthLowerBound = 1;
|
||||||
OptionsStruct.WidthUpperBound = 12;
|
OptionsStruct.WidthUpperBound = 12;
|
||||||
OptionsStruct.WidthCutoff = 1e-2;
|
OptionsStruct.WidthCutoff = 5e-3;
|
||||||
|
|
||||||
OptionsStruct.PlotLive = true;
|
OptionsStruct.PlotLive = true;
|
||||||
OptionsStruct.JobNumber = 1;
|
OptionsStruct.JobNumber = 1;
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
% as = ((as/add)*Params.add)/Params.a0
|
% as = ((as/add)*Params.add)/Params.a0
|
||||||
% Critical point: 102.5133; Triangular phase: 98.0676; Stripe phase: 100.0289; Honeycomb phase: 101.9903
|
% Critical point: 102.5133; Triangular phase: 98.0676; Stripe phase: 100.0289; Honeycomb phase: 101.9903
|
||||||
|
|
||||||
%{
|
|
||||||
%% - Create Variational2D and Calculator object with specified options
|
%% - Create Variational2D and Calculator object with specified options
|
||||||
|
|
||||||
OptionsStruct = struct;
|
OptionsStruct = struct;
|
||||||
@ -20,23 +19,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
|||||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||||
OptionsStruct.ScatteringLength = 98.0676;
|
OptionsStruct.ScatteringLength = 98.0676;
|
||||||
|
|
||||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||||
OptionsStruct.TrapPotentialType = 'None';
|
OptionsStruct.TrapPotentialType = 'None';
|
||||||
|
|
||||||
OptionsStruct.NumberOfGridPoints = [256, 256];
|
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||||
OptionsStruct.Dimensions = [100, 100];
|
OptionsStruct.Dimensions = [100, 100];
|
||||||
OptionsStruct.TimeStepSize = 100E-6; % in s
|
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-04;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
OptionsStruct.NoiseScaleFactor = 4;
|
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||||
|
|
||||||
OptionsStruct.MaxIterations = 20;
|
OptionsStruct.MaxIterations = 10;
|
||||||
OptionsStruct.VariationalWidth = 4;
|
OptionsStruct.VariationalWidth = 5;
|
||||||
OptionsStruct.WidthLowerBound = 0.2;
|
OptionsStruct.WidthLowerBound = 1;
|
||||||
OptionsStruct.WidthUpperBound = 12;
|
OptionsStruct.WidthUpperBound = 12;
|
||||||
OptionsStruct.WidthCutoff = 1e-3;
|
OptionsStruct.WidthCutoff = 5e-3;
|
||||||
|
|
||||||
OptionsStruct.PlotLive = false;
|
OptionsStruct.PlotLive = false;
|
||||||
OptionsStruct.JobNumber = 1;
|
OptionsStruct.JobNumber = 1;
|
||||||
@ -62,23 +61,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
|||||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||||
OptionsStruct.ScatteringLength = 100.0289;
|
OptionsStruct.ScatteringLength = 100.0289;
|
||||||
|
|
||||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||||
OptionsStruct.TrapPotentialType = 'None';
|
OptionsStruct.TrapPotentialType = 'None';
|
||||||
|
|
||||||
OptionsStruct.NumberOfGridPoints = [128, 128];
|
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||||
OptionsStruct.Dimensions = [100, 100];
|
OptionsStruct.Dimensions = [100, 100];
|
||||||
OptionsStruct.TimeStepSize = 100E-6; % in s
|
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-04;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
OptionsStruct.NoiseScaleFactor = 4;
|
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||||
|
|
||||||
OptionsStruct.MaxIterations = 20;
|
OptionsStruct.MaxIterations = 10;
|
||||||
OptionsStruct.VariationalWidth = 5;
|
OptionsStruct.VariationalWidth = 5;
|
||||||
OptionsStruct.WidthLowerBound = 0.2;
|
OptionsStruct.WidthLowerBound = 1;
|
||||||
OptionsStruct.WidthUpperBound = 12;
|
OptionsStruct.WidthUpperBound = 12;
|
||||||
OptionsStruct.WidthCutoff = 1e-2;
|
OptionsStruct.WidthCutoff = 5e-3;
|
||||||
|
|
||||||
OptionsStruct.PlotLive = false;
|
OptionsStruct.PlotLive = false;
|
||||||
OptionsStruct.JobNumber = 2;
|
OptionsStruct.JobNumber = 2;
|
||||||
@ -104,23 +103,23 @@ OptionsStruct.DipolarPolarAngle = 0;
|
|||||||
OptionsStruct.DipolarAzimuthAngle = 0;
|
OptionsStruct.DipolarAzimuthAngle = 0;
|
||||||
OptionsStruct.ScatteringLength = 101.9903;
|
OptionsStruct.ScatteringLength = 101.9903;
|
||||||
|
|
||||||
OptionsStruct.TrapFrequencies = [10, 10, 72.4];
|
OptionsStruct.TrapFrequencies = [0, 0, 72.4];
|
||||||
OptionsStruct.TrapPotentialType = 'None';
|
OptionsStruct.TrapPotentialType = 'None';
|
||||||
|
|
||||||
OptionsStruct.NumberOfGridPoints = [256, 256];
|
OptionsStruct.NumberOfGridPoints = [256, 256];
|
||||||
OptionsStruct.Dimensions = [100, 100];
|
OptionsStruct.Dimensions = [100, 100];
|
||||||
OptionsStruct.TimeStepSize = 100E-6; % in s
|
OptionsStruct.TimeStepSize = 500E-6; % in s
|
||||||
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
OptionsStruct.MinimumTimeStepSize = 1E-5; % in s
|
||||||
OptionsStruct.TimeCutOff = 2E6; % in s
|
OptionsStruct.TimeCutOff = 2E6; % in s
|
||||||
OptionsStruct.EnergyTolerance = 5E-10;
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
OptionsStruct.ResidualTolerance = 1E-04;
|
OptionsStruct.ResidualTolerance = 1E-05;
|
||||||
OptionsStruct.NoiseScaleFactor = 4;
|
OptionsStruct.NoiseScaleFactor = 0.05;
|
||||||
|
|
||||||
OptionsStruct.MaxIterations = 20;
|
OptionsStruct.MaxIterations = 10;
|
||||||
OptionsStruct.VariationalWidth = 6.5;
|
OptionsStruct.VariationalWidth = 5;
|
||||||
OptionsStruct.WidthLowerBound = 0.2;
|
OptionsStruct.WidthLowerBound = 1;
|
||||||
OptionsStruct.WidthUpperBound = 30;
|
OptionsStruct.WidthUpperBound = 12;
|
||||||
OptionsStruct.WidthCutoff = 1e-3;
|
OptionsStruct.WidthCutoff = 5e-3;
|
||||||
|
|
||||||
OptionsStruct.PlotLive = false;
|
OptionsStruct.PlotLive = false;
|
||||||
OptionsStruct.JobNumber = 3;
|
OptionsStruct.JobNumber = 3;
|
||||||
@ -136,49 +135,10 @@ solver.Potential = pot.trap();
|
|||||||
|
|
||||||
%-% Run Solver %-%
|
%-% Run Solver %-%
|
||||||
[Params, Transf, psi, V, VDk] = solver.run();
|
[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
|
% Solve BdG equations
|
||||||
% Load data
|
% Load data
|
||||||
Data = load(sprintf(horzcat(solver.SaveDirectory, '/Run_%03i/psi_gs.mat'),solver.JobNumber),'psi','Transf','Params','VParams','V');
|
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 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');
|
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;
|
Qsq = QX.^2 + QY.^2;
|
||||||
absQ = sqrt(Qsq);
|
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
|
% Bare interaction
|
||||||
Fpar = -1 + 3*sqrt(pi)*QDsq.*erfcx(absQ)./absQ; % Scaled complementary error function erfcx(x) = e^(x^2) * erfc(x)
|
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;
|
Fpar(absQ == 0) = -1;
|
||||||
|
|
||||||
% Full DDI
|
% 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:
|
% Implementing a cutoff:
|
||||||
VDr = ifftn(VDk);
|
VDr = ifftn(VDk);
|
||||||
|
@ -114,7 +114,7 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
|
|
||||||
this.MaxIterations = p.Results.MaxIterations;
|
this.MaxIterations = p.Results.MaxIterations;
|
||||||
this.VariationalWidth = p.Results.VariationalWidth;
|
this.VariationalWidth = p.Results.VariationalWidth;
|
||||||
this.WidthLowerBound = p.Results.WidthUpperBound;
|
this.WidthLowerBound = p.Results.WidthLowerBound;
|
||||||
this.WidthUpperBound = p.Results.WidthUpperBound;
|
this.WidthUpperBound = p.Results.WidthUpperBound;
|
||||||
this.VariationalWidthTolerance = p.Results.VariationalWidthTolerance;
|
this.VariationalWidthTolerance = p.Results.VariationalWidthTolerance;
|
||||||
this.VariationalEnergyTolerance = p.Results.VariationalEnergyTolerance;
|
this.VariationalEnergyTolerance = p.Results.VariationalEnergyTolerance;
|
||||||
|
@ -24,8 +24,8 @@ function [Params] = setupParameters(this)
|
|||||||
Params.N = this.NumberOfAtoms;
|
Params.N = this.NumberOfAtoms;
|
||||||
|
|
||||||
% Dipole angle
|
% Dipole angle
|
||||||
Params.theta = this.DipolarPolarAngle; % pi/2 dipoles along x, theta=0 dipoles along z
|
Params.theta = this.DipolarPolarAngle; % pi/2 dipoles along X-axis, theta = 0 dipoles along Z-axis
|
||||||
Params.phi = this.DipolarAzimuthAngle;
|
Params.eta = this.DipolarAzimuthAngle; % tilt in to the X-Y plane away from the X-axis by this angle
|
||||||
|
|
||||||
% Dipole lengths (units of muB)
|
% Dipole lengths (units of muB)
|
||||||
Params.mu = CONSTANTS.DyMagneticMoment;
|
Params.mu = CONSTANTS.DyMagneticMoment;
|
||||||
|
Loading…
Reference in New Issue
Block a user