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 %-%
|
||||
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 %-%
|
||||
Plotter.visualizeSpace(Transf)
|
||||
%% - Plot results
|
||||
Plotter.visualizeSpace(Transf)
|
@ -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
|
||||
|
||||
end % - setters and getters
|
||||
function restoreDefaults(this)
|
||||
this.OrderParameter = this.PotentialDefaults.OrderParameter;
|
||||
this.PhaseCoherence = this.CalculatorDefaults.PhaseCoherence;
|
||||
this.CutoffType = this.CalculatorDefaults.CutoffType;
|
||||
end
|
||||
|
||||
end % - lifecycle
|
||||
|
||||
% methods
|
||||
|
||||
% end % - setters and getters
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%- Methods
|
||||
|
@ -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
|
||||
|
||||
end % - setters and getters
|
||||
function restoreDefaults(this)
|
||||
this.TrapFrequency = this.PotentialDefaults.TrapFrequency;
|
||||
end
|
||||
|
||||
end % - lifecycle
|
||||
|
||||
% methods
|
||||
|
||||
% end % - setters and getters
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%- Methods
|
||||
|
Loading…
Reference in New Issue
Block a user