The specific optimal control of nonlinear systems with a general structure is formulated mathematically and adapted to the software COMMIN, which was developed recently for the purpose of solving continuous systems optimization problems using the maximum principle. This enables us to determine the optimal parameter values of a closed-loop system with accuracy. Validation is made on a simple nonlinear system, and results are compared to those obtained with a fully optimal open-loop control scheme.