using compression or decompression of the gas