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)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Computational Systems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education