Jump to content

Optimal engine charts for 1.0.2


Meithan

Recommended Posts

Nice!

One of the nicest interaction possibilities would be a hover-over that shows the total mass estimate Or perhaps a second 2D chart for a selected engine, dV versus payload with a key for total mass.

Similar to what I as thinking: a small tooltip when hovering over the chart showing, say, the top 3 engines for that point and the total masses they yield (sometimes the runner-ups are very close, and may be more practical than the top engine). Then, on clicking on the chart, a second line plot would be generated with the full total mass vs. dv curves for the payload of the clicked point.

I also want to display the mass breakdown (how much is payload, tanks, propellant and engines) for a given solution somewhere.

Link to comment
Share on other sites

UPDATE: I just finished the core functionality of the webapp for engine charts (no total mass plots yet). Try it out and tell me what you guys think (bug reports appreciated!):

http://meithan.x10.mx/KSP/engines/

Mouse over the chart to see details about that location (below the chart). Currently shows the best and runner-up engines, indicating how many engines are required and the total mass of the ship for each case. Note that this recalculates the mass comparisons for that point, so if you're plotting the low-resolution chart you'll still get high-resolution results here.

Since it's doing the computation for all engines now it's a bit slower than previously. Still, it's under a second for me, which I think is not too bad.

To do:

  • Improve how the values for a (payload,dv) pair are shown on mouseover (mouse-following tooltip on top of chart, maybe?)
  • Zoom in/out buttons
  • Click-and-drag zoom in directly on chart
  • Show more detailed info for a (payload,dv) pair, e.g., total mass breakdown (how much is payload, fuel, tanks, engines)
  • Total mass plots (when clicking on chart)
  • Optimize computation

Link to comment
Share on other sites

UPDATE: I just finished the core functionality of the webapp for engine charts (no total mass plots yet). Try it out and tell me what you guys think (bug reports appreciated!)

This is fabulous! Great work and definitely above and beyond the call of duty.

I can't wait to see the additional features you have planned.

Happy landings!

Link to comment
Share on other sites

How many minutes should it take before something appears after you click Calculate (with the default settings)?

Minutes? The chart is computed in about 600 miliseconds on my computer. What are the specs of your computer? OS, browser?

Link to comment
Share on other sites

Minutes? The chart is computed in about 600 miliseconds on my computer. What are the specs of your computer? OS, browser?

iMac Quad Core 3.4 GHz Intel Core i7. Mac OSX 10.9.5, Safari browser 7.1.6.

Link to comment
Share on other sites

I forgot to put in both minimum and maximum values. You might have done the same.

Yes, it's not doing any input checks at the moment, and will simply produce NaNs and show a blank chart if data is missing. Checks and an alert on missing data added to todo list.

You can also hit "Load defaults" to set the payload range to 0-20 t and the dv range to 0-5000 m/s, with a min TWR of 0.5.

Link to comment
Share on other sites

Meithan,

Looks good from my house.

No weird behavior to report.

Fantastic. I'm a little busy right now but I'll get to those remaining features soon. When I feel it's ready enough, I'll release the webapp in the Tools and Applications section of the Add-ons forum (and post a link in this thread and update the OP).

Note that there already exist some tools that provide similar functionality to what I'm doing:

  • An engine comparsion based on cfg file parsing (python) Python script that, given dv and TWR requirements, computes the payload fraction for all the engines (under either vacuum or 1 atm conditions). However, the calculation assumes only one engine, and so not all solutions are found.
  • The Online engine cluster calculator is used "to work out an engine cluster layout for a center stack and attached booster stacks required for liftoff", where the booster stacks as asparagus-staged. It's nice but provides a different kind of funcionality. It hasn't been updated to 1.0, though.
  • Finally, there's the KSP Optimal Rocket Calculator, which is a brilliant web tool that actually builds the rocket "on paper" by searching through many part combinations and finding that which optimizes mass (or cost or part count). The search is multi-stage, so it'll yield actual practical solutions. While this completely solves the optimal design problem, I feel my tool is still useful in giving a general impression (and does so graphically) of the regions where each engine is optimal or close to optimal, without fully designing the rocket for the player. It's more of a guideline tool than one that solves the problem for you.

- - - Updated - - -

Correct. Load page. Load defaults. Calculate. ...nothing happens.

It DOES work in the Firefox 37.0.2 browser on my system.

It seems to be a Safari issue then (it seems to work on Mac using Chrome).

Could you show me the output of the JavaScript console? It seems that option-command-C opens it; see here. Let's start with that. If the script runs, it'll output something like this:

0 20 0 5000 0.5
Array[18]
Initializations: 3.670999998576008 ms
Tick calculation: 29.225999998743646 ms
Chart computation: 576.4839999901596 ms
Image loading and scaling: 17.947000000276603 ms
SCRIPT DONE

Edited by Meithan
Link to comment
Share on other sites

...It seems to be a Safari issue then (it seems to work on Mac using Chrome).

Could you show me the output of the JavaScript console? It seems that option-command-C opens it; see here. Let's start with that...

When I press Calculate, the Console shows:

[Error] ReferenceError: Can't find variable: performance

plot_chart (engines, line 254)

onclick (engines, line 606)

Link to comment
Share on other sites

When I press Calculate, the Console shows:

[Error] ReferenceError: Can't find variable: performance

plot_chart (engines, line 254)

onclick (engines, line 606)

Ah, it seems Safari doesn't support what I'm using in the script to measure execution time (performance.now()). It's an easy fix (either use Date.now() instead, since I don't really need microsecond resolution, or simply disable the timing report for Safari). I'll get to it when I get back.

Link to comment
Share on other sites

When I press Calculate, the Console shows:

[Error] ReferenceError: Can't find variable: performance

plot_chart (engines, line 254)

onclick (engines, line 606)

Alright, it should be fixed. Tell me if it works for you on Safari.

Great tool for players looking to optimize their rockets, thanks for making and sharing it, Meithan.

It's my pleasure! Really, I'm learning a lot doing this.

Link to comment
Share on other sites

It now functions in Safari. Good work!

Great to hear that :).

Any chance of adding the ability to make atmospheric charts with the tool? Or am I stupidly not seeing the option?

Your eyesight is fine, it's not implemented in the webapp yet. I'll do it soon.

Link to comment
Share on other sites

Great work on the site Meithan. It works perfectly so far in Chrome on Linux.

Any chance of adding the ability to make atmospheric charts with the tool? Or am I stupidly not seeing the option?

Haha, I was wondering this exact same thing, including that I might be missing it.

Link to comment
Share on other sites

Yep, it's going to be much better than these static images. I'm working on the atmospheric calculations as we speak.

Is it possible to add the choice of graph axes (i.e. not only payload-ÃŽâ€v graphs at fixed TWR, but also ÃŽâ€v-TWR graphs at fixed payload and TWR-payload graphs at fixed ÃŽâ€v)?

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