Calculation of resistor values