The data for this problem has been invented. Its input data, parameters and initial conditions would normally be determined by experiment. The model consists of two main parts, one for the change in the algae population, one for the herbivore. The algae-growth portion of the model we have seen before in various forms. This function is monotonic and declining.
Algal growth is calculated as the product of the density and the growth rate.
The algae density is reduced through consumption by the herbivore. The consumption rate is simply the product of the number of herbivore and the consumption per head. Indirectly, the denser the algae, the lower the herbivore death rate. To increase realism of the model, we make FCN HERB GROW a function of the algae density in the previous time period. In general, it makes sense to represent herbivore behavior in this way.