Jump to content

Thrust/Isp curve calcuations?


Recommended Posts

I'm trying to (manually) work out the curve for the LV-909 engine. From the CFG files:


atmosphereCurve
{
key = 0 345
key = 1 85
key = 3 0.001
}

I've already done some searching, and the following links helped some:

http://answers.unity3d.com/questions/464782/t-is-the-math-behind-animationcurveevaluate.html#

http://forum.kerbalspaceprogram.com/threads/93332-INFO-KSP-floatCurves-and-you-the-magic-of-tangents

https://en.wikipedia.org/wiki/Cubic_Hermite_spline

But using them generates the wrong curve. Using some values obtained ingame with an LV-909 and a presmat barometer:


Pressure Thrust Isp Linear fit Spline, m0=m1=0 Spline, m0=1, m1=0.58
100.2133 15.1 86.7 87.8526722 85.0932069515 86.680667215
98.2507 15.6 89.8 92.8887038 85.703524446 89.7734236228
95.422 16.5 94.8 100.147148 87.5445044298 94.5049770746
92.0828 17.5 100.5 108.7155352 91.0948924821 100.4891773881
85.493 19.7 113.5 125.624962 102.0592627423 113.4779012173
71.9826 25.1 144.4 160.2926484 137.7831098736 144.3329581065
56.4051 32.2 185.3 200.2645134 192.9913911189 185.262514313
26.1866 47.4 272.4 277.8051844 301.8783387706 272.3964704883
18.1095 51.4 295.7 298.531023 323.0529758471 295.6662428274
11.3536 54.7 314.7 315.8666624 335.9382785966 314.6492255108
7.8583 56.4 324.2 324.8356022 340.5509970732 324.2297178997
5.8834 57.3 329.6 329.9031956 342.4720256559 329.5564021386
2.6333 58.8 338.2 338.2429522 344.4823077964 338.171112921
0.9397 59.6 342.6 342.5887298 344.9333275577 342.5794242292
0.3279 59.9 344.2 344.1586086 344.9918490872 344.157468544
0.0938 60 344.8 344.7593092 344.9993319654 344.7592156578
0.0198 60 344.9 344.9491932 344.9999702193 344.9491890212
0.0027 60 345 344.9930718 344.9999994462 344.9930717211
0 60 345 345 345 345

Where are these tangents coming from? Is there some way to generalize this to other engines (and presumably higher pressures for Eve ascents etc)?

Link to comment
Share on other sites

I've recently spent some time looking for an answer to this myself, and after getting where you are right now (more or less), this post gave me the final piece, at least as far as I can tell. Basically:

1) A point's incoming and outgoing tangent is the same

2) The two end points use the slope between that endpoint and its connected inner point.

3) Other points average the incoming and outgoing slope

To use the 909 as an example, the first point is [0, 345], the second is [1,85], and the third is [3,0.001]

the tangent for the first point would be (85-345)/(1-0), the third would be (0.001-85)/(3-1), and the second would be the average of the third and the first.

Done a bit of basic testing with this using the TV-30 and now your data from the 909, and it seems to fit. I'm assuming your listed pressures are in KPa, and switched it back to atm since that's what the pressure numbers for the atmospherecurve are given in.

Link to comment
Share on other sites

If you want a closer fit using regression, try a logarithmic regression. LnReg.

http://forum.kerbalspaceprogram.com/threads/120256-ISP-Graphs

There I tried the same as you, but with LnReg. Then NathanKell said that KSP uses the NASA standard atmospheric model,

but at 80%. (As in 8km on Kerbin = 10km on Earth).

The formulas for getting atmospheric pressure in the NASA standard atmospheric model are:

NAM.png

(These are corrected for the Kerbin 80% atmosphere, so h is kerbin-altitude in meters)

NASA model source: https://www.grc.nasa.gov/www/k-12/airplane/atmosmet.html

Edited by Northlight
Link to comment
Share on other sites

Then NathanKell said that KSP uses the NASA standard atmospheric model,

but at 80%. (As in 8km on Kerbin = 10km on Earth).

Kerbin's atmosphere is based on an 80% US Standard Atmosphere model, but it doesn't match it exactly. It uses a series of points taken from the standard model but, to estimate values in between, those points are connected with splines. Therefore, there will be some deviation between what KSP computes and what your equations will yield. Should be pretty close, though.

(EDIT)

Something else that will throw off the results is that the standard model uses geopotential height (h), while KSP altitudes are geometric height (z). A conversion must be made before using your equations.

Edited by OhioBob
Link to comment
Share on other sites

@Starfang42: That solves it, thanks! As for pressures, I read them off the presmat barometer, which seems to use kPa now.

@OhioBob, Northlight: I decided to avoid altitude entirely for the near-term, but that'll also help. It does explain why the old 5 km isothermal scale height was obviously off, though.

Link to comment
Share on other sites

@OhioBob, Northlight: I decided to avoid altitude entirely for the near-term, but that'll also help. It does explain why the old 5 km isothermal scale height was obviously off, though.

It appears that none of the atmospheres follow the old isothermal/constant scale height model anymore. I've got the Kerbin atmosphere figured out pretty close if you ever need it. It's described in the following thread:

http://forum.kerbalspaceprogram.com/threads/117069-Great-New-Physics-Thread%21?p=1940443&viewfull=1#post1940443

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