Jump to content

Ideal atmospheric escape? (Calling the help of advanced engineering mathematics.)


Recommended Posts

I am not one for minmaxing my playing, but the underlying math of KSP has lit a fire on my already rabid appetite for mathematics. I am curious as to how one would calculate the ideal escape from Kerbins atmosphere with a one stage rigid body. (One stage, since more stages just complicate the final equation.)

As far as I know, there are three forces (At least three significant ones) acting on the body while in flight; the constant thrust (constant for each stage, as long as there is fuel left), the downward force due to gravity (which decreases linearly with the mass) and the drag force, which appears to be the most arbitrarily simulated phenomena in KSP.

I am assuming the drag force is proportional to the square of the velocity, just like in textbook examples of differential equations involving drag. Also, seeing as the drag is affected by the atmospheric density, which in game is simulated with an exponention function, the final equation seems to become something way beyond my current abilities - a second order non linear differential equation. Therefore, I call on the help of those with a sound knowledge of such matters, and the magicks of Laplace and Fourier! (Of which I know next to nothing)

This is my premature attempt at translating the problem into an equation I am unable to solve.

4zNFSvi.jpg

Would this be a good start for answeing my problem? I see that this equation would only account for vertical motion, but someone more able that this here iHorse might be able to translate the problem into vector calculus to account for circular orbits and stuff like that.

In shorter words, what I am asking is this: Is there a way to calculate an ideal escape trajectory out of Kerbins atmosphere? What variables needs to be accounted for, and how should this problem be translated into calculus? I would love to see someone take a shot at this, both for my own learning purposes and for the collective good of the OCD's among us.

Link to comment
Share on other sites

There was a question of this nature posted a while ago...lemme see if I can find the link to the thread.

EDIT: Here we go - http://forum.kerbalspaceprogram.com/threads/72164-Question-to-the-physics-junkies-out-there-!

That was more of a question about how to calculate a perfect gravity turn, but that should be applicable to your case as well.

A PM to aNewHope on your part might not be amiss. Just saying.

Edited by capi3101
Link to comment
Share on other sites

The vertical only ascent is is known as the Goddard problem.

Some versions ago there was a challenge focusing on this problem.

If you want to dig deeper into the mathmatics of ascents with gravity turn, these two threads might give you some ideas:

I need someone help me do some math for launch optimization

Finding the best ascent path for rockets

Link to comment
Share on other sites

Lower velocity wastes delta-V on gravity, higher is wasted on air resistance

I've never understood this. What does terminal velocity have to do with gravity drag? Why would the ideal velocity not be higher (or lower) than terminal velocity?

Link to comment
Share on other sites

Because you're wasting fuel trying to push through it.

Imagine an atmosphere where you couldn't go faster than terminal velocity because it's so thick. At terminal velocity, you have x% throttle. If you increase throttle, you're burning more, but not getting any faster because of the high density atmosphere.

Obviously, atmosphere aren't like this, so you scale back the thickness and you can go faster, but you're still burning more fuel than necessary. Look up a youtube video about the Goddard Problem in KSP. A vessel with I think 33% throttle got higher than one with 100% because it wasn't fighting higher air resistance than necessary.

As for gravity drag, it's like hovering - burning fuel but not going upwards. If you're going 100% throttle and still not going fast enough upwards, it's like doing 50% with a twice as powerful engine. "Fast enough upwards" is a balance between hovering and exceeding terminal velocity - turns out the most fuel efficient speed to travel is at terminal velocity.

Edited by ObsessedWithKSP
Link to comment
Share on other sites

Because you're wasting fuel trying to push through it.

Imagine an atmosphere where you couldn't go faster than terminal velocity because it's so thick. At terminal velocity, you have x% throttle. If you increase throttle, you're burning more, but not getting any faster because of the high density atmosphere.

Obviously, atmosphere aren't like this, so you scale back the thickness and you can go faster, but you're still burning more fuel than necessary. Look up a youtube video about the Goddard Problem in KSP. A vessel with I think 33% throttle got higher than one with 100% because it wasn't fighting higher air resistance than necessary.

As for gravity drag, it's like hovering - burning fuel but not going upwards. If you're going 100% throttle and still not going fast enough upwards, it's like doing 50% with a twice as powerful engine. "Fast enough upwards" is a balance between hovering and exceeding terminal velocity - turns out the most fuel efficient speed to travel is at terminal velocity.

