Browse Source

Edited thrust correction equation

master
Jason Ong 2 years ago
parent
commit
a98c036a62
2 changed files with 4 additions and 3 deletions
  1. 2
      Code/MAD_H300/MAD_H300.m
  2. 5
      Code/SingleStageRocket.m

2
Code/MAD_H300/MAD_H300.m

@ -1,7 +1,7 @@
clc
addpath('../')
mad_H300 = SingleStageRocket(0.31, 5.712, 1, 148, 158, 15.77, 0.0283);
mad_H300 = SingleStageRocket(0.31, 5.712, 10, 148, 158, 15.77, 0.028353);
mad_H300.SetSimulationParams(0.05, 20000, 85);
mad_H300.SetRocketID("MAD_H300");
mad_H300.InitializeVars();

5
Code/SingleStageRocket.m

@ -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', ',');

Loading…
Cancel
Save