Performance optimization of a segmented converging thermoelectric generator for waste heat recovery