In this paper, we study discretization techniques for solving nonlinear optimal control problems with control and state constraints. A combination of both Neumann and Dirichlet boundary conditions is admitted while the control enters the system either as boundary or distributed control. For this rather general class of elliptic control problems, the theory of necessary conditions has not yet been fully developed. For special classes necessary optimality conditions have been derived in [4,14,15,16,21,22,24,26,27] for boundary controls and in [3,7,8,9,12,13,20,21,25,26,27,34] for distributed controls. In section 2 we present a formal statement of first order necessary conditions for the general elliptic problem. In particular, a more detailed discussion is given for bang-bang and singular controls. These conditions turn out to be consistent with their counterparts for the discretized problem obtained from the Kuhn-Tucker conditions (section 3). The main focus is on the numerical solution of control and state constrained problems and on the verification of the optimality conditions. Further numerical examples may be found in [28,29].
In section 3, we discuss a full discretization approach in which both control and state variables are discretized. The resulting large-scale NLP-problem solved subsequently may contain up to 80,000 variables. Two applications are considered in section 4, one to a heat-conduction problem with boundary control and mixed boundary conditions. This example was also chosen such that it yields a convex quadratic programming (QP) problem in its discretized form permitting comparison to a pure QP solver in addition to more classical approaches as SQP and augmented Lagrangian techniques. The second application is from population dynamics. It leads to a quadratically constrained nonconvex QP. A distributed control function is sought which maximizes the profit of harvesting a biological species. The problems are formulated as AMPL  scripts and several optimization codes were applied. In particular, the interior point code LOQO  successfully and efficiently solved all problems. In both applications also a case with bang-bang control is solved which is especially remarkable in the distributed control example for which we are not aware of another instance in the literature. It needs to be stressed that more nonlinear formulations of these or other applications can be treated in the same way. The code LOQO was designed to solve general nonconvex NLP problems. For a comparison with other codes on several classes of optimization problems, see the benchmarks of .