not able to plot
이전 댓글 표시
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
l = log(mf/me)
C = Isp*g; % Effective exhaust velocity
u = Isp*g*l % Vehicle velocity
D = (Rho^2)*(u^2)*A*Cd/2 % Drag force
t = 0 % t = t0 = 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
2022년 9월 21일
이동: Walter Roberson
2022년 9월 21일
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
l = log(mf/me)
C = Isp*g; % Effective exhaust velocity
u = Isp*g*l % Vehicle velocity
D = (Rho^2)*(u^2)*A*Cd/2 % Drag force
t = 0 % t = t0 = 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
2022년 9월 21일
이동: Walter Roberson
2022년 9월 21일
Walter Roberson
2022년 9월 21일
You might want to use
set(gca, 'YDir', 'reverse')
카테고리
도움말 센터 및 File Exchange에서 Engines & Motors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



