An insulated 8-m^3 rigid tank contains air at 600 kPa and 400 K. A valve connected to the tank is now opened, and air is allowed to escape until the pressure inside drops to 200 kPa. The air temperature during the process is maintained constant by an electric resistance heater placed in the tank. Determine the mass of the air exited from the tank during the process and the electrical energy supplied to air during this process.