The flow of energy and the circulation of matter