You're "wasting fuel" to push through atmosphere any time there's atmosphere. You can always burn more to go faster, but it's not like at (or below) terminal you spend nothing on drag, so it's equally true that you could slow down and reduce what you're spending to overcome drag. I've seen (and follow) the advice that the ideal balance between losses to atmospheric resistance and gravity drag puts you at about terminal velocity, but I don't know of any explanation for why this is so. Put another way: is the ideal velocity exactly terminal, or is terminal velocity simply a decent approximation for the ideal?

Link to comment
Share on other sites

It depends on where you want to go. An ascent straight up will spend less time in the atmosphere and less delta-v is required because you're not trying to establish orbit, but just to leave the atmosphere. I've noticed that rocket's I've sent on a straight up trajectory tend to land a little West of the KSC. This is because the planet rotates slight while you travel up (I think), but not sure if that is significant.

Just thought I'd mention this point.

Link to comment
Share on other sites

Which would increase your spending on fighting gravity. I don't know of a reason why terminal velocity ends up being ideal, I think it just is, thanks to balancing unnecessary drag and gravity. IANA rocket scientist though...

And you could speed up; spend more on air resistance, less on gravity drag. Any solution will be a "balance" of the drag forces. I'm still left wondering whether terminal velocity is actually the ideal velocity for efficient ascent (and what explanation backs that up--"it's a balance" seems lacking, since it doesn't explain why going faster or slower than terminal is less efficient) or whether terminal velocity just happens to be a workable approximation of the optimum.

Link to comment
Share on other sites

And you could speed up; spend more on air resistance, less on gravity drag. Any solution will be a "balance" of the drag forces. I'm still left wondering whether terminal velocity is actually the ideal velocity for efficient ascent (and what explanation backs that up--"it's a balance" seems lacking, since it doesn't explain why going faster or slower than terminal is less efficient) or whether terminal velocity just happens to be a workable approximation of the optimum.

You're right, it just is... is no explination. You would have to go through the maths and you may likely find that terminal velocity is only a rough approximation. Its not suprising though that terminal velocity is special if you think about it. As its the natural balance achieved between your weight and the air resistance at that speed. During your ascent you are trying to balance reducing gravitational losses against a squared power increase in drag with speed.

http://www.youtube.com/watch?v=YZ-wvb2QPRw

Just a nice proof of concept :)

Edited by Poynting
Link to comment
Share on other sites

You have to stop and realize what terminal velocity IS.

In a fall through the atmosphere, without thrust, there are two forces- gravity and drag. If you are falling faster than terminal velocity (say in reentry) air resistance is greater than the force of gravity and you slow down. If you are moving slower than terminal velocity (small rocket at apogee), gravity is stronger than air resistance and you speed up.

