Question
Pressure is a force applied over an area and is measuredin Pascal (N/m2 ) in metric units or in pounds per square inch,PSI, (lbf /in2
Pressure is a force applied over an area and is measuredin Pascal (N/m2 ) in metric units or in pounds per square inch,PSI, (lbf /in2 ) in English units. Write a MATLAB function thattakes as input a pressure in PSI, then converts the value toPascal, and outputs that value. Use the unit conversions: 1 lbf =4.448 N and 39.370 in = 1 m Test the function twice in the CommandWindow using 2,960 lbf/in2 (Space Shuttle Engine Pressure) and 195lb/in2 (Internal Combustion Engine Combustion ChamberPressure).
Part 2. The pressure P (Pa) of an ideal gas in a tank can becalculated from the number of moles of the gas n (kmol), the volumeV (m3 ) of the container, and the temperature it is being held at T(K) using the equation PV=nRT. The universal gas constant is R =8.3145 x 103 Pa?m3 /(K?kmol). The gas has a mass m (kg), which isrelated to the number of moles n and the molecular mass M (kg/kmol)using m = Mn. Five gases have the following molar masses: Gas TypeAir Oxygen Helium Nitrogen Propane M (kg/kmol) 28.966 31.999 4.02028.0134 44.097 400 grams of each gas are held at room temperature,297 K, in separate tanks, each with a volume of 0.018 m3 . Write aMATLAB function that takes as inputs a vector of molar masses (suchas that given above), a scalar temperature and a scalar mass. Theuniversal gas constant and the container volumes will always remainconstant. The function should calculate and output a vector of thenumber of moles (specify units with comments) present of each gasand a vector of the pressure for each container. Use comments inyour functions to properly label each equation and indicate inputs,outputs and units. Test your functions in the Command Window usingthe values given above. Copy your Command Window results and yourfunction files into a Word document.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here is the MATLAB code for the first part of the question matlab function pascalpressure psitopasca...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