I am having a problem with this code in matlab. It runs smoothly with no errors but I just don't see a plot. It won't graph the data for some reason. It gives me what a, m_i_1, and m_i_2 is and they are of the same length, but it just doesn't show a plot. Can you help me with the plot? Also, I wanted a plot where a is 0.5:0.01:0.6 as well. dV_ideal = 9800; % m/s f_inert_1 = 0.15; f_inert_2 = 0.23; Isp_1 = 325; % s Isp_2 = 340; % s g0 = 9.81; % m/s^2 m_PL = 650; % kg n = 0.1:0.1:0.9; i = 1:81; for j = 1:81 n = i(j) * 0.01; dV_stage1(j) = n*dV_ideal; dV_stage2(j) = (1-n)*dV_ideal; MR_2(j) = exp(dV_stage2(j)/(g0*Isp_2)); m_prop_2(j) = (m_PL*(MR_2(j)-1)*(1-f_inert_2))/(1-(f_inert_2*MR_2(j))); m_inert_2(j) = (f_inert_2*m_prop_2(j))/(1-f_inert_2); m_i_2(j) = m_inert_2(j) + m_prop_2(j) + m_PL*ones(size(j)); MR_1(j) = exp(dV_stage1(j)/(g0*Isp_2)); m_prop_1(j) = (m_i_2(j)*(MR_1(j)-1)*(1-f_inert_1))/(1-(f_inert_1*MR_1(j))); m_inert_1(j) = (f_inert_1*m_prop_1(j))/(1-f_inert_1); m_i_1(j) = m_inert_1(j) + m_prop_1(j) + m_i_2(j); end a = 0.1:0.01:0.9 m_i_2 m_i_1 plot(a,m_i_2) plot(a,m_i_1)
I am having a problem with this code in matlab. It runs smoothly with no errors but I just don't see a plot. It won't graph the data for some reason. It gives me what a, m_i_1, and m_i_2 is and they are of the same length, but it just doesn't show a plot. Can you help me with the plot? Also, I wanted a plot where a is 0.5:0.01:0.6 as well.
dV_ideal = 9800; % m/s
f_inert_1 = 0.15;
f_inert_2 = 0.23;
Isp_1 = 325; % s
Isp_2 = 340; % s
g0 = 9.81; % m/s^2
m_PL = 650; % kg
n = 0.1:0.1:0.9;
i = 1:81;
for j = 1:81
n = i(j) * 0.01;
dV_stage1(j) = n*dV_ideal;
dV_stage2(j) = (1-n)*dV_ideal;
MR_2(j) = exp(dV_stage2(j)/(g0*Isp_2));
m_prop_2(j) = (m_PL*(MR_2(j)-1)*(1-f_inert_2))/(1-(f_inert_2*MR_2(j)));
m_inert_2(j) = (f_inert_2*m_prop_2(j))/(1-f_inert_2);
m_i_2(j) = m_inert_2(j) + m_prop_2(j) + m_PL*ones(size(j));
MR_1(j) = exp(dV_stage1(j)/(g0*Isp_2));
m_prop_1(j) = (m_i_2(j)*(MR_1(j)-1)*(1-f_inert_1))/(1-(f_inert_1*MR_1(j)));
m_inert_1(j) = (f_inert_1*m_prop_1(j))/(1-f_inert_1);
m_i_1(j) = m_inert_1(j) + m_prop_1(j) + m_i_2(j);
end
a = 0.1:0.01:0.9
m_i_2
m_i_1
plot(a,m_i_2)
plot(a,m_i_1)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images