-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_script.m
More file actions
92 lines (57 loc) · 1.87 KB
/
Main_script.m
File metadata and controls
92 lines (57 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% Vortex comparison script. This creates a ground state for a given grid
% size, then stirs the trap to create vortices and saves the result with
% the grid size appeneded into the /Data directory
clear all
close
clc
% put in config info here, pass to ground state creator, get ground state
% back, pass to vortex stirer. Get stirred order parameter back, pass to
% counters, get times back, plot graph.
% Real space configuration
Points = 128;
Range = 150;
DeltaX = Range/Points;
x = linspace(-Range/2,Range/2 - DeltaX,Points);
[X,Y] = meshgrid(x,x);
% Potential configuration
r2 = X.^2 + Y.^2;
Thomas_Fermi = 20; % This number is an educated guess
Vtrap = 1/2 * r2 / Thomas_Fermi^2;
% Time step configuration
DeltaT = 0.001;
Time = 100;
Steps = floor(Time/DeltaT);
% K space configuration
dk = (2*pi)/Range;
kmax = (2*pi)/(DeltaX);
k = (-kmax/2:dk:kmax/2 -dk);
[Kx,Ky] = meshgrid(k,k);
k = sqrt(Kx.^2 + Ky.^2);
k = fftshift(k);
ksquareon2 = k.^2 /2;
% Stirring configuration
GaussianHalfWidth = 1;
Vstir = 3*exp(-((X -8).^2 +(Y).^2)/ GaussianHalfWidth^2);
V = Vtrap + Vstir;
velocity = 1;
CurrentTime = 0;
% Order Parameter configuration
density = 2 - V;
g = 1;
PSI = real(sqrt(density));
InitialNatoms = sum(sum(abs(PSI.^2))).*DeltaX.^2;
Energy = GPE_Energy_2D(PSI,k,g,V,DeltaT);
[PSI, Energy] = fGround_State_Creator(PSI,ksquareon2,g,V,DeltaT, ...
InitialNatoms, Points, Energy, DeltaX, k);
TrapEvolTime = ceil((2*pi)/((velocity*DeltaT)/8));
% Stir the pot
for ii = 1:TrapEvolTime;
% This uses the third oder Baker Hausdorff
PSI = Baker_Hausdorff_Oh3_2D(PSI,ksquareon2,g,V,DeltaT);
% Update the stirrer
CurrentTime = CurrentTime + DeltaT;
Vstir = 3*exp(-((X -8*cos((velocity*CurrentTime)/8)).^2 + ...
(Y - 8*sin((velocity*CurrentTime)/8)).^2)/ GaussianHalfWidth^2);
V = Vtrap + Vstir;
end
save(['./Data/Stirred_grid_' num2str(Points) '.mat'],'PSI');