If pressure is the pressure due to the piston, then this can be simply be self.Piston_pressure * (finalvolume - initialvolume)