Question
MATLAB In Matlab write a program that determines Mach within the specified parameters. Mach number is defined as the air speed divided by the speed
MATLAB
In Matlab write a program that determines Mach within the specified parameters.
Mach number is defined as the air speed divided by the speed of sound in the air. For an ideal gas, the equation to determine the speed of sound is given by = / where R is the specific gas constant of 8.314510 J/(moloK), is the mean molar mass of air and is equal to 0.0289645 kg/mol, is the adiabatic index and is equal to 1.4 for diatomic molecules (air), and T represents the constant temperature in air in oK.
Write a program that will
a. Ask the user for the velocity in mph, and the altitude in ft
b. Use the attached function (stdatmosK.m) to determine the temperature at the altitude.
c. Calculate the speed of sound using a function call. (Note: Write this task as a function called SpeedSound.m).
d. Display the Mach number with two digits to the right of the decimal to the command window function
function temp=stdatmosK(alt)
%stdatmosK.m - function to determine the temperature (deg K) % in the standard atmosphere, given an altitude in km. % An error is indicated by a return value of -1 % Anthony Vizzini - AE 227 - 19 February 2021
temp = -1; if alt > 105 temp = -1; elseif alt > 90 temp = 165.66 + (alt-90)*4; elseif alt > 79 temp = 165.66; elseif alt > 53 temp = 282.66 - (alt-53)*4.5; elseif alt > 47 temp = 282.66; elseif alt > 25 temp = 216.66 + (alt-25)*3; elseif alt > 11 temp = 216.66; elseif alt > 0 temp = 288.16 - alt*6.5; end
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started