A computerized method for measuring respiratory mechanics during mechanical ventilation.