Mathematical Principles and Optimal Design Solutions to Compensation for the Pendulum Temperature Dilatation