Jump to content

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


tavert

Recommended Posts

There is a link to the code, yes, but I'm afraid that I don't have Matlab.

As for taking into account partially filled tanks, the LFB is the only case where it might make sense to do so. How often would a player fiddle with the fuel tanks to get exactly the amount of fuel they want in the tanks?

Though, it might make the difference between an engine narrowly failing on a TWR constraint and passing with less fuel...

Link to comment
Share on other sites

Nice charts. I was thinking about this the other day actually.

That 48-7S is everywhere, as is the Sepratron for low delta-V. Of course we have new engines, and also much bigger payloads in the form of E-class asteroids. I wonder if it would be worth making some sort of charts that take part count into consideration. Either just put a cap, or something like ">90% of optimal performance, minimum part count".

Link to comment
Share on other sites

I agree with your intuition that the LFB is the most likely case for partial fuel loads to really make a significant difference. But I'd prefer to run the numbers and see whether it makes any difference on the margins.

In case this wasn't posted earlier, here is a somewhat refactored faster version of the code that might be slightly easier to understand, though it depends on another mex file for binary search: https://dl.dropboxusercontent.com/u/8244638/margin_of_victory.m

Anyone is welcome to have a go at porting the code to an open-source language - I would recommend Julia for its speed, but if someone would really rather use Python or JavaScript or whatever, go ahead. I'm happy to answer any questions about the calculations or give recommendations for how I think the approach should be updated to account for partial fuel loads. I'm just a bit busy right now to rewrite it myself, and might not check back here all that frequently.

Regarding part counts, that requires a more expensive optimization problem to take into account. It's better displayed in spreadsheet form than in charts. I think there's a link to the Wolfram CDF version earlier in this thread, or I also put together an OpenOffice version of the same thing: https://dl.dropboxusercontent.com/u/8244638/KSP%20Design%20Optimizer.ods

Edited by tavert
Link to comment
Share on other sites

Alright, I re-implemented the core calculation (just for the conventional liquid engines so far, didn't put in LFB, SRB, or ions yet) in Julia: https://dl.dropboxusercontent.com/u/8244638/KSP_engine_charts.jl

I also haven't done all the boring plot labeling or colormap stuff, but now that it's in an open-source language, if you want the plots updated you can mess with the code yourself (please share any additions). Download and install Julia here http://julialang.org/downloads/ - I use the 0.3.0 prerelease, the older version might work too, not sure. Then do the following (the double-backslashes are required if you're on Windows), with MINTWR and ATMPRESSURE replaced with your desired numbers.


cd("C:\\wherever\\you\\put\\the\\code")
include("KSP_engine_charts.jl")
(bestengine, bestmass) = KSP_engine_charts(MINTWR, ATMPRESSURE);

Be patient the very first time it runs, it needs to download a couple of Julia packages.

If you tweak anything in the code (like max number of engines, dv or payload limits or resolution, etc), you have to re-include the file before re-running the function since Julia is based on a just-in-time compiler instead of an interpreter.

Edited by tavert
Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...

Interesting that the crown for TWR=1, 10T and 7000Dv now goes to the KR-2L instead of the NERVA. Glad to see some variation appearing in the `which engine is best` issue.

EDIT : Just installed Julia and ran the chart code. Awesome utility. Should be included in the `extra useful utils` for 1.0 release IMHO

Edited by John FX
Link to comment
Share on other sites

Careful going by these charts, there were some efficiency adjustments in 0.24 that they haven't been updated to reflect. I should try to figure out how to generate them and update since tavert seems to have gone inactive.

I`ll have a look at the code and hopefully the variables are named sensibly and use recognizable units. I remember things like the Ion and stuff got changed. I`ll take a poke about when I have time. I`ll use the current readouts with caution. Thanks for letting me know.

EDIT : There does not seem to be a license attached to the Julia code. Correct me if I am wrong (please) but does that mean I could post an updated version here if I end up adjusting it for the current engines?

EDIT 2 : It seems a well written bit of code with comments! I may have a look and adjust the values for the engines as it looks to be really easy to do.

EDIT 3 : I`ve updated the numbers for the current engines (as stated by the WIKI anyway) and I`ll wait until someone says nay or yea before I post it up. I also set the max No. of engine to 9 to get some more sensible results (one in the centre an 8 symmetry) and uncommented all the engines and SRB. Now to see how that changes the graphs!

Edited by John FX
Link to comment
Share on other sites

Well it has made some difference. The well commented code made it pretty easy. I`ve not seen julia before so I had to trial and error to get rid of some crashes.

The balancing seems to have made some other engines a bit more valid in certain situations.

I`ll message Tavert and see what they say. If I get no reply within a few days I`ll post the updated code here.

EDIT : It would be nice if the KR-2L was not in white though (or the background was not white), I may have a play about and see if I can do anything about that.

Edited by John FX
removed missing images
Link to comment
Share on other sites

John FX, this looks great. I hope that the stars align correctly so that you can post the final versions.

As do I. I`ve figured out how to have a very bright primary green as the colour for `invalid combo`. It does not seem close to any engine colours so I`ll stick with that. It`s obvious when no engine will provide a particular combination at a particular TWR. Tavert hasn`t been on the site since the middle of last month though. Hopefully they will return at some point. I`ll give it a few days but if there is no response I`ll post the code and some images here.

Link to comment
Share on other sites

It would be a shame although as the code was and still is freely downloadable from this thread, presumably for people to make their own images and do stuff with them, I`ll be posting images of TWR graphs whenever I am asked. As you say, they are very good. Tavert wrote a nice bit of code.

If I get no joy in a few days I`ll try Sal or Kasper and see if they can help. It will probably be wednesday or later looking at my upcoming appointments.

Link to comment
Share on other sites

@ John FX, RIC, etc:

...

Anyone is welcome to have a go at porting the code to an open-source language - I would recommend Julia for its speed, but if someone would really rather use Python or JavaScript or whatever, go ahead. I'm happy to answer any questions about the calculations or give recommendations for how I think the approach should be updated to account for partial fuel loads. I'm just a bit busy right now to rewrite it myself, and might not check back here all that frequently...

While, yes, it would be nice to contact tavert, he has explicitly given permission for this to be taken-over by someone else :-)

