diff --git a/lib/node.ks b/lib/node.ks index d721fd9..73f64b6 100644 --- a/lib/node.ks +++ b/lib/node.ks @@ -10,17 +10,20 @@ function estimated_burn_duration { // Based on: // https://en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation // https://space.stackexchange.com/questions/27375/how-do-i-calculate-a-rockets-burn-time-from-required-velocity + // https://www.alternatewars.com/BBOW/Space/Rocket_Equations.htm // parameter burn. parameter isp is isp_sum(). - parameter maxthrust is SHIP:maxthrust. + parameter thrust is SHIP:availablethrust. if burn:istype("Node") { set burn to burn:deltav. } - local exhaust_velocity is isp * (CONSTANT:G * KERBIN:mass). - return ((SHIP:mass * exhaust_velocity) / maxthrust) * (1 - CONSTANT:E^(-burn:mag/exhaust_velocity)). + local deltav is burn:mag. + local exhaust_velocity is isp * CONSTANT:g0. + local wet_mass is SHIP:mass. + return ((wet_mass * exhaust_velocity) / thrust) * (1 - CONSTANT:E^(-deltav/exhaust_velocity)). }