2024-11-15 22:09:15 +01:00
|
|
|
function VDk = calculateVDkWithCutoff(~, Transf, Params, VParams)
|
2024-11-13 18:36:50 +01:00
|
|
|
% == Calculating the DDI potential in Fourier space with appropriate cutoff == %
|
2024-11-15 22:09:15 +01:00
|
|
|
|
2024-11-13 18:36:50 +01:00
|
|
|
% Interaction in K space
|
2024-11-15 14:33:46 +01:00
|
|
|
QX = Transf.KX*VParams.ell/sqrt(2);
|
|
|
|
QY = Transf.KY*VParams.ell/sqrt(2);
|
2024-11-13 18:36:50 +01:00
|
|
|
|
|
|
|
Qsq = QX.^2 + QY.^2;
|
|
|
|
absQ = sqrt(Qsq);
|
2024-11-14 11:13:07 +01:00
|
|
|
QDsq = QX.^2*cos(Params.phi)^2 + QY.^2*sin(Params.phi)^2;
|
2024-11-13 18:36:50 +01:00
|
|
|
|
2024-11-14 11:13:07 +01:00
|
|
|
% Bare interaction
|
2024-11-18 13:25:09 +01:00
|
|
|
Fpar = -1 + 3*sqrt(pi)*QDsq.*erfcx(absQ)./absQ; % Scaled complementary error function erfcx(x) = e^(x^2) * erfc(x)
|
2024-11-13 18:36:50 +01:00
|
|
|
Fperp = 2 - 3*sqrt(pi).*absQ.*erfcx(absQ);
|
2024-11-14 11:13:07 +01:00
|
|
|
Fpar(absQ == 0) = -1;
|
2024-11-13 18:36:50 +01:00
|
|
|
|
2024-11-14 11:13:07 +01:00
|
|
|
% Full DDI
|
|
|
|
VDk = (Fpar*sin(Params.theta)^2 + Fperp*cos(Params.theta)^2);
|
2024-11-13 18:36:50 +01:00
|
|
|
|
2024-11-14 11:13:07 +01:00
|
|
|
% Implementing a cutoff:
|
2024-11-13 18:36:50 +01:00
|
|
|
VDr = ifftn(VDk);
|
|
|
|
VDr = fftshift(VDr);
|
2024-11-15 22:09:15 +01:00
|
|
|
rcut = min(Transf.Xmax,Transf.Ymax);
|
2024-11-13 18:36:50 +01:00
|
|
|
R = sqrt(Transf.X.^2+Transf.Y.^2) < 0.9*rcut;
|
|
|
|
VDr = VDr.*double(R);
|
|
|
|
VDr = ifftshift(VDr);
|
|
|
|
VDk = fftn(VDr);
|
|
|
|
|
|
|
|
end
|