Internal resistance and how to measure it