An ecosystem is a community made up of living organisms and nonliving components such as air, water and mineral soil. Ecosystems may be studied either as contingent collections of plants and animals, or as structured systems and communities that are governed by general rules. The biotic and abiotic components interact through nutrient cycles and energy flows. Ecosystems include a network of interactions among organisms, and between organisms and their environment. Ecosystems can be of any size but one ecosystem has a specific, limited space. Some scientists view the entire planet as one ecosystem.
Energy, water, nitrogen and soil minerals are other essential abiotic components of an ecosystem. The energy that flows through ecosystems comes primarily from the sun, through photosynthesis. Photosynthesis also captures carbon dioxide from the atmosphere. Animals also play an important role in the movement of matter and energy through ecoystems.