Presumably we're dealing with a system where the mass change is negligible (not really realistic for a rocket, but the math becomes more involved if you take it into account). In this case, so long as the engine's operation isn't changing any (neglect ambient air pressure and things like that), I can't see how the rocket engine's acceleration would change. And sure, acceleration due to gravity will change, but like you said, that's probably small over the range we're (presumably) dealing with.
I think the idea here was for a basic simulation that would give an approximate solution, and these simplifications will do that. But using them will produce different results from Orbiter and real life: the question is how much error is acceptable. I suppose only Topper would know that.
Hi,
yes youre right, an approximate solution wille be enogh, because i can improve this solution later.
So a first approach is to calculate the impact speed:
v_impact = sqrt((Yspd*Yspd)+2*g*s_to_ground)
The maximum resulting acceleration of the engine can be calculated by:
a_resulting = -g + a_engine_max (if g is negativ)
the stopping distance for v_impact can be calculate by
s_stop = (v_impact*v_impact)/(2 * a_resulting)
But now my problem starts:
I will not get the speed "v_impact" to zero.
I will get the speed to 0 i have by starting the burn. (it's much less than v_impact, because v will increase by falling down when i not burn)
But i can't calculate these speed because i have not the altitude (remember, the altitude is what i want).
So i've tried to use v_impact as an approximation.
Then i can take these altitude for calculating v_burnstart and so on (sucsessive approximation).
This works well on the moon and mars, but on earth i have a "1.#IND00" in my Alt_Burn - Var in after some steps (i know it's when AltBurn>Alt, but how that is possible?).
I don't now why !? (And yes, i have reduced the fuel so i can hover in my DG

)
I also think there must be a better way!
Here is my current code for calculating these "savety altitude" (sounds better then "alt of death"

)
Code:
double SurfaceSpeedMFD::GetSaveAlt()
{
double Alt = GetGearAlt(); //returns the Altitude under the Gear
VESSEL *V=oapiGetFocusInterface();
VECTOR3 vG;
OBJHANDLE RefGBody= V->GetGravityRef();
double rMass = oapiGetMass (RefGBody);
double r = oapiGetSize (RefGBody);
double a0 = (G * rMass) / (r*r);
double aDown = (G * rMass) / ((r+Alt)*(r+Alt)); //G-body acceleration
//Getting the required hover engine parameter
int nthr=V->GetGroupThrusterCount(THGROUP_HOVER);
double FupMax=0;
for(int i=0; i<nthr; i++)
{
THRUSTER_HANDLE th=V->GetGroupThruster(THGROUP_HOVER,i);
FupMax = FupMax + V->GetThrusterMax0(th);
}
double aUpMax = FupMax / V->GetMass(); //Maximum acceleration using the hover-engine
double aTot = aUpMax - aDown; //resilting (positive) acceleration when the engine is engaged
// now we have: ar = aTot
//Getting of the current Values (Altitude and verticle speed)...
VECTOR3 Vspd;
V->GetHorizonAirspeedVector(Vspd);
double Yspd = Vspd.y; //Verticle speed
//now we can calculate the altitute where whe have to
//start our hover engine (s_ignition)
double Vimpact = sqrt((Yspd*Yspd)+2.0f*aDown*Alt); //Impact speed on ground contact if we do NOT burn
double AltBurn = ((Vimpact*Vimpact)/(2.0f * aTot)); //aproximated alt to start the engine
double VOnAltburn = sqrt((Vimpact*Vimpact)+2.0f*aDown*(Alt-AltBurn)); //aproximated
//sucsessive approximation...
for (int lauf=0; lauf<100; lauf++)
{
aDown = ((G * rMass) / ((AltBurn + r)*(AltBurn + r)) + a0) / 2.0f; //acceleration, mean value beetween altitude of ground and altitute where we have to start the burn
aTot = aUpMax - aDown; //calculating of the new value for the resulting (positiv) acceleration
AltBurn = ((VOnAltburn*VOnAltburn)/(2.0f * aTot));
VOnAltburn = sqrt((Yspd*Yspd)+2.0f*aDown*(Alt-AltBurn));
}
return AltBurn;
}