Calculate voltage based on capacitor capacity