Simulating orbit trajectory based on position and velocity

Click For Summary

Discussion Overview

The discussion revolves around simulating the orbital trajectory of satellites and spaceships based on their position and velocity in a two-dimensional plane. Participants explore the calculations necessary to visually represent the flight path, focusing on the parameters of elliptical orbits, including semi-major axis, semi-minor axis, eccentricity, and energy conservation principles.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant seeks guidance on calculating the parameters of an elliptical orbit based on distance from a planet's center of mass and satellite velocity.
  • Another participant discusses the relationship between position, velocity, and kinetic energy in the context of orbital mechanics.
  • Participants introduce the concept of potential energy and its role in determining the type of orbit based on total energy.
  • There is a discussion about the constraints on tangential velocity as dictated by Kepler's laws.
  • One participant derives a quadratic equation for radial velocity and discusses how to find the distances to apsides based on this equation.
  • Clarifications are made regarding the definitions of variables such as mass of the planet, angular momentum, and distance between the planet and satellite.
  • A participant shares their calculations for total energy and expresses confusion over discrepancies between their results and expected values.
  • Another participant assists by confirming calculations and correcting misunderstandings regarding the quadratic formula used to solve for distances.
  • Participants clarify the correct approach to solving the quadratic equation and the necessary transformations to obtain the correct values for R.
  • A participant expresses satisfaction upon successfully implementing the calculations in their simulation.

Areas of Agreement / Disagreement

While participants generally agree on the principles of orbital mechanics and the calculations involved, there are moments of confusion and correction regarding specific calculations and interpretations of the equations. The discussion does not reach a consensus on all aspects, particularly regarding the initial calculations and their implications.

Contextual Notes

Some calculations and assumptions are not fully resolved, particularly regarding the identification of variables in the quadratic equation and the interpretation of energy values. There are also indications of potential errors in numerical calculations that remain unaddressed.

Who May Find This Useful

This discussion may be useful for individuals interested in orbital mechanics, simulation of celestial motion, and those seeking to understand the mathematical foundations of orbital trajectories.

AlenC
Messages
7
Reaction score
0
Hi!

I hope I'm posting in the correct section. I found this very similar topic in this forum: https://www.physicsforums.com/threads/orbital-ellipse.482713/

Aside from very helpful formula for calculating semi-major axis, the question was left unanswered.

I have a working simulation of orbital motion of satellites and spaceships, but I'd like to visually represent this flight path based on distance from planet's center of mass and satellite's velocity.

I assume the best way to do this is by drawing an ellipse, for which I need to know semi-major axis, semi-minor axis and eccentricity or focus. What would be the best process to do this? I don't mind doing some research and reading myself, but I'd like to understand at least the sequence of calculations I need to do.

Thanks for help in advance.

Edit: I forgot to mention that I'm simulating everything in two dimensional plane.
 
Last edited:
Astronomy news on Phys.org
Start with this:
Position in two dimensional plane is determined by single variable - distance. Right?
And for velocity, you need two variables: radial and tangential velocity. Correct?
 
  • Like
Likes   Reactions: AlenC
snorkack said:
Start with this:
Position in two dimensional plane is determined by single variable - distance. Right?
And for velocity, you need two variables: radial and tangential velocity. Correct?

Yes. I know these values. What can I do next based on this?
 
Calling the velocities Vr and Vt, we can note that kinetic energy Ek=mv2/2=m(Vr2+Vt2)/2 - at every point of orbit.
 
  • Like
Likes   Reactions: AlenC
Ok, I'm still with you.
 
The second constraint is that the potential energy Ep=-MmG/R.
Now, conservation of energy means that the total energy
E=m[(Vr2+Vt2)/2-MG/R]
is constant. If it´s positive, then the orbit is hyperbolic and the satellite escapes; if it is zero then the orbit is parabolic and the satellite also escapes..
If the energy is negative then the orbit is elliptical or circular.
Now, the tangential velocity has another constraint: second law of Kepler:
VtR must be constant.
Therefore Vt, and therefore also Vt2 cannot go to zero.
 
  • Like
Likes   Reactions: AlenC
So: E/m=(Vr2+Vt2)/2-MG/R
Also Vt=(L/m)/R, for every R.
Thus: E/m=Vr2/2+[(L/m)2/2]/R2-MG/R
rearranging, I get
Vr2/2=E/m+MG/R-[(L/m)2/2]/R2
multiplying by 2
Vr2=2(E/m)+2MG/R-(L/m)2/R2
Observe that this is a quadratic equation for (1/R).
 
