No, i'm not trying to calculate ephemeris, and the first formula is not what I need.
Let me explain, I'm trying to find out the formula that DGIV uses to calculate the predicted reentry angle, but for that, I have to know the Vertical Speed and the Ground relative Speed at the moment of hitting the atmosphere. But for that, I need to integrate those two functions.
Can someone do it for me if it's not much trouble? or maybe point me to a good tutorial on numerical integrations? I've been trying but I couldnt...
Here's my approach to finding velocity, and subsequently angle, at entry interface:
You know your orbital velocity now, you know your mass now, you know the mass of the planet, and you know your altitude now. This means you can calculate your total mechanical energy as the sum of your potential and kinetic energy:
U = .5*m*v^2 - G*M*m/r
(v is your orbital velocity, G is the gravitational constant, M is the mass of the planet, m is your (vessel's) mass, r is your distance from the planet's center, the potential energy component is negative, because setting 0 potential energy at infinite distance is convenient, and doesn't change anything anyway)
As long as nothing inconvenient happens (like atmospheric drag, or thrust), your total mechanical energy, U, will remain constant throughout your orbit. Therefore, you can solve for v, like this:
v = (2*(U + G*M*m/r)/m)^.5
and plug in any value for r that you like, such as the radius of what you consider to be the entry interface. Now you know what your velocity will be at the entry interface, but that doesn't tell you the angle. To do that, we need to consider angular momentum. Gravity works radially only (no side to side forces), so therefore, your angular momentum will be constant (unless the aforementioned inconvenient things like thrust and drag happen). Your angular momentum is:
L = r*m*(v^2-vvert^2)^.5
(r, m, and v are the same as before, vvert is your vertical velocity, which you can find on surface MFD)
Now you can solve for vvert (and plug in whatever new value you like for r, and the corresponding value of v, from above):
vvert = (v^2-(L/(r*m))^2)^.5
And since you now have both v and vvert at the entry interface, you can find the angle with some trig:
a = asin(vvert/v)
where asin is the inverse of the sin function. Compensating for the rotation of the planet is left as an excercise for the reader
.
I hope this is understandable.
edit: I've now fixed the mistake I mentioned later. If you haven't seen this message before, notice the plus sign in the angular momentum formula is now a minus sign, and this has been propogated to the vvert formula.