How to calculate the current with the battery attenuation formula