Calculating an elliptical orbit using position and velocity around a stationary mass

  • Thread starter whiterook6
  • Start date
  • #1

Main Question or Discussion Point

Hi. I was playing a video game where, in one level, you are in an orbit around an attractor. The game was 2D, so there's no inclination, etc. The game showed the projected path of the body around the attractor. When you used the games controls to thrust in a direction, it would show the projected path changing, to the point of turning red when you would eventually intersected the attractor.

I've been working on a project like this, where spacecraft orbit a planet or moon or something in an elliptical orbit. I can calculate the position along the orbit for any given time t, and can get the velocity from the vis-viva equation and the tangent to the ellipse at that point. To model the orbit I use a semi-major axis, eccentricity, mean anomaly at epoch, and argument of periapsis (I got a lot of this from wikipedia; many of the resources I've been pointed at have been over my head.)

If I apply an acceleration, I would expect the orbit to change. How can I recompute those orbital elements to show the new path?

Also, instead of using the Kepler elements, I could also just use the equations for an ellipse. Would those be easier for doing this sort of work?
 

Answers and Replies

  • #2


If you want to re-create the game idea you should look into numerical integration methods, e.g. leapfrog/euler:

For timestep n, use mass positions to calculate Force and then use that force to find particles new velocity and position
v(n+1/2) = v(n-1/2) + F*dt/m

x(n+1) = x(n) + v(n+1/2)*dt

where dt = timestep. Look it up for better explanation :-)

If you want to do it analyticaly, maybe a instantaneous acceleration to a new velocity vector and then re-calculate the orbit?

Hope it helps.
 

Related Threads on Calculating an elliptical orbit using position and velocity around a stationary mass

  • Last Post
Replies
15
Views
6K
Replies
1
Views
4K
Replies
1
Views
786
  • Last Post
4
Replies
95
Views
24K
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
5
Views
2K
Replies
27
Views
4K
Replies
6
Views
4K
  • Last Post
Replies
2
Views
3K
Top