Jump to content

Mass-optimal engine type vs delta-V, payload, and min TWR


tavert

Recommended Posts

Charts for the chart throne! I made some more pretty pictures. This is inspired by a post by Salaja on the KSP subreddit a few weeks ago (http://redd.it/1imiw7). The question is for a given delta-V and payload, which engine gives the lowest total craft mass? I've improved upon Salaja's work by also considering solid-fuel rockets and the new-in-0.21 Rockomax 48-7S, taking into account all discrete fuel tank combinations (Oscar-B, Round-8, and multiples of FL-T100), applying a minimum TWR constraint, and making atmospheric-dV charts in addition to vacuum. So, the charts:

Javascript is disabled. View full album

And since the image description is a little long for the forum embedding, I'm copying that here (sorry for the repetition):

This series of charts shows the mass-optimal type of engine (or solid rocket booster, in the case of RT-10 and Sepratron) to use for a given payload mass and delta-V, with later charts requiring a minimum thrust-to-weight ratio (TWR). The convention here is that payload does not include engine mass, fuel mass, or tank mass.

The first half of the album shows vacuum delta-V, the second half shows atmospheric delta-V.

This data considers all possible discrete combinations of fuel tanks (Oscar-B, Round-8, or FL-T100 and its equivalent integer multiples). When a minimum TWR constraint is applied, multiple engines are used if required to meet that constraint. However this data only considers integer multiples of the same type of engine, no mixed-engine combinations are evaluated here.

The engine type shown at each (delta-V, payload) point gives the minimum total craft mass out of any engine and fuel tank combination that meets the minimum TWR constraint for that payload and has at least that amount of delta-V.

For multi-stage vehicles, you can apply this chart to each stage in turn, taking the total mass of all later stages as the payload for the earlier stages.

Hope you like these. Let me know if any questions or comments. I could share the Matlab code I used to generate these, though it's quite messy at the moment.

Update: There is also now an interactive spreadsheet version of this, less pretty but providing more detailed information for each point, you can check it out at http://dl.dropboxusercontent.com/u/8244638/KSP%20Design%20Optimizer%20v02.html.

You'll need the Wolfram CDF Player plugin to use this, see http://www.wolfram.com/cdf-player/

Updated 10/16/13 for KSP 0.22.0. The 48-7S was given 50% higher thrust but maintains the same mass and Isp, so now dominates even more than it used to when you need TWR much higher than 1.

Update 1/26/14: There's now an alternate spreadsheet implementation using the OpenOffice Solver here https://dl.dropboxusercontent.com/u/8244638/KSP%20Design%20Optimizer.ods. You'll need to enable macros in your OpenOffice security settings for this to run. Excel won't load the formulas or macros properly, so OpenOffice is required for this to do anything useful.

Update 4/22/14: Updated for KSP 0.23.5. See this post http://forum.kerbalspaceprogram.com/threads/45155-Mass-optimal-engine-type-vs-delta-V-payload-and-min-TWR?p=1103065&viewfull=1#post1103065 for instructions on how to get and run the source code, if you're interested.

Edited by tavert
Link to comment
Share on other sites

How would one go about figuring out which fuel tanks to use and how many engines? For example, on the atmosphere chart for TWR >= 1.8, I can see that for a 20-ton payload and 2.2 km/s dV, the aerospike turns out to be the best according to the chart. I'm not sure how to go forward from here.

Link to comment
Share on other sites

How would one go about figuring out which fuel tanks to use and how many engines? For example, on the atmosphere chart for TWR >= 1.8, I can see that for a 20-ton payload and 2.2 km/s dV, the aerospike turns out to be the best according to the chart. I'm not sure how to go forward from here.

Good question. I obviously had to calculate the fuel mass associated with every point to generate these plots, but that isn't shown here. Neither is the number of engines needed to satisfy the TWR requirement. The easiest way is to iterate (either in-game using KER/MechJeb, or with a simple dV spreadsheet). Take one aerospike and add fuel until you reach 2.2 km/s dV, if TWR drops below the minimum you specified, add another, if dV drops below 2.2 km/s when you add the second aerospike then add more fuel, and repeat until you have both the dV and TWR you wanted. You can be more scientific with this by inverting the rocket equation, I could walk through that if you'd like.

Edited by tavert
Link to comment
Share on other sites

I'm curious about one thing. How can an engine deliver a payload lighter than itself?

Anyway, these are very useful. I thought the Rockomax 48-7S was a really good engine, but these graphs really shows how versatile it is.

Link to comment
Share on other sites

I'm curious about one thing. How can an engine deliver a payload lighter than itself?

Anyway, these are very useful. I thought the Rockomax 48-7S was a really good engine, but these graphs really shows how versatile it is.

Payload does not include the engine, fuel, or fuel tank mass (edited the OP/image description to clarify this). Agreed, the LV-909 has really been displaced by the 48-7S for the vast majority of small craft. The 48-7S even competes with the T30 and Mainsail in a few places (basically filling in the gaps where adding another of the bigger engines would be too heavy and more thrust than you asked for), though you'll need quite a few of the 48-7S' in that regime.

Edited by tavert
Link to comment
Share on other sites

Hmm, what accounts for the jaggyness of the graphs? Discontinuous available fueltank sizes?

Honestly I'm pretty surprised at how good aerospikes are rated... I'd be interested to figure out what the breakeven altitude between an aerospike and an LV-T30 is. Also, the paucity of Mainsail representation is about what I expected due to high mass and not-great ISP. Do the Skipper and Poodle not even fit on the chart? I like using the former for central mid-ascent stages, or outer asparagus-ing where I can't be bothered to make a cluster.

Link to comment
Share on other sites

So, if I'm reading this correctly, since optimal TWR for launch from Kerbin is 2.0, my launchers should start with aerospikes. Except very small payloads get the 48-7S. I never would have thought of it this way.

Would it be possible to alter the legend slightly, so that each engine has a discrete color. The color gradient makes it slightly confusing, especially between the orange-ish aerospike and slightly more orange-ish LV-T30.

I've been wondering about a tool like this for about a year, but lacked the math to figure it out. Congratulations! Was it a lot of effort? I don't even know. If Squad ever changes the engine performance figures, would it be hard to update these graphs?

Link to comment
Share on other sites

I'm confused how with large payloads needing TWR > 0.9 for 6 km/s deltaV, you recommend the LV-N, but bump the TWR up to 1.0 and you now need a T30 -- whereas if you need about 5200 m/s you should stick to the LV-N in both cases.

Something is flawed about my understanding of how things work for that to become the case: I'd think that (excepting integer effects) the higher-Isp engine should always win if you add deltaV requirement.

(PS: nice attempt to take down CaptainArbitrary there. I had the same argument a few months ago, with the same conclusion, though you were better able to cite actual rocket scientists.)

Edited by numerobis
Link to comment
Share on other sites

Hmm, what accounts for the jaggyness of the graphs? Discontinuous available fueltank sizes?

Honestly I'm pretty surprised at how good aerospikes are rated... I'd be interested to figure out what the breakeven altitude between an aerospike and an LV-T30 is. Also, the paucity of Mainsail representation is about what I expected due to high mass and not-great ISP. Do the Skipper and Poodle not even fit on the chart? I like using the former for central mid-ascent stages, or outer asparagus-ing where I can't be bothered to make a cluster.

Discontinuity in fuel tanks and number of engines to meet the TWR requirement, yes.

Remember that atmospheric pressure drops off exponentially with altitude. LV-N Isp matches aerospike Isp before even 2km altitude, IIRC. I could make more plots for different atmospheric pressures.

The Skipper and Poodle get outclassed by multiples of 48-7S or LV-909. They're never mass-optimal, only useful for part count reasons.

Link to comment
Share on other sites

So, if I'm reading this correctly, since optimal TWR for launch from Kerbin is 2.0, my launchers should start with aerospikes. Except very small payloads get the 48-7S. I never would have thought of it this way.

Would it be possible to alter the legend slightly, so that each engine has a discrete color. The color gradient makes it slightly confusing, especially between the orange-ish aerospike and slightly more orange-ish LV-T30.

I've been wondering about a tool like this for about a year, but lacked the math to figure it out. Congratulations! Was it a lot of effort? I don't even know. If Squad ever changes the engine performance figures, would it be hard to update these graphs?

You don't stay at 1 atmospheric pressure for very long, so only use aerospikes on short early stages. It's also recommended to have a takeoff TWR of a little lower than 2, since your TWR will increase as you burn off fuel.

Yeah I can change the colorbar to discrete colors and re-upload, sorry if that was confusing.

It was a bit of code, but not too bad. Takes a long time to run only because I'm generating the data at very high resolution (very high maximum number of fuel tanks) to make the plots look nice. If the performance changes, I just re-run my script, no problem at all. Slightly more complicated if they change throttle to map to fuel flow instead of thrust, which would decrease atmospheric thrust proportionally to Isp, but I could handle that too with a few more lines of code changes.

Link to comment
Share on other sites

I'm confused how with large payloads needing TWR > 0.9 for 6 km/s deltaV, you recommend the LV-N, but bump the TWR up to 1.0 and you now need a T30 -- whereas if you need about 5200 m/s you should stick to the LV-N in both cases.

Something is flawed about my understanding of how things work for that to become the case: I'd think that (excepting integer effects) the higher-Isp engine should always win if you add deltaV requirement.

(PS: nice attempt to take down CaptainArbitrary there. I had the same argument a few months ago, with the same conclusion, though you were better able to cite actual rocket scientists.)

Due to the LV-N's bad TWR, its max attainable delta-V decreases faster than the other engines as you increase TWR requirement. The max attainable delta-V for an LV-N at TWR = 1 is 6477 m/s assuming infinitely divisible mass-ratio 9 fuel tanks, vs 6611 m/s for the T30. I think it might be the integer effects bumping up the craft mass close to the max-attainable dV, since the fuel tanks aren't infinitely divisible.

Funny you noticed that. He's a smart guy, just stubbornly sticking to an incorrect definition of weight. On some other reddit threads I was quoting the ISO definition and NIST publications at him.

Edit: looked at the numbers for an example case. 20 tons payload, 6 km/s vacuum, TWR >= 1. For an LV-N, this requires about 346.5 tons of fuel and 106 engines, total mass about 648 tons. For a T30, this requires something like 492 tons of fuel and 28 engines, total mass 608.5 tons. These numbers aren't exact from the full optimization data, they come from just fiddling in a spreadsheet, but they're close.

Edited by tavert
Link to comment
Share on other sites

Some redditors wanted to see my Matlab code, so I cleaned it up and posted it here: https://dl.dropboxusercontent.com/u/8244638/engine_charts.m Hopefully it's commented enough to understand, though the indexing in the heart of the calculation (lines 253-280) gets kinda complicated. I can walk through an explanation of the steps here, feel free to ask what I'm doing.

To run it, you'll first need to grab this: https://dl.dropboxusercontent.com/u/8244638/cummax.c

And run 'mex cummax.c' in Matlab. This is a tiny little mex file to do a running-max operation, since the for-loop is faster in compiled C than in Matlab.

Edited by tavert
Link to comment
Share on other sites

Due to the LV-N's bad TWR, its max attainable delta-V decreases faster than the other engines as you increase TWR requirement. The max attainable delta-V for an LV-N at TWR = 1 is 6477 m/s assuming infinitely divisible mass-ratio 9 fuel tanks, vs 6611 m/s for the T30. I think it might be the integer effects bumping up the craft mass close to the max-attainable dV, since the fuel tanks aren't infinitely divisible.

I'm just confused how the LV-N can be best at 5 km/s but not best at 6 km/s, at TWR 1.0. My apparently-flawed intuition is that the longer you burn, the more your high Isp engine has a chance to overcome its high dry mass.

Link to comment
Share on other sites

One thing to note: certain engines dominate others, by which I mean that n of Engine1 have at least as much thrust, at least as high Isp, and no more mass than 1 of Engine2. So any solution that says "use m Engine2" could be replaced by a better solution that says "use n*m Engine1".

- 6x 48-7S dominate the Mark55

- T30 dominates the T45

- 5x LV-909 dominate the Poodle

- 40x 48-7S dominate the Skipper

There are reasons to use the dominated parts, of course, but efficiency ain't one of them.

Edited by numerobis
Link to comment
Share on other sites

I'm just confused how the LV-N can be best at 5 km/s but not best at 6 km/s, at TWR 1.0. My apparently-flawed intuition is that the longer you burn, the more your high Isp engine has a chance to overcome its high dry mass.

The engine's TWR enters into how many of the engines you need to meet the TWR requirement.


num_engines = ceil(min_twr*g*(payload_mass + full_tank_mass) ./ ...
(engine_thrust_each - min_twr*g*engine_mass_each))

As TWR goes up, that denominator goes down. When you add engines, you need to add fuel to get the same dV. Starts adding up quickly when you're asking for something close to the limit of what that engine can provide.

One thing to note: certain engines dominate others, by which I mean that n of Engine1 have at least as much thrust, at least as high Isp, and no more mass than 1 of Engine2. So any solution that says "use m Engine2" could be replaced by a better solution that says "use n*m Engine1".

- 6x 48-7S dominate the Mark55

- T30 dominates the T45

- 5x LV-909 dominate the Poodle

- 40x 48-7S dominate the Skipper

There are reasons to use the dominated parts, of course, but efficiency ain't one of them.

Yeah, I've been explaining this to people on Reddit all day. I added a part-count constraint to the code so you can generate more-practical results, just didn't apply it to generate the full data.

Another one is 1x Aerospike dominates 3x LV-909, though they're exactly tied in vacuum dV. My code doesn't resolve ties in any smart way, so there are actually some regions where my data shows to use 3x 909's but an aerospike would be better (unless you need gimbaling). Some common sense required.

Edited by tavert
Link to comment
Share on other sites

Seeing the equations, I just remembered that I wrote this same code a while ago; that's the single script that grew into the KSP-scripts. I couldn't find a closed-form solution for the number of engines and number of tanks, so I just iterated.

I tried to do a full branch-and-bound search to find optimal multi-stage rockets; it got hairy. But the single-stage, single-engine-type pass worked quite well. I might be tempted to revive it to present an optimal single-stage, multi-engine-type solution. For instance: use 10 aerospikes and one LV-909.

Link to comment
Share on other sites

Seeing the equations, I just remembered that I wrote this same code a while ago; that's the single script that grew into the KSP-scripts. I couldn't find a closed-form solution for the number of engines and number of tanks, so I just iterated.

I tried to do a full branch-and-bound search to find optimal multi-stage rockets; it got hairy. But the single-stage, single-engine-type pass worked quite well. I might be tempted to revive it to present an optimal single-stage, multi-engine-type solution. For instance: use 10 aerospikes and one LV-909.

I remember trying to run that once, it didn't get to anything interesting before I got impatient and stopped it.

With a single stage and single engine type my method is reasonably closed-form. It's table-driven for engine type versus amount of fuel, but the sample points I use for amount of fuel are based on a Pareto analysis of fuel-tank combinations that I do first. Here's a description that I posted on Reddit (http://www.reddit.com/r/KerbalSpaceProgram/comments/1jy4dj/massoptimal_engine_type_vs_deltav_payload_and_min/cbk2obp):

You pretty much have to consider the discrete fuel tank combinations. The way I did it which worked pretty well was pre-compute all combinations of FLT100, Oscar-B, and Round-8 tanks (up to some max number of each, really high for FLT100 but only 10 for Oscar-B and Round-8), sort by wet mass, and determine the max-fuel combination for each wet mass. This is what I call the Pareto front for the fuel tanks in my code.

You know that any combination of fuel tanks other than the Pareto front is suboptimal, since you can either reduce wet mass while maintaining fuel mass (for example, 9 Round-8's can be replaced with 1 FL-T200), or you can increase fuel mass while maintaining wet mass (replacing 3 Round-8's and 2 Oscar-B's with 1 FL-T100).

Then make a table of engine type versus amount of fuel, using only the values from the fuel-tank Pareto front for the fuel axis. Since you know how much fuel and tank mass each of those points has, you can calculate the minimum number of engines for each point as a function of TWR, rounding up to an integer.

The multi-stage and/or multi-engine-type problem is a very interesting one, I can't think of anything better than posing it as an integer nonlinear program. I haven't written out too much of the math on that, but whether or not it will be tractable will depend highly on whether the continuous-relaxation nonlinear program is convex or not. With all the logarithms from the rocket equation in there I have a suspicion you might be able to formulate it as a geometric programming problem, but like I said I haven't really looked at the math in detail.

If the continuous relaxation of the problem is convex, then there are good algorithms and software like https://projects.coin-or.org/Bonmin. If the continuous relaxation of the problem is not convex though, then the bounds you get from the nonlinear programming solver are not as useful since even the continuous relaxation can have local optima, and you have to branch on the continuous variables even in the relaxed problem. Kind of messy, there is code to do it (https://projects.coin-or.org/Couenne) but it's quite a bit slower.

Edited by tavert
Link to comment
Share on other sites

Yeah, my optimization script isn't prime time at all. It was working OK when I gave it the length and altitude of each stage, but then I decided to make it optimize the staging too, and that never quite worked. I gave up on it and just started building rockets by hand again (particularly with a jet first stage, which I never coded up).

The optimization problem with a single stage, multiple engine types, is certainly brute-force tractable for a given point in your plots (particularly with a part limit). Doing the full 3d would take a long time.

Edited by numerobis
Link to comment
Share on other sites

The optimization problem with a single stage, multiple engine types, is certainly brute-force tractable for a given point in your plots (particularly with a part limit). Doing the full 3d would take a long time.

Even for a single payload mass, you'd have roughly max number of each engine to the power of number of engine types... and you'd either be assuming infinitely divisible tanks to get exactly a required dV, or you'd have to walk through the Pareto list of fuel tank combinations until you get to the dV you wanted.

Link to comment
Share on other sites

Looked at the math a little, couldn't get it into a geometric program. As far as I can figure the delta-V constraint is non-convex. But the nonlinear integer programming approach might actually end up relatively simple, at least for a single stage and only considering liquid-fuel engines. The design variables are the number of each type of fuel tank and the number of each type of engine. Total mass, dry mass, thrust, and fuel flow rate mdot are then affine functions of the design variables. Objective function is total mass, TWR constraint is a linear inequality (for fixed min_twr): thrust >= g*min_twr*total_mass, delta-V constraint is a nonlinear inequality: thrust * ln(total_mass / dry_mass) >= min_deltav*mdot.

With a little bit of effort we could code this up in an OSiL file (like this example https://projects.coin-or.org/OS/browser/releases/2.7.0/OS/data/osilFiles/bonminEx1.osil) and use Couenne from the command line, maybe make a Python wrapper for it. There are few enough variables that this might work pretty well.

Link to comment
Share on other sites

I gotta quit getting distracted by KSP stuff or I'll never get any real work done again... but anyway, my OSiL idea worked even better than I hoped it would. Couenne is slow like I thought it would be, but Bonmin is getting really good results, despite the nonconvexity of the continuous relaxation of the problem...

If you want to play with this, you'll need to download the Optimization Services binaries (they're about 50 megs for the Windows ones, a bit big but not too terrible) here: https://projects.coin-or.org/OS

The first test case I ran wound up being pretty interesting: 10 tons payload, TWR >= 1, vacuum delta-V 4000 m/s. My charts say LV-N's win here, but a little less payload and aerospikes would win, a little more payload and T30's would win. The single-engine-type optimum is 9 LV-N's and 22 tons of fuel, for a total mass of 55 tons.

Using this https://dl.dropboxusercontent.com/u/8244638/mixed_engines.osil OSiL file I just wrote (see https://dl.dropboxusercontent.com/u/8244638/mixed_engines_commented.osil for a version with comments, the OS parser doesn't like having comments in the XML), and running "OSSolverService osil mixed_engines.osil", it spits out a result that says to use 2 LV-T30's, 5 Rocko 48-7S's, with just under 36 tons of fuel (71 FL-T100's, 2 Round-8's and 2 Oscar-B's), giving a total craft mass of 53.367 tons and nearly the same TWR and delta-V. Success!

Link to comment
Share on other sites

Even for a single payload mass, you'd have roughly max number of each engine to the power of number of engine types... and you'd either be assuming infinitely divisible tanks to get exactly a required dV, or you'd have to walk through the Pareto list of fuel tank combinations until you get to the dV you wanted.

By brute force I meant trying all combinations, indeed.

I gotta quit getting distracted by KSP stuff or I'll never get any real work done again

That's why my script doesn't work ;)

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

There was a request by PotatoOverdose in another thread to show the margin of victory relative to the second-best engine, so I'll put these links up here.

Second-best engine type: http://imgur.com/a/Hz4XV

Margin of victory (difference in craft mass between best and second best engine types, divided by craft mass with best engine type): http://imgur.com/a/3D3ux

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