Thermoeconomic optimization of an energy hub