not able to plot
Mostra commenti meno recenti
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)
Risposte (1)
Walter Roberson
il 21 Set 2022
Spostato: Walter Roberson
il 21 Set 2022
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 Commenti
Suchita Gupta
il 21 Set 2022
Spostato: Walter Roberson
il 21 Set 2022
Walter Roberson
il 21 Set 2022
You might want to use
set(gca, 'YDir', 'reverse')
Categorie
Scopri di più su Statics and Dynamics in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



