A new method for on-line optimal control of nonlinear systems is proposed. The proposed method is based on the algorithms for obtaining the numerical solutions of optimal control problems. According to this idea, we can use the iterative computational method for the on-line optimal control problems. in this paper, we adopt the Riccati-equation based algorithm, one of the iterative algorithms, and demonstrate the proposed algorithmic method is applicable to such mechanical systems as fast-sampling is required. Copyright copy; 2005 IFAC.