Latest commit
This commit is contained in:
parent
1d524f1f0b
commit
9d187540ad
6
Dipolar Gas Simulator/+Helper/convertstruct2cell.m
Normal file
6
Dipolar Gas Simulator/+Helper/convertstruct2cell.m
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
function CellOut = convertstruct2cell(StructIn)
|
||||||
|
% CellOut = Convertstruct2cell(StructIn)
|
||||||
|
% converts a struct into a cell-matrix where the first column contains
|
||||||
|
% the fieldnames and the second the contents
|
||||||
|
CellOut = [fieldnames(StructIn) struct2cell(StructIn)]';
|
||||||
|
end
|
@ -1,9 +1,26 @@
|
|||||||
%-% Run Simulation %-%
|
%% This script is testing the functionalities of the Dipolar Gas Simulator
|
||||||
clearvars
|
%
|
||||||
|
% Important: Run only sectionwise!!
|
||||||
|
|
||||||
sim = DipolarGas();
|
%% - Create Simulator, Potential and Calculator object with specified options
|
||||||
calc = Calculator();
|
|
||||||
|
OptionsStruct = struct;
|
||||||
|
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
|
||||||
|
OptionsStruct.ErrorEstimationMethod = 'bootstrap'; % 'jackknife' | 'bootstrap'
|
||||||
|
OptionsStruct.NumberOfAtoms = 5000;
|
||||||
|
OptionsStruct.TimeStep = 50e-06; % in s
|
||||||
|
OptionsStruct.SimulationTime = 4e-03; % in s
|
||||||
|
OptionsStruct.CutoffType = true;
|
||||||
|
OptionsStruct.SaveData = true;
|
||||||
|
OptionsStruct.SaveDirectory = './Data';
|
||||||
|
options = Helper.convertstruct2cell(OptionsStruct);
|
||||||
|
clear OptionsStruct
|
||||||
|
|
||||||
|
sim = Simulator.DipolarGas(options{:});
|
||||||
|
calc = Simulator.Calculator(options{:});
|
||||||
|
|
||||||
|
%-% Run Simulation %-%
|
||||||
[Params, Transf, psi, V, VDk] = sim.runSimulation(calc);
|
[Params, Transf, psi, V, VDk] = sim.runSimulation(calc);
|
||||||
|
|
||||||
%-% Plot %-%
|
%% - Plot results
|
||||||
Plotter.visualizeSpace(Transf)
|
Plotter.visualizeSpace(Transf)
|
@ -1,7 +1,17 @@
|
|||||||
classdef Calculator < handle & matlab.mixin.Copyable
|
classdef Calculator < handle & matlab.mixin.Copyable
|
||||||
|
|
||||||
properties (Access = public)
|
properties (Access = private)
|
||||||
|
|
||||||
|
CalculatorDefaults = struct('OrderParameter', 1, ...
|
||||||
|
'PhaseCoherence', 1, ...
|
||||||
|
'CutoffType', 'Cylindrical');
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
properties (Access = public)
|
||||||
|
OrderParameter;
|
||||||
|
PhaseCoherence;
|
||||||
|
CutoffType;
|
||||||
end
|
end
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
@ -9,13 +19,22 @@ classdef Calculator < handle & matlab.mixin.Copyable
|
|||||||
|
|
||||||
methods
|
methods
|
||||||
function this = Calculator(varargin)
|
function this = Calculator(varargin)
|
||||||
|
this.OrderParameter = this.CalculatorDefaults.OrderParameter;
|
||||||
|
this.PhaseCoherence = this.CalculatorDefaults.PhaseCoherence;
|
||||||
|
this.CutoffType = this.CalculatorDefaults.CutoffType;
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
methods
|
function restoreDefaults(this)
|
||||||
|
this.OrderParameter = this.PotentialDefaults.OrderParameter;
|
||||||
|
this.PhaseCoherence = this.CalculatorDefaults.PhaseCoherence;
|
||||||
|
this.CutoffType = this.CalculatorDefaults.CutoffType;
|
||||||
|
end
|
||||||
|
|
||||||
end % - setters and getters
|
end % - lifecycle
|
||||||
|
|
||||||
|
% methods
|
||||||
|
|
||||||
|
% end % - setters and getters
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%- Methods
|
%- Methods
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
classdef Potentials < handle & matlab.mixin.Copyable
|
classdef Potentials < handle & matlab.mixin.Copyable
|
||||||
|
|
||||||
properties (Access = public)
|
properties (Access = private)
|
||||||
|
|
||||||
|
PotentialDefaults = struct('TrapFrequency', 100e3);
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
properties (Access = public)
|
||||||
|
TrapFrequency;
|
||||||
end
|
end
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
@ -9,13 +15,18 @@ classdef Potentials < handle & matlab.mixin.Copyable
|
|||||||
|
|
||||||
methods
|
methods
|
||||||
function this = Potentials(varargin)
|
function this = Potentials(varargin)
|
||||||
|
this.TrapFrequency = this.PotentialDefaults.TrapFrequency;
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
methods
|
function restoreDefaults(this)
|
||||||
|
this.TrapFrequency = this.PotentialDefaults.TrapFrequency;
|
||||||
|
end
|
||||||
|
|
||||||
end % - setters and getters
|
end % - lifecycle
|
||||||
|
|
||||||
|
% methods
|
||||||
|
|
||||||
|
% end % - setters and getters
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%- Methods
|
%- Methods
|
||||||
|
Loading…
Reference in New Issue
Block a user