Comparison between energetic and economic optimization of energy recovery plants with gas expanders and cogeneration engines