A 100-L rigid tank contains carbon dioxide gas at 1 MPa, 300 K. A valve is cracked open, and carbon dioxide escapes slowly until the tank pressure has dropped to 500 kPa. At this point the valve is closed. The gas remaining inside the tank may be assumed to have undergone a polytropic expansion, with polytropic exponent n = 1.15. Find the final mass inside and the heat transferred to the tank during the process.