Link to comment
Share on other sites

That`s good then. I`m off to bed now but here are some charts for a single engine from zero to a TWR of 3 in 0.1 TWR increments.

Javascript is disabled. View full album

EDIT : I plan on posting a series of galleries for all graphs ranging from TWR=0 to TWR=3 in vacuum and TWR=1 to TWR=3 in atmosphere with a single engine and clusters of 5 and 9. I`ll post the graphs of unlimited amounts of engines as well but only on request. It takes an hour or two to make a set...

Here is a Gif of the graphs from TWR=0.1 to TWR=3 for vacuum with a single engine.

5J31XVS.gif

Edited by John FX
Link to comment
Share on other sites

Glad to see that someone is working on updated charts!

There's a point of order, though. The 24-77, Sepratron, and Mark 55 can't be used singly, since these engines are radial mounts. Does this chart take into account that you need at least two for balanced thrust?

Link to comment
Share on other sites

Glad to see that someone is working on updated charts!

There's a point of order, though. The 24-77, Sepratron, and Mark 55 can't be used singly, since these engines are radial mounts. Does this chart take into account that you need at least two for balanced thrust?

This software will allow you to produce comparison charts for multiple engines as well. He just posted the single engine charts as a quick reference while he finishes up.

Best,

-Slashy

Edited by GoSlash27
Link to comment
Share on other sites

This is single-engine, or single-engine-type?

Nice to see these charts get an update.

BTW, I wouldn't work too hard on atmospheric plots. Those are not generally useful except for an Eve ascent -- the atmosphere thins so quickly that it hardly matters anywhere else.

PS: you can put a radial engine in the middle of your spacecraft. Takes a bit of tweaking, but we made single-engine 24-77 SSTOs before the 48-7S was added to the game.

Link to comment
Share on other sites

It was the optimal engine limited to 1. Very good point about the radial engines. I`m working on the charts for up to 5 engines in vacuum at the moment(one central, four symmetry) and I`ll post them soon but I have to tidy up (GF coming round in an hour or two)

I`ll do 2 and 4 at some point for radials (or should I comment out the radials so the charts make more sense for pure rockets/planes?)

Let me know and it shall be.

If there is a particular chart anyone wants I could do that fairly quickly. like unlimited engines TWR=1 in vacuum say or TWR=2 in atmosphere with an even number of engines.

I also think Tavert would be OK with me posting up the code if anyone wants, he was happy for others to work on the code as far as recoding it for different languages and all I have done is update the engine stats for 0.25...

EDIT :

This is single-engine, or single-engine-type?

Nice to see these charts get an update.

BTW, I wouldn't work too hard on atmospheric plots. Those are not generally useful except for an Eve ascent -- the atmosphere thins so quickly that it hardly matters anywhere else.

PS: you can put a radial engine in the middle of your spacecraft. Takes a bit of tweaking, but we made single-engine 24-77 SSTOs before the 48-7S was added to the game.

I always found these charts to be very useful too. You can just see a range of payload and Dv options and just zoom in on which engine you should use.

I could post up the best engine for a particular Dv in Eve atmosphere also as you can set the atmo multiplier when you generate (0-1 vac-kerbin sea level), is Eve sea level 2x Kerbin?

Edited by John FX
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...