I believe this is fairly easy but I am not very fond in Matlab so please help me out:
I need to plot a contour in MATLAB basically seeing what values of two variables throughout the spectrum get the result. Here is the question. I will post equations to find the values of each part below.
Question:
Write a Matlab code that plots a single contour (which is based on the specific energy calculated at part (a)). Note that the plot is a altitude vs. Mach number plot, and the points on the contour shows the possible combinations of altitude and Mach number of the desired specific energy. For example, the flight condition at Problem 1 (15000 ft and 375 mi/h) needs to be a point on the contour you plotted. In order to show that point, put a marker on your graph.
Equations:
Mach Number = velocity / speed of sound --> velocity = Mach Number * Speed of Sound, which you can plus into the equation below:
Specific Energy = Height + (velocity^2)/(2*32.2) = 19699.34 feet
Specific Energy = Height + ((Mach Number * Speed of Sound)^2)/(2*32.2) = 19699.34 feet
However, to relate height and mach number, the speed of sound changes with height so the equation for height to speed of sound is:
Speed of Sound = 29.06 * sqrt(518.7 + 3.57h) Where h = altitude (K ft)
The value the two always have to reach is 19699.34 and it wants you to graph all the possibilities of the two that it can.
% MATLAB program
% First let's define the function to be plotted as a comtour
f = @(x,y) x -19699.34 + (((29.6*y*sqrt(518.7+3.57*x))^2)/(2*32.2));
fcontour( f , [0 30000 0 1000])% The terms in square brackets are range of x and y
grid on % To turn on the grid on the plot
title({'Specific Energy Plot','Altitude vs Mach number'})
xlabel('Altitude(x)')
ylabel('Mach number(y)')
hold on % To still be in graphing mode
plot(15000 , 375 , 'r*') % To plot the point as a marker on the contour
hold off % To come out of plotting mode
Get Answers For Free
Most questions answered within 1 hours.