GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
velField.m
Go to the documentation of this file.
1 function [] = velField(wfc0,dx,m,incr,x,y,normed, lims)
2 %velField calculates velocity field of wavefunction
3 % velField plots the magnitude and direction of the velocity field of the
4 % given wavefunction wfc0 in 2D.
5 % dx is the increment along x, and assumes dx==dy
6 % m is the mass of the atomic species
7 % incr is the increment over which to calculate field direction. Too low
8 % and it may be very dense, too high and very sparse. Start at 1, and
9 % increase until happy
10 % x,y are the grid spacings along the x and y axis
11 % normed specifies whether to normalise the vector directions. 1 if yes,
12 % 0 otherwise
13 % lims is [xMin xMax yMin yMax]. Hides the edge garbage. Otherwise, []
14 
15 phase= angle(wfc0);
16 np1=unwrap(phase,[],1);
17 np2=unwrap(phase,[],2);
18 
19 [velnp1x,velnp1y] = gradient(np1,dx,dx);
20 [velnp2x,velnp2y] = gradient(np2,dx,dx);
21 
22 hbar=1.05457e-34;
23 v_y = (hbar/m)*(velnp1y);
24 v_x = (hbar/m)*(velnp2x);
25 
26 valsx=[1:incr:size(wfc0,1)];%[200:1:300];
28 
29 %
30 if normed==1
31  L=sqrt(v_x(valsy,valsx).^2 + v_y(valsy,valsx).^2);
32 else
33  L=1;
34 end
35 
36 imagesc(y(valsx),x(valsy),sqrt(v_x(valsy,valsx).^2+v_y(valsy,valsx).^2));hold on
37 
38 q = quiver(y(valsx),x(valsy),v_x(valsy,valsx)./L,v_y(valsy,valsx)./L,'AutoScaleFactor',0.5,'Color','w');axis square;
39 hold off;
40 
41 set(gca,'TickLabelInterpreter', 'latex');
42 set(gca,'DefaultTextInterpreter','Latex')
43 set(gca,'FontName','Latin Modern Roman','FontSize',30);
44 xlabel('$x$ (m)');ylabel('$y$ (m)');
45 h=colorbar;set(h,'TickLabelInterpreter','latex')
46 ylabel(h,'|V| (m/s)')
47 
48 if length(lims~=0)
49  axis(lims);
50 end
axis square
Definition: velField.m:38
valsx
Definition: velField.m:26
tuple dy
Definition: en.py:60
end imagesc(y(valsx), x(valsy), sqrt(v_x(valsy, valsx).^ 2+v_y(valsy, valsx).^ 2))
hold off
Definition: velField.m:39
and assumes dx
Definition: velField.m:5
v_y
Definition: velField.m:23
and assumes too high and very sparse Start and % increase until happy % y are the grid spacings along the x and y axis % normed specifies whether to normalise the vector directions if % otherwise % lims is [xMin xMax yMin yMax] Hides the edge garbage phase
Definition: velField.m:15
colorbar
Definition: quKineticSpec.m:55
and print the results to file Essentially wraps % voronoi2dCellColour and saves the resulting plots
Definition: VtxCorr.m:1
hold on q
Definition: velField.m:38
np2
Definition: velField.m:17
% Used for determining interaction strength of system % % Constants required for simulation m
Definition: GPE_2d.m:13
h
Definition: velField.m:45
% if normed
Definition: velField.m:30
end if sqrt(sum([x(ii), y(ii)].^ 2))< radius %% ignore edges if(length(DT.vertexAttachments
hbar
Definition: velField.m:22
else L
Definition: velField.m:33
and assumes too high and very sparse Start at
Definition: velField.m:5
and assumes too high and very sparse Start and % increase until happy % x
Definition: velField.m:5
np1
Definition: velField.m:16
ylabel(' $y$(m)')
valsy
Definition: velField.m:27
% axis([1e4 1e7 5e-18 1e-10])
v_x
Definition: velField.m:24
% If at least one of the indices is
and assumes too high and very sparse Start and % increase until happy % y are the grid spacings along the x and y axis % normed specifies whether to normalise the vector directions if yes
Definition: velField.m:5
hold on
and assumes too high and very sparse Start and % increase until happy % y are the grid spacings along the x and y axis % normed specifies whether to normalise the vector directions if % otherwise % lims is [xMin xMax yMin yMax] Hides the edge garbage Otherwise
Definition: velField.m:5
Latin Modern xlabel(' $x$(m)')
incr
Definition: en.py:57
tuple mass
Definition: observables.py:72
length
Definition: vort.py:75