Last edited:
  • Like
Likes   Reactions: AlenC
I'll need some time to process this, but I think I understand the general meaning: I can calculate energy from velocity and distance.

Would you just mind explaining what M, L and R stand for?
 
Now, Vr2 as a square cannot be negative. Whereas the member -(L/M)2/R2 is negative and can get arbitrarily small (?) as 1/R increases.
Therefore, you can solve the quadratic equation for Vr2=0, and get the two R values where Vr2=0.
These R values are the distances to apsides.
Major axis of ellipse is Rmax+Rmin.
Eccentricity is (Rmax-Rmin)/(Rmax+Rmin)
 
  • Like
Likes   Reactions: AlenC
  • #10
AlenC said:
Would you just mind explaining what M, L and R stand for?
M is the mass of the planet.
L is the angular momentum of the satellite. I preferred to use the expression (L/m), where m is the mass of satellite.
R is the distance between planet and satellite.
 
  • Like
Likes   Reactions: AlenC
  • #11
I tried using these equations in my simulation, but I'm getting strange results. Either too big or too small. Would you mind checking my numbers?

I first tried calculating total energy:

E = 10000000kg*( (7563.49ms²/2) - ((6E+24kg*6.67408E-11)/7000000m) )
Mass of the planet is approximate. I didn't include radial velocity, because at this point is zero. Tangential velocity is calculated by the simulation for a circular orbit and it works correctly (as far as I can tell). If I boost this value manually, orbit becomes an ellipse and satellite returns to its starting position.

Result calculated by the computer is: -286032000000000
But this is the result I got from windows calculator: -57206399999713968094999500

I'm obviously making a mistake somewhere...
 
  • #12
AlenC said:
E = 10000000kg*( (7563.49ms²/2) - ((6E+24kg*6.67408E-11)/7000000m) )
I get:
Vt2/2=+2,8E+7
GM=4E+14
GM/R=-5,7E+7
Your Windows calculator looks like you´ve put too many zeros to the GM/R part.
Yes: if you increase tangential speed from a circular orbit, the point becomes a perigee. If the speed remains below the escape speed, the satellite will acquire an elliptical orbit and return to the point of origin.
 
  • Like
Likes   Reactions: AlenC
  • #13
I checked the results coming out of program and they match with your calculations and my original value of E: -286032000000000

So now comes the difficult part where I'm probably making a mistake. If I understood correctly, next I have to solve quadratic equation with two results:
Vr2=2(E/m)+2MG/R-(L/m)2/R2

I used this formula:

R_1={ -B + [ sqrt(B²- (4AC) ) ] } / 2 * A
R_2={ -B - [ sqrt(B²- (4AC) ) ] } / 2 * A

I identified these elements from the formula you provided:

A = (L/m)²*-1 (should this be negative?)
B = 2MG
C = 2*(E/m)

Am I doing this correctly? Also, if I understand what you said, the result is actually 1/R, so I should multiply the result with itself?
 
  • #14
AlenC said:
So now comes the difficult part where I'm probably making a mistake. If I understood correctly, next I have to solve quadratic equation with two results:
Vr2=2(E/m)+2MG/R-(L/m)2/R2
Yes - solve it for Vr=0
AlenC said:
I used this formula:

R_1={ -B + [ sqrt(B²- (4AC) ) ] } / 2 * A
R_2={ -B - [ sqrt(B²- (4AC) ) ] } / 2 * A

I identified these elements from the formula you provided:

A = (L/m)²*-1 (should this be negative?)
Yes, negative - so no -1 there
A=-(L/m)2
AlenC said:
B = 2MG
C = 2*(E/m)

Am I doing this correctly? Also, if I understand what you said, the result is actually 1/R, so I should multiply the result with itself?
No. You need to take inverse - divide 1 by 1/R
As it happens, the expression you need to take inverse of is already expressed as a ratio, so that´s easy:
1/R1=[-B+sqrt(B2-4AC)]/2A
therefore
R1=2A/[-B+sqrt(B2-4AC)]
 
  • Like
Likes   Reactions: AlenC
  • #15
Thank you so much, it's finally working:
http://image.prntscr.com/image/60331e210381452ab979dd775141e760.png
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 7 ·
Replies
7
Views
14K