We investigate the problem of calculating optimal mechanical ventilator settings using computer simulation coupled with the global optimization algorithm. Four ventilator settings (tidal volume, ventilation rate, IE and PEEP) are optimised simultaneously to ensure adequate arterial oxygenation and acid-base balance while minimising the risk of ventilator-associated lung injuries arising from barotrauma and sharp inhaling-exhaling volume changes.