From b59d7c4ebddb7c39a2dbed22a680340e1b196d85 Mon Sep 17 00:00:00 2001 From: Matthieu Schaller <matthieu.schaller@durham.ac.uk> Date: Tue, 1 Aug 2017 14:30:46 +0100 Subject: [PATCH] Correct expression for Gadget-2's long-range force truncation scheme. --- theory/Multipoles/plot_mesh.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/theory/Multipoles/plot_mesh.py b/theory/Multipoles/plot_mesh.py index 6706016f73..42d91ab239 100644 --- a/theory/Multipoles/plot_mesh.py +++ b/theory/Multipoles/plot_mesh.py @@ -52,7 +52,7 @@ colors=['#4477AA', '#CC6677', '#DDCC77', '#117733'] # Parameters r_s = 2. -r_min = 1e-2 +r_min = 3e-2 r_max = 1.5e2 # Radius @@ -95,7 +95,7 @@ def swift_corr(x): # Correction in real space corr_short_gadget2 = special.erf(r / (2.*r_s)) corr_short_swift = swift_corr(r / (2.*r_s)) -eta_short_gadget2 = special.erfc(r / 2.*r_s) + (r / (r_s * math.sqrt(math.pi))) * exp(-r**2 / (4.*r_s**2)) +eta_short_gadget2 = special.erfc(r / (2.*r_s)) + (r / (r_s * math.sqrt(math.pi))) * exp(-r**2 / (4.*r_s**2)) eta_short_swift = 4. * (r / r_s) * d_sigmoid(2. * r / r_s) - 2. * sigmoid(2 * r / r_s) + 2. # Corection in Fourier space @@ -161,7 +161,7 @@ ylim(3e-3, 1.5) #ylabel("$1 - \\chi_s(r)$", labelpad=-2) ylabel("$1 - \\varphi_s(r) \\times r$", labelpad=-2) yticks([1e-2, 1e-1, 1], ["$0.01$", "$0.1$", "$1$"]) -xlabel("$r / r_s$", labelpad=-3) +xlabel("$r / r_s$", labelpad=1) savefig("potential_short.pdf") @@ -212,7 +212,7 @@ ylim(3e-3, 1.5) #ylabel("$1 - \\eta_s(r)$", labelpad=-2) ylabel("$1 - |\\mathbf{f}_s(r)|\\times r^2$", labelpad=-3) yticks([1e-2, 1e-1, 1], ["$0.01$", "$0.1$", "$1$"]) -xlabel("$r / r_s$", labelpad=-3) +xlabel("$r / r_s$", labelpad=1) savefig("force_short.pdf") @@ -262,6 +262,6 @@ ylim(3e-3, 1.5) ylabel("$1 - k^2 \\times \\tilde{\\varphi_l}(k)$", labelpad=-3) yticks([1e-2, 1e-1, 1], ["$0.01$", "$0.1$", "$1$"]) -xlabel("$k \\times r_s$", labelpad=0) +xlabel("$k \\times r_s$", labelpad=1) savefig("potential_long.pdf") -- GitLab