How to calculate the battery resistance and current