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

Energy Gain in Wall Collisions in Perfectly Elastic Setting #3

Open
BKaperick opened this issue May 22, 2019 · 3 comments
Open

Energy Gain in Wall Collisions in Perfectly Elastic Setting #3

BKaperick opened this issue May 22, 2019 · 3 comments

Comments

@BKaperick
Copy link
Owner

Here the ELASTICITY parameter is set to 1, to indicate that collisions with walls are perfectly elastic. We appear to gain a small (relative to system) amount of total energy with each hit. This effect likely exists with other choices of ELASTICITY, but this should be the simplest case to analyze.

Figure_1
simul

BKaperick added a commit that referenced this issue May 22, 2019
…irectory structure. Big change is a resolution to lost heat issue. The energy totals in the World count were not factoring in heat energy in fixedpolygons. Specifically, each collision with a wall resulted in half of the heat of that collision not being accounted for. Now, total energy is persisting, with some slight gain as observed in issue #3.
@BKaperick
Copy link
Owner Author

Currently, we use a fixed time step dt. If - in between two states - a collision occurred, the step is reversed, and we advance at increment dt/2. This is repeated, incrementing at dt/2^k until no collisions exist above COLLISION_TOL or the modified time increment dt/2^k is below EPSILON. We only seem to be gaining energy when the second condition fails:

Fizz-2D/src/physics.py

Lines 91 to 114 in 5c8ac7a

while max_collision_overlap > COLLISION_TOL and dt > EPSILON:
if first_iter:
first_iter = False
else:
dt /= 2
for obj in self.objs:
obj.reverse_update()
# Do first pass of position, velocity and acceleration updates for
# each object in the world
for obj in self.objs:
obj.pre_update([], gdf, dt)
# check_collisions() compiles a list of collisions with information:
# (1,2) the two objects contained in the collision
# (3) the unit vector normal to the surface of collision
# (4) magnitude of normal vector
# (5) a flag indicating a sign change for the normal vector
collisions = self.check_collisions()
magnitudes = [abs(magnitude) for _,__,___,magnitude,____ in collisions]
if collisions:
max_collision_overlap = max(magnitudes)
else:
max_collision_overlap = 0

This makes perfect sense, as this is exactly the scenario in which the collision resolution "fails" and has to bail out for fear of instability with a small time step.

@BKaperick
Copy link
Owner Author

BKaperick commented May 23, 2019

Interestingly, changing the EPSILON parameter results in only negligible improvement in the magnitude of energy error incurred.
With GRAVITY=[0, 100] and input file simulations/BOX_1SQUARE.in:

EPSILON Relative Energy Gain in Collision
1e-4 1.83360663%
1e-8 1.82640794%
1e-9 1.82640756%
1e-10 1.82640751%

@BKaperick
Copy link
Owner Author

Reducing time discretization can make this energy gain arbitrarily small, at the cost of more computational time.

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