%% Tilting of the dipoles
% Atom Number      = 1250 ppum
% System size      = [5 * l_rot, 5 * l_rot]

%% v_z = 500, theta = 0: a_s = 76.41

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 101250;     
OptionsStruct.DipolarPolarAngle       = 0;
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 76.41;        

OptionsStruct.TrapFrequencies         = [0, 0, 500];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [9, 9];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 1.2;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 0;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz500';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 500, theta = 15: a_s = 77.45

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 101250;     
OptionsStruct.DipolarPolarAngle       = deg2rad(15);
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 77.45;        

OptionsStruct.TrapFrequencies         = [0, 0, 500];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [9, 9];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 1.2;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 1;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz500';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 750, theta = 0: a_s = 70.5

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 61250;     
OptionsStruct.DipolarPolarAngle       = 0;
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 70.5;        

OptionsStruct.TrapFrequencies         = [0, 0, 750];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [7, 7];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 0.85;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 0;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz750';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 750, theta = 15: a_s = 72.5

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 61250;     
OptionsStruct.DipolarPolarAngle       = deg2rad(15);
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 72.5;        

OptionsStruct.TrapFrequencies         = [0, 0, 750];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [7, 7];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 0.85;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 1;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz750';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 1000, theta = 0: a_s = 65.95

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 45000;     
OptionsStruct.DipolarPolarAngle       = 0;
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 65.95;        

OptionsStruct.TrapFrequencies         = [0, 0, 1000];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [6, 6];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 0.7;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 0;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz1000';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 1000, theta = 15: a_s = 67.25

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 45000;     
OptionsStruct.DipolarPolarAngle       = deg2rad(15);
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 67.25;        

OptionsStruct.TrapFrequencies         = [0, 0, 1000];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [6, 6];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 0.7;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 1;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz1000';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 2000, theta = 0: a_s = 54.90

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 31250;     
OptionsStruct.DipolarPolarAngle       = 0;
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 54.90;        

OptionsStruct.TrapFrequencies         = [0, 0, 2000];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [5, 5];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 0.5;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 0;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz2000';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();

%% v_z = 2000, theta = 15: a_s = 55.5

OptionsStruct = struct;

OptionsStruct.NumberOfAtoms           = 31250;     
OptionsStruct.DipolarPolarAngle       = deg2rad(15);
OptionsStruct.DipolarAzimuthAngle     = 0;
OptionsStruct.ScatteringLength        = 55.5;        

OptionsStruct.TrapFrequencies         = [0, 0, 2000];
OptionsStruct.TrapPotentialType       = 'None';

OptionsStruct.NumberOfGridPoints      = [128, 128];
OptionsStruct.Dimensions              = [5, 5];      
OptionsStruct.TimeStepSize            = 0.005;           % in s
OptionsStruct.MinimumTimeStepSize     = 1E-5;            % in s
OptionsStruct.TimeCutOff              = 2E6;             % in s
OptionsStruct.EnergyTolerance         = 5E-10;
OptionsStruct.ResidualTolerance       = 1E-05;
OptionsStruct.NoiseScaleFactor        = 0.05;

OptionsStruct.MaxIterations           = 10;      
OptionsStruct.VariationalWidth        = 0.5;       
OptionsStruct.WidthLowerBound         = 0.01;
OptionsStruct.WidthUpperBound         = 12;
OptionsStruct.WidthCutoff             = 5e-3;

OptionsStruct.PlotLive                = false;
OptionsStruct.JobNumber               = 1;
OptionsStruct.RunOnGPU                = true;
OptionsStruct.SaveData                = true;
OptionsStruct.SaveDirectory           = './Results/Data_TiltingOfDipoles/AdjustedSystemSize/Hz2000';
options                               = Helper.convertstruct2cell(OptionsStruct);
clear OptionsStruct

solver                                = VariationalSolver2D.DipolarGas(options{:});
pot                                   = VariationalSolver2D.Potentials(options{:});
solver.Potential                      = pot.trap();

%-% Run Solver %-%
[Params, Transf, psi, V, VDk]         = solver.run();