Calculation formula for compensation capacitor