Why Does Planetary Energy Increase in My ODE Simulation?

Click For Summary
SUMMARY

The discussion centers on the calculation of the rate of energy per unit mass, \(\frac{E}{m}\), in a planetary system simulation using an ODE solver in Java. The user derived the equation for the rate of energy change, \(\frac{dE}{dt}=v\cdot\left(a+\frac{G\cdot M}{r}\right)\), but encountered issues with the ODE solver producing a plot of increasing energy over time, which contradicts the principle of energy conservation. The user realized the need to plot energy without relying on the ODE solver, indicating a gap in the instructional material regarding this method.

PREREQUISITES
  • Understanding of Ordinary Differential Equations (ODEs)
  • Familiarity with Java programming and ODE solvers
  • Knowledge of gravitational physics, specifically Newton's laws
  • Basic calculus, particularly differentiation and integration
NEXT STEPS
  • Research how to implement energy conservation checks in ODE simulations
  • Learn about alternative methods for plotting energy in simulations without ODE solvers
  • Explore Java libraries for numerical integration and their applications in physics simulations
  • Study the implications of non-conservative forces in planetary motion
USEFUL FOR

Students and developers working on physics simulations, particularly those focused on planetary systems, as well as educators looking to enhance their curriculum on energy conservation in dynamic systems.

jmtome2
Messages
67
Reaction score
0

Homework Statement


OK so here goes.

I'm using an ODEsolver in java to plot the total energy over time of a planetary system. So I've been trying to calculate the rate of energy (per unit mass), \frac{E}{m}.

Homework Equations


The equation for total energy (per unit mass) of a planetary system is:
\frac{E}{m}=1/2\cdot v^2-\frac{G\cdot M}{r}

G is the gravitational constant
M is the mass of the sun (constant)
v is the velocity of the planet, v^2=v^{2}_{x}+v^{2}_{y}
r is the distance of the planet from the sun, r^2=x^{2}+y^{2}

Essentially I need help finding \frac{dE}{dt}


The Attempt at a Solution


The answer I got for the rate is:

\frac{dE}{dt}=v\cdot\left(a+\frac{G\cdot M}{r}\right)

where a is the acceleration of the planet, a^2=a^{2}_{x}+a^{2}_{y}

The problem is that everytime I throw this equation into the ODEsolver, I get a plot of ever-increasing energy as time goes on which I know is not correct.

Help anybody?
 
Physics news on Phys.org
Isn't dE/dt = 0 because energy is conserved? Am I missing something here?
 
YES! Of course it is... what was I thinking. But this creates a whole problem... I've got to figure out how to plot E now inside the program without using the ODEsolver, which hasn't been mentioned in the book yet. *sigh*

Thanks for clarifying :)
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
Replies
3
Views
1K
  • · Replies 9 ·
Replies
9
Views
3K
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K