BACKGROUND: Mechanical ventilation is a useful supportive treatment for patients with respiratory failure who are not able to maintain the level of ventilation required to maintain the oxygenation and carbon dioxide elimination. Mechanical ventilation is often life-saving, but it also has risks. Thermodynamic analyses are used to test the feasibility of processes leading to a better understanding of the system's overall performance. Energy losses (entropy) and the destruction of maximum useful work (exergy) leading to reduced respiratory work of breathing efficiency, can be calculated by thermodynamic analysis of the respiratory muscles. OBJECTIVE: To determine the entropy generation, exergy destruction, and glucose consumption during and after weaning from mechanical ventilation in patients with respiratory failure by thermodynamic analysis. METHODS: In this study, a human respiratory system during and after weaning from mechanical ventilation modeled thermodynamically using the first and second laws of thermodynamics. The work of breathing data adapted from the literature. Mass and energy analyzes are carried out according to the 1st law of thermodynamics, while entropy generation is calculated according to the 2nd law of thermodynamics which enables us to measure energy losses. In this thermodynamic model, the body temperature was considered at 37 °C, and the surrounding air condition was taken at 25 °C. RESULTS: Exergy destructions during and after weaning from mechanical ventilation were calculated as 2.23x10-2 and 1.75x10-2 kJ/min, respectively. Entropy generation by the patients through the breathing cycle was 7.48x10-5 (kJ/K)/min during mechanical ventilation while 5.89x10-5 (kJ/K)/min after weaning from mechanical ventilation, respectively. The glucose consumed for work of breathing in patients during and after weaning from mechanical ventilation was calculated as 0.58-0.45 mmol/min, respectively. CONCLUSION: After weaning from mechanical ventilation, the patients have significantly decreased entropy generation, exergy destruction, and glucose consumption, indicating to the improvements in the structure of respiratory mechanics and diaphragm perfusion. The reductions in entropy generation and exergy destruction after weaning from mechanical ventilation also indicates an increase in the mechanical efficiency of the respiratory muscles. According to the results of the energy balance analysis, the decrease in muscle energy requirement, was determined and the calculations found that the patient used 1.3 times more glucose during mechanical ventilation than after weaning from mechanical ventilation for work of breathing. In this study, the thermodynamic approach was used to determine the benefit of mechanical ventilation. More powerful work and multidisciplinary data are needed to progress reliable procedures.