A study on the metabolism of cities