Jump to content

Hoverslam equations?


Recommended Posts

The question is what are the maths behind a suicide burn sorry I meant hoverslam, and also I would like an example because the ones I've seen I cannot understand 

oh welcome to the 100 club Kerbin orbiter!

Edited by kerbinorbiter
Oh 100th post
Link to comment
Share on other sites

 

26 minutes ago, kerbinorbiter said:

The question is what are the maths behind a suicide burn sorry I meant hoverslam, and also I would like an example because the ones I've seen I cannot understand

Well, there's this kOS script that someone put together, does that fit the bill?

What kind of math are you looking for?  i.e. what exactly is the problem that you're trying to solve?

Link to comment
Share on other sites

1 minute ago, Snark said:

 

Well, there's this kOS script that someone put together, does that fit the bill?

What kind of math are you looking for?  i.e. what exactly is the problem that you're trying to solve?

Coincidentally I'm looking to create a KOS script 

the problem im trying to solve is what altitude do I need to burn at with a thrust of 300Kn at sea level 

on kerbin

Edited by kerbinorbiter
Link to comment
Share on other sites

9 minutes ago, kerbinorbiter said:

Coincidentally I'm looking to create a KOS script 

the problem im trying to solve is what altitude do I need to burn at with a thrust of 300Kn at sea level 

on kerbin

It's not that simple.  If you're trying to solve an actual game problem rather than simply wanting to do some theoretical analysis, then you'll have to take a lot of factors into account:

  • How is the ship moving already?  (both horizontal and vertical components)
  • What's the terrain under the ship?  (If you're not doing a straight-vertical descent, and you're not landing on perfectly flat terrain, then you have to project your impact point under thrust so you'll know how high the ground will be at the point where you land.)
  • What's the fuel consumption rate?  Your acceleration will change as you burn fuel and thereby lose mass.
  • If you're doing it in atmosphere:  What's the drag on your ship?  Which depends on a complicated interaction of the shape of your ship, the orientation during descent, the particular atmospheric characteristics where you're landing, etc.
  • How's the Isp curve on your engines?  Depending on the pressure gradient, your velocity, etc. it's possible there could be a significant change to your engine thrust as you descend.
  • etc.

Of course you can always use approximations, and go for a "pretty good" solution that ignores or very roughly approximates various factors such as the above-- just pointing out that this is a non-trivial problem to compute.  Not saying it can't be done, just... it's not a matter of plugging in a couple of equations and then done.

Link to comment
Share on other sites

 

Maybe a more empirical approach works for you. Do a few attempt to execute the maneuver by yourself to get a idea of what commands are necessary and then try to write to replicate it with a script. Refine and iterate until you get a reliable and consistent result.

Link to comment
Share on other sites

You can achieve a pretty good first approximation answer by doing some with high school physics.

First you need the burn time to zero velocity which will be V0*F/M. derivation is left as an exercise for the reader. Then drop that into V0t-Mt2/(2F), again derivation left as an exercise, to get the distance to stop. Add that to the height above ASL of the terrain and Jeb's your pilot.

Your second approximation answer is less simple. As Snark has mentioned you will have to factor in some heavier math because mass and force are not constant. The trivial case of no atmospheric change in ISP is ignored for the moment. This will require probably require some of the terror math </legion voice>Ordinary Differential Equations</legion voice>... whimper.  You can for the most part use a basic linear approximation for the isp curve. The mass is the same... Okay I can do this. Just not right yet. I'm going to need some space. Here, hold my beer.

Basically, this approximation and it's kin are the reason why Rocket Science is synonymous with smart people only. ODEs and matrix ODEs are not some of the nicest thing to work with, or learn about.

Your third approximation answer does not exist. No it doesn't. 'cause drag is voodoo mathamagic. So forget about it. It just doesn't exist.

Edited by steuben
Link to comment
Share on other sites

55 minutes ago, kerbinorbiter said:

Yeah that's how I do things trial and error I did do an attempt yesterday with the ratio 

for every 8 m/s add 100m to the burn time I got an altitude of around 142m Radar alt

Okay, so if you're just trial-and-erroring it, then yeah, you can do better than that with some math by making a bunch of simplifying assumptions.  As steuben points out,

18 minutes ago, steuben said:

First you need the burn time to zero velocity which will be V0*F/M. derivation is left as an exercise for the reader. Then drop that into V0t-Mt2/(2F), again derivation left as an exercise, to get the distance to stop. Add that to the height above ASL of the terrain and Jeb's your pilot.

