Calculations/Dipolar-Gas-Simulator/+Scripts/run_locally.m

88 lines
3.3 KiB
Mathematica
Raw Normal View History

2024-06-18 19:01:35 +02:00
%% This script is testing the functionalities of the Dipolar Gas Simulator
%
% Important: Run only sectionwise!!
%% - Create Simulator, Potential and Calculator object with specified options
OptionsStruct = struct;
2024-06-20 13:15:56 +02:00
OptionsStruct.NumberOfAtoms = 1.24E5;
OptionsStruct.DipolarPolarAngle = 0;
2024-06-18 19:01:35 +02:00
OptionsStruct.DipolarAzimuthAngle = 0;
2024-06-22 23:36:13 +02:00
OptionsStruct.ScatteringLength = 90;
2024-06-18 19:01:35 +02:00
2024-06-20 13:15:56 +02:00
OptionsStruct.TrapFrequencies = [44.97, 10.4, 126.3];
2024-06-18 19:01:35 +02:00
OptionsStruct.TrapDepth = 5;
OptionsStruct.BoxSize = 15;
OptionsStruct.TrapPotentialType = 'Harmonic';
2024-06-22 23:36:13 +02:00
OptionsStruct.NumberOfGridPoints = [128, 256, 128];
2024-06-20 13:15:56 +02:00
OptionsStruct.Dimensions = [50, 120, 150];
2024-06-18 19:01:35 +02:00
OptionsStruct.CutoffType = 'Cylindrical';
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
2024-06-20 13:15:56 +02:00
OptionsStruct.TimeStepSize = 500E-6; % in s
OptionsStruct.NumberOfTimeSteps = 100; % in s
2024-06-18 19:01:35 +02:00
OptionsStruct.EnergyTolerance = 5E-10;
2024-06-20 12:16:42 +02:00
OptionsStruct.ResidualTolerance = 1E-05;
2024-06-18 19:01:35 +02:00
OptionsStruct.JobNumber = 1;
2024-06-20 13:15:56 +02:00
OptionsStruct.RunOnGPU = false;
2024-06-18 19:01:35 +02:00
OptionsStruct.SaveData = true;
OptionsStruct.SaveDirectory = './Data';
options = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct
sim = Simulator.DipolarGas(options{:});
pot = Simulator.Potentials(options{:});
sim.Potential = pot.trap(); % + pot.repulsive_chopstick();
2024-06-18 19:01:35 +02:00
%-% Run Simulation %-%
[Params, Transf, psi, V, VDk] = sim.run();
2024-06-18 19:01:35 +02:00
%% - Plot numerical grid
Plotter.visualizeSpace(Transf)
%% - Plot trap potential
Plotter.visualizeTrapPotential(sim.Potential,Params,Transf)
%% - Plot initial wavefunction
Plotter.visualizeWavefunction(psi,Params,Transf)
%% - Plot GS wavefunction
Plotter.visualizeGSWavefunction(Params.njob)
%% - Create Variational2D and Calculator object with specified options
OptionsStruct = struct;
OptionsStruct.NumberOfAtoms = 1.24E5;
OptionsStruct.DipolarPolarAngle = 0;
OptionsStruct.DipolarAzimuthAngle = 0;
OptionsStruct.ScatteringLength = 90;
OptionsStruct.TrapFrequencies = [44.97, 10.4, 126.3];
OptionsStruct.NumberOfGridPoints = [50, 50];
OptionsStruct.Dimensions = [100, 100];
OptionsStruct.TimeStepSize = 1E-3; % in s
OptionsStruct.TimeCutOff = 2E6; % in s
OptionsStruct.EnergyTolerance = 5E-10;
OptionsStruct.ResidualTolerance = 1E-04;
OptionsStruct.JobNumber = 1;
OptionsStruct.RunOnGPU = false;
OptionsStruct.SaveData = true;
OptionsStruct.SaveDirectory = './Data';
options = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct
solver = Variational2D.DipolarGas(options{:});
%-% Run Solver %-%
[Params, Transf, psi, V, VDk] = solver.run();
2024-06-18 19:01:35 +02:00
%% - Plot numerical grid
Plotter.visualizeSpace2D(Transf)
2024-06-18 19:01:35 +02:00
%% - Plot initial wavefunction
Plotter.visualizeWavefunction2D(psi,Params,Transf)
2024-06-20 12:16:42 +02:00
%% - Plot GS wavefunction
Plotter.visualizeGSWavefunction2D(Params.njob)