Saturday, December 19, 2015

homework and exercises - Determine orbital position after change in velocity


I am working on a satellite simulator for a project/game and I am stuck on this one bit of physics. So far I have a satellite that revolves around earth on a 2D plane following Keplerian motion using Kepler's equation. Everything is fine and the satellite will orbit many times without problem. I can also change the velocity of the satellite to manipulate apo/peri points as well as augment of periapsis.


However, the problem occurs if I change the velocity once the satellite passes the PI/2 mark, the entire orbit gets flipped (augment of periapsis is offset by PI) and the true anomaly resets to 0.


Here is how it is currently implemented: With the assumption that the satellite starts at the periapsis at t0, I find the eccentric and true anomaly given a time since periapsis w. Then I find the radius at that angle to get the final position.


t0=0

E0=0
M(0)=E0esinE0
n=GMa3
E=kepler(e,M)
v=2tan1((1+e)(1e)tanE2)
r=a1e21+ecosv



When I update the velocity of the satellite (flight path angle ϕ is recomputed after change in velocity), I recalculate a new true anomaly using ϕ, I then find the difference between the old true anomaly and the new true anomaly, and add that to the augment of periapsis w. After that I recompute time since periapsis t using the new true anomaly and recompute the orbital parameters as well.


vel=GM2r1a

ϕ=tan1(esinv1+ecosv)
v2=tan1rvgmcosϕsinϕrvgmcos2ϕ1
w+=v2v
E=cos1e+cosv1+ecosv
M=EesinE
n=GMa3
t=Mn
calculateOrbit()


I noticed if I were to v=v+π if ever v2<0 and v>0, then the weird orbit/position flip won't occur until the v=π Otherwise I do not know what the problem is. I would really appreciate it if someone can point me the way, as I have been scratching my head over this for a long time now.



Answer



A quick note, your equation for the radius r as a function of the true anomaly is missing the semi-major axis a. I prefer to use the symbol θ for the true anomaly instead of v, since I will use that for the total velocity. So: r(θ)=a(1e2)1+ecosθ

And the way I would calculate my new trajectory parameters after a velocity change is by evaluating the semi-major axis a and eccentricity e: a=μr2μrv2
e=1+r3ω2μ(rv2μ2)
where μ is the gravitational parameter (you use GM) and ω is the angular velocity, such that the tangential velocity is equal to vθ=rω.
From this you can calculate the true anomaly via: θ=cos1(a(1e2)rer)
However the arc-cosine will return a value between 0 and π and to cover the rest of the arc (form π to 0) you have to look at the radial velocity ˙r or vr. When this is negative it means that you have passed your apoapsis and that the true anomaly will be bigger than π or negative (depending on which range you want to use for θ), so the true anomaly would simply become: θ=cos1(a(1e2)rer)
PS: This might be a useful question since it contains an explicit expression for the the time as a function of your position.


No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...