Solve the following problem:
Q: A cylinder fitted with a piston restrained by a linear spring has a cross-sectional area of 0.05 m2 and initial volume of 20 L. The cylinder contains ammonia at 1 MPa, 60°C. The spring constant is 150kN/m. Heat is rejected from the system, and the piston moves until 6.25 kJ of work has been done on the ammonia.
a. Find the final temperature of the ammonia.
b. Calculate the heat transfer for the process.