Matter and Energy in Ecosystems