1
0
mirror of https://gitlab.com/lander-team/lander-sim.git synced 2025-08-03 03:41:32 +00:00

Upload New File

This commit is contained in:
Brendan McGeeney
2021-04-20 04:07:11 +00:00
parent 70fd19f3a3
commit c856132851

27
burnStartTimeCalc.m Normal file
View File

@@ -0,0 +1,27 @@
function [h0, vb, burnStartTime] = burnStartTimeCalc(Tcurve, tb, M0, mdot, Mb)
Mavg = (M0 + Mb)/2;
g = -9.81;
A_tot = 0;
% Riemann Sum
for i = 2:length(Tcurve)
if i > 1
A = (Tcurve(i, 1) - Tcurve(i - 1, 1)) * Tcurve(i, 2);
else
A = Tcurve(i, 1) * Tcurve(i, 2);
end
A_tot = A_tot + A;
end
Tavg = A_tot / tb;
ueq = Tavg / mdot;
delta_ub = ueq * log(M0/Mb) + g*tb;
a_avg = (Tavg/Mavg) + g;
hf = ((delta_ub^2) / (2*-g));
hb = ((delta_ub^2) / (2*a_avg))
h0 = hf + hb + 1;
vb = delta_ub;
burnStartTime = vb / -g;