problem: 5 kg of air is contained in a piston-cylinder device, initially at a pressure of 2MPa and a specific volume of 0.08m3/kg. The air then expands, as an ideal gas, via a polytrophic process, with variable values of n, to a final specific volume of 0.30m3/kg.
Objective: prepare down a MATLAB code to resolve for the pressure and temperature variation all through the expansion process and to compute the work and heat produced in the processes for variable values of n.
1) Start by defining the temperature at initial state and then define the temperature and pressure at final state. Sketch a rough graph of what the procedure looks like on P-v coordinates. prepare out by hand the equations and steps you would take to find out the actual P, T, and v at all points along the process. Recognize unknowns, equations, constants and computation orders.
2) By using your hand computations as a guide, prepare a simple MATLAB m-file to compute the properties at points all along the process (minimum of 20 points, but must be a variable that can be modified) using one of the values of n (I recommend using n =1.5). Plot P-v and T-v diagrams for the process by using MATLAB.
3) Compute the work performed for the process through integrating the curve of pressure versus specific volume. Use the “trapezoidal area method” for computing the integral.
4) Suppose that the specific internal energy for the air in this problem can be defined as a function of temperature as given:
u(T) = (1.0344 ∗ 10−4) ∗ T2 + (6.4476 ∗ 10−1) ∗ T + (1.3727 ∗ 102)
Add code to your MATLAB program to find out the specific internal energy for the process using the information of the pressure and specific volume at each state.
5) Using conservation of energy and the work find outd, determine the amount of heat transferred for each process.
6) prepare a loop in the code to analyze the different values of n, or run the code for the different values of n.