Calculation of voltage drop and current in a circuit