Selection of compensation capacity of series capacitor