close all
clear all
clc
d = 0.1; % Diameter of the rocket (m)
A = pi*(d/2)^2; % Area of the rocket (m^2)
Cd = 0.7; % Drag coefficient
Rho = 1; % Air density (kg/m^3)
g = 9.81; % Acceleration due to gravity (m/s^2)
Isp = 250; % Specific impulse of motor and propellant (s)
Ve = Isp*g; % Exhaust velocity (m/s)
m0 = 100; % Initial mass (kg)
me = 25; % Empty mass (kg)
mp = me; % Propellant mass (kg)
mf = m0-me; % Final mass (kg)
E = mp/(mp+m0); % Propellant mass fraction
MR = 1-E % Mass ratio
MR = 0.8000
l = log(mf/me)
l = 1.0986
C = Isp*g; % Effective exhaust velocity
u = Isp*g*l % Vehicle velocity
u = 2.6943e+03
D = (Rho^2)*(u^2)*A*Cd/2 % Drag force
D = 1.9956e+04
t = 0 % t = t0 = 0
t = 0
%
tp = 9; % Burn time
for i = 1:141
tp = tp + 1;
F = Isp*m0*g/tp;
a = (C*E/tp)/(1-E*(t/tp))-g-(Cd*Rho*(u^2)*A/m0)/(1-E*(t/tp));
hbo = g*Isp*tp*(mf*log(mf/m0)/(m0-mf)+1)-g*(tp^2)/2;
end
plot (hbo,tp)
plot (a,tp)

답변 (1개)

Walter Roberson
Walter Roberson 2022년 9월 21일
이동: Walter Roberson 2022년 9월 21일

0 개 추천

d = 0.1; % Diameter of the rocket (m)
A = pi*(d/2)^2; % Area of the rocket (m^2)
Cd = 0.7; % Drag coefficient
Rho = 1; % Air density (kg/m^3)
g = 9.81; % Acceleration due to gravity (m/s^2)
Isp = 250; % Specific impulse of motor and propellant (s)
Ve = Isp*g; % Exhaust velocity (m/s)
m0 = 100; % Initial mass (kg)
me = 25; % Empty mass (kg)
mp = me; % Propellant mass (kg)
mf = m0-me; % Final mass (kg)
E = mp/(mp+m0); % Propellant mass fraction
MR = 1-E % Mass ratio
MR = 0.8000
l = log(mf/me)
l = 1.0986
C = Isp*g; % Effective exhaust velocity
u = Isp*g*l % Vehicle velocity
u = 2.6943e+03
D = (Rho^2)*(u^2)*A*Cd/2 % Drag force
D = 1.9956e+04
t = 0 % t = t0 = 0
t = 0
%
tp = 9; % Burn time
for i = 1:141
tp = tp + 1;
tps(i) = tp;
F = Isp*m0*g/tp;
a(i) = (C*E/tp)/(1-E*(t/tp))-g-(Cd*Rho*(u^2)*A/m0)/(1-E*(t/tp));
hbo(i) = g*Isp*tp*(mf*log(mf/m0)/(m0-mf)+1)-g*(tp^2)/2;
end
plot (hbo,tps)
plot (a,tps)
Question: why are you using the dependent variable as the x axes, and the independent variable as the y axes?

댓글 수: 2

Suchita Gupta
Suchita Gupta 2022년 9월 21일
이동: Walter Roberson 2022년 9월 21일
hi, thankyou for helping. because im working in upward direction and wanted to keep the confusion away
You might want to use
set(gca, 'YDir', 'reverse')

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Engines & Motors에 대해 자세히 알아보기

태그

질문:

2022년 9월 21일

댓글:

2022년 9월 21일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by