inlined isp calc to make nde.ks standalone.

This commit is contained in:
Gabe Venberg 2025-05-14 11:00:45 +02:00
parent c8a839b49c
commit fff3f847a6
4 changed files with 19 additions and 14 deletions

18
nde.ks
View file

@ -1,5 +1,19 @@
//import functions
run once "lib/isp".
function evcalc { //returns the average exaust velocity of active engines. to convert to isp, divide by constant:g0
local englist is list().
local totalflow is 0.
local totalthrust is 0.
list engines in englist.
for eng in englist {
if eng:ignition and not eng:flameout {
set totalflow to totalflow + (eng:possiblethrust /(eng:isp * constant:g0)).
set totalthrust to totalthrust + eng:possiblethrust.
}
}
if totalthrust = 0 { //avoid div by 0 later
return 1.
}
return (totalthrust / totalflow).
}
set nd to nextnode.
//print out node's basic parameters - eta and deltav