Controlling the valves to perform a Miller-Atkinson cycle