Approximating Ellipse Orbits with Newton's Law

Click For Summary
SUMMARY

This discussion focuses on approximating the elliptical orbits of celestial bodies using Newton's law of universal gravitation, specifically in the context of a 2D space game. The key formula for calculating orbital energy is provided: E = mv²/2 - GMm/d, where 'm' is the mass of the orbiting object, 'v' is its speed, 'd' is its distance from the primary body, 'M' is the mass of the primary, and 'G' is the gravitational constant. The relationship between orbital energy and the semi-major axis is established as E = -GMm/2a, allowing for the calculation of the semi-major axis 'a' once the orbital energy is determined.

PREREQUISITES
  • Understanding of Newton's law of universal gravitation
  • Familiarity with orbital mechanics concepts
  • Knowledge of conic sections and their properties
  • Basic programming skills for simulation in a 2D space game
NEXT STEPS
  • Research how to calculate the eccentricity vector in orbital mechanics
  • Learn about the implications of orbital energy on elliptical orbits
  • Explore methods for simulating multiple steps ahead in orbital mechanics
  • Study the effects of thrust on orbital trajectories and recalculation techniques
USEFUL FOR

Game developers, astrophysicists, and anyone interested in simulating celestial mechanics in a 2D environment will benefit from this discussion.

Chetic
Messages
8
Reaction score
0
How do you approximate the ellipse of an object's orbit using Newton's law of universal gravitation?
I'm working on a 2D space game and that's pretty much the only physics I use, so no other forces to consider.
 
Astronomy news on Phys.org
We need more information to be able to help you.

Do you want to simulate the orbit of a body based on its position and velocity? Do you just want to plot random orbits? In which case it would be easier to base it on eccentricity and period.

Can the orbits change and what sort of events cause the orbits to change? Application of an impulse, new velocity, new eccentricity, etc.
 
Sorry, I didn't realize.
I'm simulating the orbit of bodies based on position and velocity vectors.
The only orbit that's really interesting is the player's. The player will want to have an idea of where he is going. All I really need is how to calculate the ellipse of a two-body system.

The player can of course use thrusters to alter his orbit but surely that can simply be recalculated after the end of the impulse?

I have access to all variables involved, and I can even simulate ahead any number of steps (though as few as possible would be preferred)
 
I'm going to try running the simulation 5 steps ahead, collecting positions, and solve for a conic section.
 
You can definitely solve for the orbital elements exactly with only a single point location and velocity. I don't have my orbital mechanics textbook with me right now, so I can't look up the formulas (and I haven't used them in a while, so I don't remember for sure), but it's definitely doable.
 
Okay, forget what I said.

I've managed to calculate the eccentricity vector, which now always points towards apoapsis (with the length of the eccentricity of the orbit).
How do I calculate the semi major axis? Or something else that gives me the rest of the information I need to draw the ellipse.
 
Chetic said:
Okay, forget what I said.

I've managed to calculate the eccentricity vector, which now always points towards apoapsis (with the length of the eccentricity of the orbit).
How do I calculate the semi major axis? Or something else that gives me the rest of the information I need to draw the ellipse.

That's pretty easy. You use orbital energy.

Given that you know the orbiting object's speed and distance from the primary, and the mass of the Primary, you can find its orbital energy by:

E = \frac{mv^2}{2}-\frac{GMm}{d}

Where m is the mass of the object, v its speed, d its distance from the primary, M the mass of the primary and G the gravitational constant.

It also turns out the the orbital energy is equal to


E= -\frac{GMm}{2a}

Where 'a' is the length of the semi-major axis.

So if you can solve the first equation, you can plug this into the second one and solve for 'a'
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
3
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
3K
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K