From 161adb15af8d10ccf6090a43a4c89b0d05c6ecda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20M=C3=BCller?= Date: Sat, 28 May 2022 16:16:52 +0200 Subject: Add introduction, integrand plot and reason why shifting evalutaion of gamma-func --- buch/papers/laguerre/scripts/integrand.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'buch/papers/laguerre/scripts/integrand.py') diff --git a/buch/papers/laguerre/scripts/integrand.py b/buch/papers/laguerre/scripts/integrand.py index 89b9256..43fc1bf 100644 --- a/buch/papers/laguerre/scripts/integrand.py +++ b/buch/papers/laguerre/scripts/integrand.py @@ -16,19 +16,33 @@ img_path = f"{root}/../images" os.makedirs(img_path, exist_ok=True) t = np.logspace(*xlims, 1001)[:, None] -z = np.arange(-5, 5)[None] + 0.5 - +z = np.array([-4.5, -2, -1, -0.5, 0.0, 0.5, 1, 2, 4.5]) r = t ** z fig, ax = plt.subplots(num=1, clear=True, constrained_layout=True, figsize=(6, 4)) ax.semilogx(t, r) -ax.set_xlim(*(10.**xlims)) +ax.set_xlim(*(10.0 ** xlims)) ax.set_ylim(1e-3, 40) ax.set_xlabel(r"$t$") ax.set_ylabel(r"$t^z$") ax.grid(1, "both") labels = [f"$z={zi:.1f}$" for zi in np.squeeze(z)] ax.legend(labels, ncol=2, loc="upper left") -fig.savefig(f"{img_path}/integrands.pdf") -# plt.show() +fig.savefig(f"{img_path}/integrands.pgf") + +z2 = np.array([-1, -0.5, 0.0, 0.5, 1, 2, 3, 4, 4.5]) +r2 = t**z2 * np.exp(-t) + +fig2, ax2 = plt.subplots(num=2, clear=True, constrained_layout=True, figsize=(6, 4)) +ax2.semilogx(t, r2) +# ax2.plot(t,np.exp(-t)) +ax2.set_xlim(10**(-2), 20) +ax2.set_ylim(1e-3, 10) +ax2.set_xlabel(r"$t$") +ax2.set_ylabel(r"$t^z e^{-t}$") +ax2.grid(1, "both") +labels = [f"$z={zi:.1f}$" for zi in np.squeeze(z2)] +ax2.legend(labels, ncol=2, loc="upper left") +fig2.savefig(f"{img_path}/integrands_exp.pgf") +plt.show() -- cgit v1.2.1