An apparatus and method for controlling the end tidal partial pressure of a gas X in a subjects lung, and to the use of such an apparatus and method for research, diagnostic and therapeutic purposes, wherein the method consists of: obtaining input of a series of logistically attainable PetX values for a series of respective breaths: determining an amount of gas X required to be inspired by the subject in an inspired gas to target the PetX for each of said respective breaths: and controlling a gas delivery device to deliver the amount of gas in a volume of gas delivered to the subject in each of said respective breaths to target the respective PetX for that breath.