Maximizing Performance of Microelectronic Thermoelectric Generators With Parasitic Thermal and Electrical Resistances