A method of controlling a gas delivery apparatus to deliver a test gas for non-invasively determining a subject's pulmonary blood flow comprising the steps of: (a) Using an iterative algorithm to control at least one apparatus controllable variable to test one or more test values for an iterated variable by: Obtaining input of a steady state value of an end tidal test gas concentration and a corresponding value of at least one apparatus controllable variable for use in the iterative algorithm; providing an inspired concentration of a test gas that achieves a test concentration of the test gas in the subject's end tidal exhaled gas; using a test value of the iterated variable in the iterative algorithm to set the gas delivery apparatus to deliver, for at least one series of inspiratory cycles, an inspiratory gas comprising a test gas that is computed to maintain the test concentration of the test gas in the subject's end tidal exhaled gas; obtaining input comprising measurements of end tidal concentrations of test gas for expiratory cycles corresponding to the at least one series of inspiratory cycles and a corresponding value of at least one apparatus controllable variable for use in the iterative algorithm; using at least one measurement obtained in step D) as a reference end tidal concentration value to generate at least one of the following outputs: the test value satisfies a test criterion; a refined test value; wherein the reference end tidal concentration is a surrogate steady state value and the reference end tidal concentration is used to refine the test value; (b) If output is not obtained, repeating step (a) as necessary at least until output is obtained; and (c) If output is obtained, outputting a value for pulmonary blood flow which, based on the test criterion, sufficiently represents a subject's true pulmonary blood flow. (a) Using an iterative algorithm to control at least one apparatus controllable variable to test one or more test values for an iterated variable by: Obtaining input of a steady state value of an end tidal test gas concentration and a corresponding value of at least one apparatus controllable variable for use in the iterative algorithm; providing an inspired concentration of a test gas that achieves a test concentration of the test gas in the subject's end tidal exhaled gas; using a test value of the iterated variable in the iterative algorithm to set the gas delivery apparatus to deliver, for at least one series of inspiratory cycles, an inspiratory gas comprising a test gas that is computed to maintain the test concentration of the test gas in the subject's end tidal exhaled gas; obtaining input comprising measurements of end tidal concentrations of test gas for expiratory cycles corresponding to the at least one series of inspiratory cycles and a corresponding value of at least one apparatus controllable variable for use in the iterative algorithm; using at least one measurement obtained in step D) as a reference end tidal concentration value to generate at least one of the following outputs: the test value satisfies a test criterion; a refined test value; wherein the reference end tidal concentration is a surrogate steady state value and the reference end tidal concentration is used to refine the test value; Obtaining input of a steady state value of an end tidal test gas concentration and a corresponding value of at least one apparatus controllable variable for use in the iterative algorithm; providing an inspired concentration of a test gas that achieves a test concentration of the test gas in the subject's end tidal exhaled gas; using a test value of the iterated variable in the iterative algorithm to set the gas delivery apparatus to deliver, for at least one series of inspiratory cycles, an inspiratory gas comprising a test gas that is computed to maintain the test concentration of the test gas in the subject's end tidal exhaled gas; obtaining input comprising measurements of end tidal concentrations of test gas for expiratory cycles corresponding to the at least one series of inspiratory cycles and a corresponding value of at least one apparatus controllable variable for use in the iterative algorithm; using at least one measurement obtained in step D) as a reference end tidal concentration value to generate at least one of the following outputs: the test value satisfies a test criterion; a refined test value; wherein the reference end tidal concentration is a surrogate steady state value and the reference end tidal concentration is used to refine the test value; the test value satisfies a test criterion; a refined test value; wherein the reference end tidal concentration is a surrogate steady state value and the reference end tidal concentration is used to refine the test value; (b) If output is not obtained, repeating step (a) as necessary at least until output is obtained; and (c) If output is obtained, outputting a value for pulmonary blood flow which, based on the test criterion, sufficiently represents a subject's true pulmonary blood flow.