2
$\begingroup$

I would like to write a program able to simulate a keplerian orbite given an initial position and velocity (r0, v0) and able to manage accelerations in different directions.

To simulate the orbit, I use the expressions given here and manage particular orbits (without inclination, circular ...). The algorithm is quite simple :

  • Given r0 and v0 I calculate the orbital elements (a, e, i, Ω, 𝜔, 𝜈) and the coordinates of the satellite in its orbital plan following those formulas : x_orb = a * (cos(E) - e) | y_orb = a*sqrt(1-e²)*sin(E)

  • I calculate the mean anomaly M, then the eccentric anomaly E and finally the true anomaly 𝜈. Given 𝜈, I obtain the coordinates in the orbital plan given the equations above. Finally, I obtain the coordinate r and v by a multiplication with 3 rotation matrices given here (formulas (12), (13), (14))

All orbits are perfectly simulated.

Problems come when I try to apply a ΔV to my satellite : during the main loop, I just modify the velocity and recalculate all orbital elements as if the actual r and v were initial position and velocity. Then, the upper algorithm is followed again.

Maybe I'm missing something silly, but it doesn't work at all : when I recalculate the orbital elements and relaunch the algorithm, my satellite abruptly changes its position and follow a new orbit.

Is my way to "simulate" the acceleration bad or am I just missing something ?

Thanks !

**here is a screen of the simulation** **here is a zoom**

$\endgroup$
  • $\begingroup$ "during the main loop" so are you continuously calculating the orbital parameters? If continuous, do you apply the delta-v instantaneously or do you chop up the impulse by the time step you are using? $\endgroup$ – Organic Marble Jun 19 at 18:13
  • $\begingroup$ While I don't apply a ΔV, I don't calculate orbital elements as they don't change (except 𝜈). I just recalculate them when I apply the ΔV (which I apply instantaneously, not by impulses). (edit : I try to apply it by impulses, but same result ...) $\endgroup$ – Tom Semblanet Jun 19 at 19:49
  • $\begingroup$ Well, fter a non zero impulse the satellite must change its orbit. Obviously the position at the impulse application time should be the same before and after, that is what you should check. To put in other words, the initial orbit has to intersect the final one. Maybe, it will help if you upload a figure about what is happening $\endgroup$ – Julio Jun 21 at 11:15
  • $\begingroup$ Hi thank's for your answer. Indeed, my question without illustrations could be incomprehensible so I added two screenshots of my simulation. On those screenshots appear 3 trajectories : Vi : 8000m/s and no ΔV | Vi : 7800m/s and no ΔV | Vi : 8000m/s and ΔV : -200m/s at apoapsis. Edit : I'm aware that the result of my simulation is a total non-sense, but just don't understand where the problem comes from ... $\endgroup$ – Tom Semblanet Jun 21 at 20:45
  • $\begingroup$ when you apply your impulse r shouldn't change - you should apply your deltav to v only. I can't see the code in your main loop, but if you can determine how r is being changed the that should be the answer. $\endgroup$ – JCRM Jun 22 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.