Not conserving energy when I should be

  • Context: Undergrad 
  • Thread starter Thread starter msimmons
  • Start date Start date
  • Tags Tags
    Energy
Click For Summary
SUMMARY

The discussion centers on a simulation of two balls in a one-dimensional gravitational system, where the user is experiencing unexpected energy loss during collisions. The energy is calculated using the formula mgh + ½mv², and the initial conditions include two balls with masses m1 = 1 and m2 = 2, starting positions x1 = 1 and x2 = 3, and initial velocities v1 = v2 = 0. The user identifies a mistake in the gravitational acceleration value, correcting it from -4.9 to -9.8, which is crucial for accurate calculations of energy conservation during the collisions.

PREREQUISITES
  • Understanding of classical mechanics, specifically gravitational systems.
  • Familiarity with kinematic equations for motion in one dimension.
  • Knowledge of energy conservation principles in physics.
  • Basic programming skills to simulate physical systems.
NEXT STEPS
  • Review the principles of energy conservation in elastic and inelastic collisions.
  • Learn about the effects of gravitational acceleration on motion in simulations.
  • Explore numerical methods for solving differential equations in physics simulations.
  • Investigate the implementation of collision detection algorithms in programming environments.
USEFUL FOR

Physics students, programmers developing simulations of physical systems, and anyone interested in understanding energy conservation in dynamic systems.

msimmons
Messages
17
Reaction score
0
I'm writing a program to demonstrate the chaotic system of two balls in one dimension with gravity. Before I can get even remotely close to that, however, it would help if my energy was conserved, so I'm apparently doing something wrong but I can't figure it out.

There is no damping forces.
energy is calculated with mgh + \frac{1}{2}mv^2

ball 1 is the BOTTOM ball.
ball 2 is the TOP ball
x1 corresponds to the position of the bottom ball, etc.
initial conditions:
x1 = 1
x2 = 3
v1 = v2 = 0
m1 = 1
m2 = 2
(total system energy = 68.6 )

I'll walk through until my loss of energy, not far away.
First I calculate when the bottom ball hits the ground, they've both accelerated to the same speed and they've both dropped one meter, so the conditions are now
x1 = 0
x2 = 2
v1 = 4.4272 (positive, after the elastic collision with the ground which ain't moving)
v2 = -4.4272
(total system energy = 68.8 )

Next collision will be between the two balls. This is where I spontaneously lose energy
I first calculate the time it takes with
t=\frac{x1_0-x2_0}{v2_0-v1_0}
which is derived from
x1_0 + v1_0t + \frac{1}{2}gt^2 = x2_0 + v2_0t + \frac{1}{2}gt^2
for which I get t = -2/-8.8 = .22588.

next with elementary equations we calculate the position of each ball at that time (or just assume that they're at the same place, which they are, but I'll calculate just in case I am doing something wrong)
x = x_0 + v_0t + \frac{1}{2}gt^2
x1 = .75
x2 = .75
then the velocities before the collision
v = v_0 + gt
v1 = 3.3204
v2 = 5.5340
Total energy = 2*.75*9.8 + .75*9.8 + \frac{1}{2}*2*5.534^2+\frac{1}{2}*3.3204^2 = 58.187

And that's it. Anyone see what I did wrong?




Edit
Scratch that.
g = -9.8. not -4.9.
Duh.
 
Last edited:
Physics news on Phys.org
msimmons said:
which is derived from
x1_0 + v1_0t + \frac{1}{2}gt^2 = x2_0 + v2_0t + \frac{1}{2}gt^2
for which I get t = -2/-8.8 = .22588.

I think, above equation is wrong. Honestly, could not undertand the meaning too.

The balls collides after first ball return from ground. You must calculate the time AFTER that time. BTW, you may calculate the previous time too(before first ball arrive ground). Maybe couldn't understand right.
 
Volcano said:
I think, above equation is wrong. Honestly, could not undertand the meaning too.

The balls collides after first ball return from ground. You must calculate the time AFTER that time. BTW, you may calculate the previous time too(before first ball arrive ground). Maybe couldn't understand right.
That part (the calculation of the time) is correct.

Realize that msimmons already spotted his mistake (see his edit at the bottom of the post), which was here:

msimmons said:
then the velocities before the collision
v = v_0 + gt
v1 = 3.3204
v2 = 5.5340
 

Similar threads

  • · Replies 30 ·
2
Replies
30
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 20 ·
Replies
20
Views
3K
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K