A launch runs into the same factors. At any given altitude, the force of gravity will be matched by the force of air resistance at terminal velocity. Go faster, and the drag goes up exponentially (it's squared, IIRC), and go slower to lose more time to gravity drag.

Link to comment
Share on other sites

You have to stop and realize what terminal velocity IS.

In a fall through the atmosphere, without thrust, there are two forces- gravity and drag. If you are falling faster than terminal velocity (say in reentry) air resistance is greater than the force of gravity and you slow down. If you are moving slower than terminal velocity (small rocket at apogee), gravity is stronger than air resistance and you speed up.

A launch runs into the same factors. At any given altitude, the force of gravity will be matched by the force of air resistance at terminal velocity. Go faster, and the drag goes up exponentially (it's squared, IIRC), and go slower to lose more time to gravity drag.

This is a good summary of what terminal velocity is. I understand it as a vertical speed where the forces of air resistance (up) and gravity (down) are equal, netting zero acceleration (absent other forces). But on a launch, I don't understand the significance of air resistance (now a downward force) and gravity (still down) being equivalent. They're not producing a balance netting zero acceleration, they're just both acting with the same force.

The question posed seems to be about the most efficient way to escape the atmosphere, and we seem to have focused on two inefficiences: air resistance and gravity drag. I suppose the solution would involve finding the point at which the marginal gain from avoiding gravity drag by increasing velocity is equal to the marginal loss from increasing air resistance by the same velocity increase.

Link to comment
Share on other sites

Go faster, and the drag goes up exponentially (it's squared, IIRC), and go slower to lose more time to gravity drag.

Pet peeve: That's not exponential in v, it's polynomial in v.

v^n: polynomial

c^v: exponential

I'm sure you know this. I just see rampant misuse of the word exponential.

Link to comment
Share on other sites

@samiamthelaw - the question of why ideal ascents stick close to terminal velocity is largely one of fuel efficiency. Which force would you rather lose the most delta-v to: gravity, drag, or thrust (i.e. getting the hell into space)?

Incidentally, the force balance for a launch is indeed drag-downward, gravity-downward, thrust-upward. Newton's Second Law says that in order to accelerate, you better damn well not be 100% balanced...Tsiolkovsky says the same thing - it's the same equation, just cleverly disguised.

Now, as far as those forces go, gravity slowly decreases as you ascend (g = GM/R^2), drag is dependent on your velocity, along with your mass (which decreases with time based on your fuel flow rate and is the unrealistic part of KSP's drag model) and the density of the atmosphere (which decreases logarithmically as you ascend). Your thrust is constant assuming you don't fiddle with the throttle but the resultant acceleration it produces is going to increase with time on account of your decreasing mass. Basically, there's a cycle going on there - you accelerate faster, your rate of acceleration changes, you get faster, the drag increases, you accelerate slower. The way you minimize the drag acceleration is to ascend, get lighter (i.e. burn fuel), and keep your velocity reasonable by minimizing your rate of acceleration. The only way you can minimize the gravity acceleration is to get higher up as quickly as you can, i.e. by maximizing your rate of acceleration. Obviously you can't do both, so you have to find a happy medium - which happens to be to accelerate at a rate such that your craft remains as close to terminal velocity as manageable.

I don't know if I've made things clearer or muddied them up; if the latter, please accept my apologies. This topic came up on the forums last year - here's the link to that discussion thread:

http://forum.kerbalspaceprogram.com/threads/43721-WTF-is-Terminal-Velocity

That thread is closed, so if you do have further questions on the topic you can either respond here or make a new thread.

Link to comment
Share on other sites

I think derivatives would probably do the trick ... you're looking to get the greatest vertical climb for the minimum delta-v spent.

Drag = Gravity * (v / v-terminal)^2

f = Gravity + Drag = 9.8 * (1 + (v/v-terminal)^2)

Now minimize your losses (Gravity + Drag) per unit speed

f/v = 9.8/v + 9.8*v/(v-t)^2

(f/v)dv = -9.8/v^2 + 9.8/(v-t)^2 = 0 when v = v-t, local minimum

Edited by Kryxal
Link to comment
Share on other sites

I think derivatives would probably do the trick ... you're looking to get the greatest vertical climb for the minimum delta-v spent.

Drag = Gravity * (v / v-terminal)^2

f = Gravity + Drag = 9.8 * (1 + (v/v-terminal)^2)

Now minimize your losses (Gravity + Drag) per unit speed

f/v = 9.8/v + 9.8*v/(v-t)^2

(f/v)dv = -9.8/v^2 + 9.8/(v-t)^2 = 0 when v = v-t, local minimum

I suppose I should point out that gravity is only 9.8 at the surface; it is decreasing with altitude...

Link to comment
Share on other sites

How much does a 9.8 m/s^2 gravity at ASL, 600 KM from pointsource (center of kerbin) degrade over a mere 70 km?

Doing a little Zeno based approximaton here, if ths is even really a thing...

Gravity is halved at ASL+600km

Gravity is 3/4 at +300km

Gravity is 7/8 at +150km

Gravity is 15/16 at +75km

9.8 * 15/16 = 9.185 m/s^2 at 75 km

Link to comment
Share on other sites

Grasshopper... #channel_Caine

Kerbin's Gravitational Parameter (the Gravitational Constant of the Universe times the Planet's Mass, GM, or mu depending on the source) is 3.5316×1012 m3/s2. Its equatorial radius is, as mentioned, 600,000 meters.

Therefore its surface gravity, by definition, is 3.5316×1012 / (600,000)2 = 9.81 m/s2

(g = GM / R2)

At 70,000 meters (670,000 meters from the source), it's:

3.5316×1012 / (670,000)2 = 7.87 m/s2

And at 100 kilometers, it's:

3.5316×1012 / (700,000)2 = 7.21 m/s2

Short answer - it doesn't degrade much, but it degrades enough to not be able to treat the value as a constant. Unless you're doing some kind of instantaneous problem, and even then you'll need to calculate it based on altitude.

Edited by capi3101
Link to comment
Share on other sites

You're right ... oops.

Then again, using it as a declared but not defined constant works well enough, so long as terminal velocity is defined in terms of gravity at that point ... they cancel out in this case.

Link to comment
Share on other sites

One of my roommates told me that, in fluid dynamics, the drag acting upon a body in motion in a fluid is an exponential function of velocity, in contrast to the textbook example of DE's involving drag where drag is a function of velocity squared. Does anyone know how drag is modeled in KSP? I know the drag model here does not take into account reference areas, but at least it is related to velocity. Anyone?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...