Calculating end state properties, work and heat transfer for an adiabatic polytropic process containing air