In this paper, a new computational algorithm for the numerical solution of the adjoint equations for the nonlinear optimal control problem is introduced. To this end, the main features of the optimal control theory are briefly reviewed and effectively employed to derive the adjoint equations for the active control of a mechanical system forced by external excitations. A general nonlinear formulation of the cost functional is assumed and a feedforward (open-loop) control scheme is considered in the analytical structure of the control architecture. By doing so, the adjoint equations resulting from the optimal control theory enter into the formulation of a nonlinear differential algebraic two-point boundary value problem, which mathematically describes the solution of the motion control problem under consideration. For the numerical solution of the problem at hand, an adjoint-based control optimization computational procedure is developed in this work to effectively and efficiently compute a nonlinear optimal control policy. A numerical example is provided in the paper to show the principal analytical aspects of
the adjoint method. In particular, the feasibility and the effectiveness of the proposed adjoint-based numerical procedure are demonstrated for the reduction of the mechanical vibrations of a nonlinear two degrees-of-freedom dynamical system.