|
|
|
@ -178,7 +178,7 @@ classdef SingleStageRocket < handle |
|
|
|
|
|
|
|
function T = VacThrustCorrection(obj, h, thrust) |
|
|
|
[t,p,rho] = CalcAtmosQuantities(h); |
|
|
|
T = thrust - 0; |
|
|
|
T = thrust - obj.exit_area * p; |
|
|
|
end |
|
|
|
|
|
|
|
% Calculate mass at each iteration |
|
|
|
@ -383,7 +383,8 @@ classdef SingleStageRocket < handle |
|
|
|
text = "VariableMassFlow"; |
|
|
|
result_dat_file = 'Result/' + obj.ID + "_Result_" + obj.launch_angle + "_deg_" + text + ".txt"; |
|
|
|
end |
|
|
|
result_matrix = [obj.t obj.x/1000 obj.y/1000 obj.V obj.M obj.thrust obj.DvDt obj.m obj.mdot obj.isp obj.Cd obj.q]; |
|
|
|
result_matrix = [obj.t(1:obj.NStepEnd) obj.x(1:obj.NStepEnd)/1000 obj.y(1:obj.NStepEnd)/1000 obj.V(1:obj.NStepEnd) obj.M(1:obj.NStepEnd) obj.thrust(1:obj.NStepEnd) ... |
|
|
|
obj.DvDt(1:obj.NStepEnd) obj.m(1:obj.NStepEnd) obj.mdot(1:obj.NStepEnd) obj.isp(1:obj.NStepEnd) obj.Cd(1:obj.NStepEnd) obj.q(1:obj.NStepEnd)]; |
|
|
|
result_data = reshape(result_matrix, [], 12); |
|
|
|
dlmwrite(result_dat_file, 'Time(s),x(km),y(km),Velocity(m/s),Mach,Thrust(N),Acceleration(m/s2),Mass(kg),mdot(kg/s),Isp(s),Cd,DynPres(kPa)','delimiter','') |
|
|
|
dlmwrite(result_dat_file, result_data, '-append', 'delimiter', ','); |
|
|
|
|