Principle of Thermoelectric Generation