Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearence - pseudo gravity #978

Open
IColizzi opened this issue Jul 18, 2024 Discussed in #972 · 0 comments
Open

Clearence - pseudo gravity #978

IColizzi opened this issue Jul 18, 2024 Discussed in #972 · 0 comments

Comments

@IColizzi
Copy link

Discussed in #972

Originally posted by IColizzi June 28, 2024
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?

clearence

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant