The pde2path optimal control (OC) library for solving infinite time horizon spatially distributed optimal control problems.

Current version written and maintained by H. Uecker

Since pde2path 2.2, the OC library is contained in the pde2path download, including the OC demos
sloc (Shallow Lake Optimal Control),
vegoc (VEGetation Optimal Control), and, since v2.3,
lvoc (Lottka-Volterra Optimal Control).

A tutorial for these demos can be found here.

Here are some movies showing some 2D results (from [GU17] and [U16])

The old p2poc homepage, which contains some (now somewhat dated) additional information on the use of the OC lib can be found here