diff --git a/plots/forceprofile.png b/plots/forceprofile.png new file mode 100644 index 0000000000000000000000000000000000000000..acf4ec97b8f1b3224e3bbe49b1c540ec9eabd806 Binary files /dev/null and b/plots/forceprofile.png differ diff --git a/plots/forceprofile.py b/plots/forceprofile.py new file mode 100644 index 0000000000000000000000000000000000000000..a93e68791ac2f10d38a40d09e5eaea2a73a02647 --- /dev/null +++ b/plots/forceprofile.py @@ -0,0 +1,32 @@ +import numpy as np +import matplotlib.pyplot as plt + +forces = np.loadtxt('../out/forces.txt') +print("forces: ", forces.shape) + +fx = forces[:,0] +fy = forces[:,1] +fz = forces[:,2] +fr = np.sqrt(fx**2 + fy**2 + fz**2) + +data = np.loadtxt('../data/data.txt') +print("data: ", data.shape) + +x = data[:,2] +y = data[:,3] +z = data[:,4] +r = np.sqrt(x**2 + y**2 + z**2) + +m = data[:,1] + +# plt.plot(np.log(r), fr, '.', label='Force Profile from calculation', markersize=1) +plt.plot(r, fr, '.', label='Force Profile from calculation', markersize=1) + +plt.xlabel(r'Radius $log(r)$') +plt.xlabel(r'Radius $r$') +plt.ylabel(r'Force $F(r)$') +plt.xlim(right=400) + +plt.legend() +plt.savefig('forceprofile.png', dpi=200) +plt.show() \ No newline at end of file