^ This.  It's not too hard (tedious, but needs only algebra, no fancy differential equations or anything) to come up with a formula where you plug in the following:

  • local gravity
  • ship mass + engine thrust  (these two numbers will give you your acceleration)
  • current height above terrain
  • current downward velocity

...which will spit out "how many meters above terrain should I turn on my engine for the burn."

That ought to do a lot better than just trial and error.  However, it's going to be making several assumptions:

  • that you're going straight down
  • that your burn is short enough that the fuel mass you burn will be very small relative to the total mass of your ship
  • that the effects of aerodynamics are minimal (i.e. that you're flying something dense, streamlined, and not going too fast)

...The first one might be valid, and the second one might not be too bad... but the third one could be potentially significant.  Depends completely on ship design.  And there's no good way to approximate it, either.  Drag is complicated.

 

Link to comment
Share on other sites

the ratio i get is 8:100 8m/s=100m burn altitude when i do this however i get a 142m height above altitude radar after i reach 0 speed

however i should test it with a orbital-class rocket though because that was a grasshopper readout

Edited by kerbinorbiter
Link to comment
Share on other sites

right I forgot local g... so that turns the first approx. answer for distance into

V0t-Mt2/(2F)+1/2glt

for a straight down drop.

extension for any thing else is pretty easy and left as an exercise for the reader.

Link to comment
Share on other sites

44 minutes ago, steuben said:

You can achieve a pretty good first approximation answer by doing some with high school physics.

First you need the burn time to zero velocity which will be V0*F/M. derivation is left as an exercise for the reader. Then drop that into V0t-Mt2/(2F) to get the distance to stop. Add that to the height above ASL of the terrain and Jeb's your pilot.

why not V²=Vi²+2ad  d= Vi²/2a  Where a={(T/m)-g}  (as a first approximation trajectory is exactly vertical and mass is constant)

which may not be so bad for a booster landing back at Kerbin SpaceX style, but if we consider that mass decrease, the actual distance will be less than we calculated. We can still use the formula if we use the average acceleration (not so simple because variation is not linear).

Adding other factors (drag, change of Isp, fuel consumption, attitude) can make the calculations pretty quickly. So I'd start with this and see how good it works out before considering such factor.

Edited by Spricigo
Link to comment
Share on other sites

2 hours ago, Snark said:

It's not that simple.  If you're trying to solve an actual game problem rather than simply wanting to do some theoretical analysis, then you'll have to take a lot of factors into account:

  • How is the ship moving already?  (both horizontal and vertical components)
  • What's the terrain under the ship?  (If you're not doing a straight-vertical descent, and you're not landing on perfectly flat terrain, then you have to project your impact point under thrust so you'll know how high the ground will be at the point where you land.)
  • What's the fuel consumption rate?  Your acceleration will change as you burn fuel and thereby lose mass.
  • If you're doing it in atmosphere:  What's the drag on your ship?  Which depends on a complicated interaction of the shape of your ship, the orientation during descent, the particular atmospheric characteristics where you're landing, etc.
  • How's the Isp curve on your engines?  Depending on the pressure gradient, your velocity, etc. it's possible there could be a significant change to your engine thrust as you descend.
  • etc.

Of course you can always use approximations, and go for a "pretty good" solution that ignores or very roughly approximates various factors such as the above-- just pointing out that this is a non-trivial problem to compute.  Not saying it can't be done, just... it's not a matter of plugging in a couple of equations and then done.

Because I didn't want to bother with the algebra and the messy situation here, I went with a simulation in the computer's "head", running constantly in a loop in a loop, where each pass of the inner loop does this:

outer loop:

set dT to some_small_number_like_0.5.

inner loop:

Apply dT's worth of thrust in reverse-velocity direction (using surface-relative velocity, of course).  Divide by ship's current mass to get the acceleration due to thrust.

Apply gravity's acceleration downwards over dT seconds at gravity's strength at ship's altitude.

Calculate new velocity based on those two accelerations.

Apply that velocity over dT seconds, to the position.

Use ISP to calculate how much mass will have been lost at max thrust for dT seconds, and subtract that from ship's current mass.

If direction of velocity has just flipped, then exit the loop because you just passed the point where the burn will have stopped your movement.

else repeat inner loop.

Now that loop is over, look at the calculated final position it came up with.  If it's really close to the terrain height at that position, you'd better start the burn.  Else repeat outer loop.

 

That solves the problem of not knowing the terrain at the landing spot, by actually predicting the landing spot with a simulation.  This was made for places without atmosphere though.  To make it work with an atmosphere, you'd have to add the ability to vary the ISP based on atmosphere at current simulated altitude (which I can do), and add an anti-thrust force due to the drag at current simulated velocity at simulated atmosphere level at altitude (which I have no clue how to do so that's where I stopped trying.  The drag will vary massively depending on the ship's shape and attitude.  And if you have the grid-fins that SpaceX uses, then I don't know how in the heck to put that in the simulation.).

