Jump to content

[HELP!] Calculate ATM ISP and ATM Thrust?


Recommended Posts

I got an engine part via

PartLoader.LoadedPartsList

now I know how to get the thrust and ISP info, but I want to know how do I compute the atmospheric ISP and atmospheric thrust.

 

I assume I use the atmCurve node and use the key that has an index of 1, then use the second number as a multiplier?

what's the third and fourth numbers for?

Link to comment
Share on other sites

Check how KER does it:

They get the atmospheric Isp from the atmosphereCurve, using the pressure in units of Earth atmospheres (so 0 is space and 1 is sea level):

The Isp times 9.81 m/s/s gives you the exhaust velocity, and you can multiply that by the "flow rate" at which the exhaust leaves the engine to get the thrust:

I have not bothered to look up what Mathf.Lerp does yet.

Link to comment
Share on other sites

10 minutes ago, Xyphos said:

This man is a legend. ---^

five for five. thanks.

I have to admit I'm curious what you're working on! Something to do with part cost and atmospheric thrust/Isp, which has a toolbar button and is localized. This is like playing a programming version of Twenty Questions. :)

Link to comment
Share on other sites

13 minutes ago, HebaruSan said:

I have to admit I'm curious what you're working on! Something to do with part cost and atmospheric thrust/Isp, which has a toolbar button and is localized. This is like playing a programming version of Twenty Questions. :)

I'm attempting to convert Gary Court's optimal rocket calculator to an in-game version.
Gary's json/javascript code has all the data embedded, but only for stock parts. I wanna go beyond that and have every part, stock and mod included without needing external configs.

also, I forgot KER had a part simulator, so now I have to scrap my current test version and start over using parts of KER code. :)

Link to comment
Share on other sites

but my next question will be GUI related; all those part options surely will need a scrolling window pane. while I'm confidant in my C# skills, I've very little experience in developing KSP plugins, and KSP's API is huge and fairly cryptic.

Link to comment
Share on other sites

2 hours ago, Xyphos said:

I'm attempting to convert Gary Court's optimal rocket calculator to an in-game version.

Cool! If I may make a suggestion, both that tool and KER commit what I consider a design error by making the atmospheric flag all-or-nothing for all stages in a craft, whereas the atmospheric values are important for the first 3 km/s or so, and vacuum thereafter. Especially if you're going to try to auto-generate whole craft, it would be good to be able to place vacuum engines on upper stages but not lower. I tried to address this in SmartTank by making the atmosphere flag toggleable per-stage, but that may not work for you if your mod is also generating all the stages.

Link to comment
Share on other sites

3 minutes ago, HebaruSan said:

Cool! If I may make a suggestion, both that tool and KER commit what I consider a design error by making the atmospheric flag all-or-nothing for all stages in a craft, whereas the atmospheric values are important for the first 3 km/s or so, and vacuum thereafter. Especially if you're going to try to auto-generate whole craft, it would be good to be able to place vacuum engines on upper stages but not lower. I tried to address this in SmartTank by making the atmosphere flag toggleable per-stage, but that may not work for you if your mod is also generating all the stages.

great ideas. I'll try to incorporate them, but I'm still working out the details.
edit: with some math work, it could be possible to simulate the atmosphere pressure at each stage.... but first, I am gonna make the all-or-nothing as the basis for the mod, then further develop it to full feature

Edited by Xyphos
Link to comment
Share on other sites

23 hours ago, Xyphos said:

what's the third and fourth numbers for?

Although not relevant to your current situation (which you seem to have under control) the third and fourth numbers are used ONLY to control the shape of the curve and can make transitions from one point to another more abrupt or more curvier. You only need to mess with them when creating a new curve. They're optional parameters but not using them can result in undesired behavior. Read more about them here:

http://forum.kerbalspaceprogram.com/index.php?/topic/84201-info-ksp-floatcurves-and-you-the-magic-of-tangents/

Handy curve editor here:

http://forum.kerbalspaceprogram.com/threads/83246

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