Latest commit

This commit is contained in:
Karthik 2024-06-12 20:45:08 +02:00
parent 1d524f1f0b
commit 9d187540ad
4 changed files with 71 additions and 18 deletions

View 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

View File

@ -1,9 +1,26 @@
%-% Run Simulation %-%
clearvars
%% This script is testing the functionalities of the Dipolar Gas Simulator
%
% Important: Run only sectionwise!!
sim = DipolarGas();
calc = Calculator();
%% - Create Simulator, Potential and Calculator object with specified options
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);
%-% Plot %-%
%% - Plot results
Plotter.visualizeSpace(Transf)

View File

@ -1,7 +1,17 @@
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -9,13 +19,22 @@ classdef Calculator < handle & matlab.mixin.Copyable
methods
function this = Calculator(varargin)
this.OrderParameter = this.CalculatorDefaults.OrderParameter;
this.PhaseCoherence = this.CalculatorDefaults.PhaseCoherence;
this.CutoffType = this.CalculatorDefaults.CutoffType;
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

View File

@ -1,7 +1,13 @@
classdef Potentials < handle & matlab.mixin.Copyable
properties (Access = public)
properties (Access = private)
PotentialDefaults = struct('TrapFrequency', 100e3);
end
properties (Access = public)
TrapFrequency;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -9,13 +15,18 @@ classdef Potentials < handle & matlab.mixin.Copyable
methods
function this = Potentials(varargin)
this.TrapFrequency = this.PotentialDefaults.TrapFrequency;
end
end
methods
function restoreDefaults(this)
this.TrapFrequency = this.PotentialDefaults.TrapFrequency;
end
end % - setters and getters
end % - lifecycle
% methods
% end % - setters and getters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%- Methods