Link to comment
Share on other sites

1 hour ago, Steven Mading said:

snip

your method is the numerical analyses of the problem. It or algebra should lead to same conclusion, with imprecision depending on the approximations done. 

Drag is probably the most unpredictable factor by far.  So probably the best to face with guesswork rather than with maths.

Edited by Spricigo
Link to comment
Share on other sites

dang this is an interesting problem... time to break out the power tools. Now where is that copy of Maple V?... Behold the Power of Math!<dramatic thunder and lightning> A closed form function will beat a numeric approximation and can be recalculated if the engine and other hings change easily rather than rerunning the approximation. Besides the Newton fractal is a pretty good reason to not fully trust numerical methods.

Cause i might be chasing a much more general case than i need to... but who cares 'cause Math!

Question... that 300kN engine is it stock?  if so which one... though the equation set can be generalised.

Question... will it be landing in an atmosphere? if yes and a non-stock engine what is the ISP spread like?

Question... from an arbitrary velocity relative to the surface? or nearly vertical? though again the equation set can be generalised.

Question... will the script cycle constantly or will it just grab the value and run with it?

Link to comment
Share on other sites

7 hours ago, Spricigo said:

your method is the numerical analyses of the problem. It or algebra should lead to same conclusion, with imprecision depending on the approximations done. 

Drag is probably the most unpredictable factor by far.  So probably the best to face with guesswork rather than with maths.

The solution probably involves re-calculating the results on the fly as you suicide burn, rather than just predicting when to start the suicide burn and assuming full throttle from then on.  Because drag will not be predictable and will change dynamically in flight, this is the only technique that has any hope.  Your initial estimate of when to start has to slightly over-estimate the needed burn time, and then you dynamically adjust the throttle as you burn based on what your new predictions are saying at the moment.  Thus if you have an engine that can only throttle down to, say, 70%, and your initial estimate at 100% throttle would have ended up slightly above the launchpad (and then have to drop from there, too far, because you can't descend at 10% throttle like you'd have to), you can adjust that problem before you get to it, starting to throttle back to maybe 95% or so from that high up, so you don't have to try to throttle down to 10% at the very end when you stop too high up.  Instead the need to throttle a bit less than full gets spread out over the whole descent instead of having to happen all at the very end.

You start burning, then re-run the prediction, and as it starts claiming you'll stop quite a ways above the ground instead of where you first predicted (because it didn't account for as much drag as there ended up being), you can start throttling back a bit well before you reach that point.

Because I would want to eventually have that whole system in place, that's why I went with the numerical approximation technique - with only a bit of editing later, it should allow me to make it capable of reacting to changing drag conditions on the fly after the initial prediction.

 

Edited by Steven Mading
Link to comment
Share on other sites

Yes it will recalculate it will be in atmo the ISP is 215 to 255 and its stock

the dry mass is about 21.818t

the resources left are 

680 liquid fuel

860 oxidiser 

(also ill credit you guys in the releases of the code)

Edited by kerbinorbiter
Link to comment
Share on other sites

Given the script will be regularly checking a basic calculation with binary logic should work. The engine thrust at ASL will be used for the calculation.

if A <=v2IvM/2(FvIa-gIvM) + AT fire engine.

I suspect the engine will knock a fair bit around A. It will also hit 0 m/s above the ground since the thrust is calibrated to ASL rather then current altitude. If it isn't paying attention will probably hit the ground. So a safety check when the speed is around 10 m/s is recommended. But it will probably knock as well around 0 m/s

with:
A - altitude ASL
AT - altitude of terrain
v - current velocity
Iv - ISP in vacuum
Ia - ISP at ASL
FV - Force in vacuum
M - mass
g - local g

Spoiler

Derivation is as follows:

FV=m'gIV
Fa=m'gIa
=FVIa/IV

d'' =Fa/M
=FVIa/IVM

0=d'-(d''-g)t
t=d'/(d''-g)

d=d't-1/2(d''-g)t2
d=d'2/(d''-g)-d'2/2(d''-g)
d=d'2/2(d''-g)
d=d'2/2(FVIa/IVM-g)
d=d'2/2(FVIa/IVM-g)
d=d'2IVM/2(FVIa-IVMg)

I've dropped some of the basic symbol shuffling for clarity. Feel free to check my symbol shuffling, I've been known to drop stuff and reverse signs as I go along.

 

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...