Started example for dynamic properties

This commit is contained in:
Sebastian Kloth 2024-01-27 14:53:53 +01:00
parent 39a24555e8
commit 41ffe0c829

View File

@ -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()