Latest working version
This commit is contained in:
parent
cfe15aa13d
commit
570995f3f5
@ -17,8 +17,9 @@ OptionsStruct.CutoffType = 'Cylindrical';
|
|||||||
OptionsStruct.TrapPotentialType = 'Harmonic';
|
OptionsStruct.TrapPotentialType = 'Harmonic';
|
||||||
|
|
||||||
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
|
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
|
||||||
OptionsStruct.TimeStep = 50e-06; % in s
|
OptionsStruct.TimeStep = 50E-6; % in s
|
||||||
OptionsStruct.SimulationTime = 4e-03; % in s
|
OptionsStruct.SimulationTime = 2E6; % in s
|
||||||
|
OptionsStruct.EnergyTolerance = 5E-10;
|
||||||
|
|
||||||
OptionsStruct.SaveData = true;
|
OptionsStruct.SaveData = true;
|
||||||
OptionsStruct.SaveDirectory = './Data';
|
OptionsStruct.SaveDirectory = './Data';
|
||||||
|
@ -12,6 +12,8 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
SimulationMode;
|
SimulationMode;
|
||||||
TimeStep;
|
TimeStep;
|
||||||
SimulationTime;
|
SimulationTime;
|
||||||
|
EnergyTolerance;
|
||||||
|
MinimumTimeStep;
|
||||||
|
|
||||||
%Flags
|
%Flags
|
||||||
|
|
||||||
@ -46,7 +48,11 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
@(x) any(strcmpi(x,{'ImaginaryTimeEvolution','RealTimeEvolution'})));
|
@(x) any(strcmpi(x,{'ImaginaryTimeEvolution','RealTimeEvolution'})));
|
||||||
addParameter(p, 'TimeStep', 5E-4,...
|
addParameter(p, 'TimeStep', 5E-4,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'SimulationTime', 3,...
|
addParameter(p, 'SimulationTime', 2e6,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'EnergyTolerance', 1e-10,...
|
||||||
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
|
addParameter(p, 'MinimumTimeStep', 1e-6,...
|
||||||
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
@(x) assert(isnumeric(x) && isscalar(x) && (x > 0)));
|
||||||
addParameter(p, 'DebugMode', false,...
|
addParameter(p, 'DebugMode', false,...
|
||||||
@islogical);
|
@islogical);
|
||||||
@ -68,6 +74,8 @@ classdef DipolarGas < handle & matlab.mixin.Copyable
|
|||||||
this.SimulationMode = p.Results.SimulationMode;
|
this.SimulationMode = p.Results.SimulationMode;
|
||||||
this.TimeStep = p.Results.TimeStep;
|
this.TimeStep = p.Results.TimeStep;
|
||||||
this.SimulationTime = p.Results.SimulationTime;
|
this.SimulationTime = p.Results.SimulationTime;
|
||||||
|
this.EnergyTolerance = p.Results.EnergyTolerance;
|
||||||
|
this.MinimumTimeStep = p.Results.MinimumTimeStep;
|
||||||
|
|
||||||
this.DebugMode = p.Results.DebugMode;
|
this.DebugMode = p.Results.DebugMode;
|
||||||
this.DoSave = p.Results.SaveData;
|
this.DoSave = p.Results.SaveData;
|
||||||
|
@ -46,11 +46,10 @@ Params.wz = 2*pi*this.TrapFrequencies(3);
|
|||||||
Params.gamma_S = 7.5*10^(-3); % gamma for the stochastic GPE
|
Params.gamma_S = 7.5*10^(-3); % gamma for the stochastic GPE
|
||||||
Params.muchem = 12.64*Params.wz/w0; % fixing the chemical potential for the stochastic GPE
|
Params.muchem = 12.64*Params.wz/w0; % fixing the chemical potential for the stochastic GPE
|
||||||
|
|
||||||
Params.Etol = 5e-10; % Tolerances
|
Params.Etol = this.EnergyTolerance; % Tolerances
|
||||||
Params.rtol = 1e-5;
|
Params.cut_off = this.SimulationTime; % sometimes the imaginary time gets a little stuck
|
||||||
Params.cut_off = 2e6; % sometimes the imaginary time gets a little stuck
|
|
||||||
% even though the solution is good, this just stops it going on forever
|
% even though the solution is good, this just stops it going on forever
|
||||||
Params.mindt = 1e-6; % Minimum size for a time step using adaptive dt
|
Params.mindt = this.MinimumTimeStep; % Minimum size for a time step using adaptive dt
|
||||||
|
|
||||||
% ================ Parameters defined by those above ================ %
|
% ================ Parameters defined by those above ================ %
|
||||||
|
|
||||||
@ -83,6 +82,11 @@ end
|
|||||||
Params.gammaQF = 128/3*sqrt(pi*(Params.as/l0)^5)*Q5;
|
Params.gammaQF = 128/3*sqrt(pi*(Params.as/l0)^5)*Q5;
|
||||||
|
|
||||||
% Loading the rest into Params
|
% Loading the rest into Params
|
||||||
Params.hbar = hbar; Params.kbol = kbol; Params.mu0 = mu0; Params.muB = muB; Params.a0 = a0;
|
Params.hbar = hbar;
|
||||||
Params.w0 = w0; Params.l0 = l0;
|
Params.kbol = kbol;
|
||||||
|
Params.mu0 = mu0;
|
||||||
|
Params.muB = muB;
|
||||||
|
Params.a0 = a0;
|
||||||
|
Params.w0 = w0;
|
||||||
|
Params.l0 = l0;
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user