Calculations/Dipolar Gas Simulator/+Scripts/test.m

45 lines
1.7 KiB
Mathematica
Raw Normal View History

2024-06-12 20:45:08 +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-13 02:02:44 +02:00
OptionsStruct.NumberOfAtoms = 1E6;
2024-06-13 11:30:12 +02:00
OptionsStruct.DipolarPolarAngle = pi/2;
OptionsStruct.DipolarAzimuthAngle = 0;
2024-06-13 02:02:44 +02:00
OptionsStruct.ScatteringLength = 86;
2024-06-17 20:24:00 +02:00
2024-06-13 02:02:44 +02:00
OptionsStruct.TrapFrequencies = [125, 125, 250];
2024-06-17 20:24:00 +02:00
OptionsStruct.TrapDepth = 5;
OptionsStruct.BoxSize = 15;
OptionsStruct.TrapPotentialType = 'Harmonic';
2024-06-13 11:30:12 +02:00
OptionsStruct.NumberOfGridPoints = [64, 64, 48];
2024-06-13 02:02:44 +02:00
OptionsStruct.Dimensions = [40, 40, 20];
2024-06-12 21:17:53 +02:00
OptionsStruct.CutoffType = 'Cylindrical';
2024-06-13 02:02:44 +02:00
OptionsStruct.SimulationMode = 'ImaginaryTimeEvolution'; % 'ImaginaryTimeEvolution' | 'RealTimeEvolution'
2024-06-17 20:24:00 +02:00
OptionsStruct.TimeStepSize = 50E-6; % in s
2024-06-18 13:44:30 +02:00
OptionsStruct.NumberOfTimeSteps = 100; % in s
2024-06-13 18:27:02 +02:00
OptionsStruct.EnergyTolerance = 5E-10;
2024-06-13 02:02:44 +02:00
OptionsStruct.JobNumber = 6;
2024-06-12 20:45:08 +02:00
OptionsStruct.SaveData = true;
OptionsStruct.SaveDirectory = './Data';
options = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct
2024-06-12 20:05:27 +02:00
2024-06-17 20:24:00 +02:00
sim = Simulator.DipolarGas(options{:});
pot = Simulator.Potentials(options{:});
sim.Potential = pot.trap(); % + pot.repulsive_chopstick();
2024-06-12 20:45:08 +02:00
%-% Run Simulation %-%
2024-06-17 20:24:00 +02:00
[Params, Transf, psi, V, VDk] = sim.run();
2024-06-12 20:05:27 +02:00
2024-06-13 11:30:12 +02:00
%% - Plot numerical grid
Plotter.visualizeSpace(Transf)
%% - Plot trap potential
2024-06-13 02:02:44 +02:00
Plotter.visualizeTrapPotential(V,Params,Transf)
2024-06-13 11:30:12 +02:00
%% - Plot initial wavefunction
Plotter.visualizeWavefunction(psi,Params,Transf)