Hi everyone,
I created a Octave script (should work on Matlab as well) which calculates payload capacities of a launch vehicle and shows results in a KLV config format (to avoid slowly increasing NRAP weight when doing it manually). Required inputs are dV of destinations in descending order and destination ID as defined in klvconfig.cfg (targetdV matrix), structural mass of the stages (m_s ), fuel mass of the stages (m_f) and specific impulse of stages (Isp)
clear all; close all; clc;
g_t = 9.81;
targetdV = [[9295; 15], [9055; 14], [8870; 13], [8785; 12], [8270; 11], [7595; 10], [7475; 9], [7135; 3], [6940; 8], [6920; 7], [6770; 5], [6745; 4], [6400; 2], [5400; 1], [5200; 0], [0.01; -1]];
% launch vehicle Ardea 3-1 20210227
m_s = [3.488, 7.323, 3.4]
m_f = [12, 23.255, 21.045]
Isp = [350, 320, 255.71]
nStages = length(m_s);
results = [];
j = 1;
maxdVset = false;
for i = 0:0.02:200
m_initial = i;
dV = 0;
for x = 1:1:nStages
m_empty = m_s(x) + m_initial;
m_initial = m_empty + m_f(x);
dVpartial = Isp(x) * g_t * log(m_initial / m_empty);
dV = dV + dVpartial;
end
% find first suitable dV requirement
if maxdVset == false
destinations = length(targetdV);
for l = 1:1:destinations
if targetdV(1,l) <= dV
j = l;
break
end
end
maxdVset = true;
end
% write last result if dV requirement is broken
if dV <= targetdV(1,j)
if i > 0.5
results = [results,[targetdV(2,j);lastValue]];
endif
j = j + 1;
else
lastValue = i;
lastdV = dV;
end
end
formatSpec = ' LAUNCHCONFIG\n {\n DESTINATION = %d\n PAYLOADMASS = %.3f \n }\n';
fprintf(formatSpec,results)