Optimizing the Efficiency of Weaning from Mechanical Ventilation