calculating internal resistance of a cell