Replies: 1 comment
-
Hi @IColizzi, I know this answer is 7 months too late, but I "think" the issue is that when you different clearances you do get a different number of particles. You specify maxiter, but it will stop before that if necessary. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I am using the function pseudo gravity to simulate a box filled with spheres. I have noticed that by changing the clearance but using the same number of spheres, I get different integral densities (i.e. sum up among the gravity axis). This should not be true since the integral density should be independent of the clearance (and only depend on the number of particles) ... Do you have any idea why this is the case?
Code
box_shape = [150, 340, 390]
image = np.ones(box_shape, dtype=bool)
Call the function with different clearances
result1 = ps.generators.pseudo_gravity_packing(im=image, r=r_copper, clearance=0, axis=0, maxiter=2146)
result2 = ps.generators.pseudo_gravity_packing(im=image, r=r_copper, clearance=-2, axis=0, maxiter=2146)
result3 = ps.generators.pseudo_gravity_packing(im=image, r=r_copper, clearance=2, axis=0, maxiter=2146)
Sum along the gravity axis (axis=0)
density1 = np.sum(result1, axis=(1, 2))
density2 = np.sum(result2, axis=(1, 2))
density3 = np.sum(result3, axis=(1, 2))
Plot the densities
plt.plot(density1, label='Clearance = 0')
plt.plot(density2, label='Clearance = -2')
plt.plot(density3, label='Clearance = +2')
plt.xlabel('Position along gravity axis')
plt.ylabel('Integral Density')
plt.legend()
plt.show()
Beta Was this translation helpful? Give feedback.
All reactions