This paper presents a direct descent second order or direct descent curvature algorithm with some modifications for the optimal control computations. This algorithm is compared with Hamiltonian methods in the literature. The proposed algorithm has generated numerically robust solutions with respect to conjugate points. The weighting matrix updating scheme was developed to improve the second-order optimal control algorithm, tested the performance of the algorithm, and shown on the benchmark and industrial process. The time-varying optimal feedback (TVOFB) gains are also generated along the trajectory as byproducts. If the trajectory deviates from the optimal trajectory for any reason (i.e., changing of system parameters, step disturbance into the plant, changing of initial conditions), it is held on the optimal trajectory by means of the optimal feedback. Simulations have been given for controlling the Van der Pol and bioreactor system, which are nonlinear 'benchmark systems. (c) 2006 ISA-The Instrumentation, Systems, and Automation Society.