substitution method for resistance measurement