herbivory Scripts for dynamic programming solutions of optimal control problem representing plant defense investment with respect to variable herbivory.