An iteration method for calculating the relative capacity