Energy Flow and Entropy in the Predator–Prey–Grass Ecosystem
This page explains how energy flows through the simulated ecosystem of grass, prey, and predators, and how entropy increases in accordance with the second law of thermodynamics. The diagram below visualizes the core concepts behind the simulation model.

Energy Input: The Role of the Sun
The sun is the only external energy source in this simulated ecosystem. It powers the growth of grass, which forms the foundation of the food web. In the simulation, this input is modeled by a regeneration mechanic:
energy_gain_per_step_grass = 0.1
This parameter ensures that usable energy is continually added into the system via the grass layer.