Modernization of a thermal installation to optimize its performance