Compensation principle and method of thermocouple