From 41ffe0c829cd0f177ad20160f959618a985df7e2 Mon Sep 17 00:00:00 2001 From: Sebastian Kloth Date: Sat, 27 Jan 2024 14:53:53 +0100 Subject: [PATCH] Started example for dynamic properties --- examples/dynamic_properties.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/dynamic_properties.py diff --git a/examples/dynamic_properties.py b/examples/dynamic_properties.py new file mode 100644 index 0000000..3323637 --- /dev/null +++ b/examples/dynamic_properties.py @@ -0,0 +1,19 @@ +print(md.correlation.msd(trajectory[0], trajectory[-1])) + +result_msd = md.correlation.shifted_correlation( + md.correlation.msd, oxygen_water, segments=10, skip=0.1, average=True +) +result_msd_nojump = md.correlation.shifted_correlation( + md.correlation.msd, oxygen_water.nojump, segments=10, skip=0.1, average=True +) + +plt.figure() +plt.plot(result_msd[0], result_msd[1], ".", label="pbc") +plt.plot(result_msd_nojump[0], result_msd_nojump[1], "-", label="nojump") +plt.legend() +plt.xscale("log") +plt.yscale("log") +plt.xlabel(r"$t$ in ps", fontsize=16) +plt.ylabel(r"$\langle r^2\rangle(t)$ in nm$^2$", fontsize=16) +plt.show() +plt.close() \ No newline at end of file