Abstract
We develop an algorithm to compute an approximate solution to the Hamilton-Jacobi equation for the generating function for a nonlinear optimal control problem in this paper. We prove that an approximate generating function based on Taylor series can be obtained by solving a sequence of first-order ordinary differential equations. Once we obtain a generating function for a certain boundary condition, we can solve any trajectory generation problem of the same system for different boundary conditions. Numerical examples illustrate the effectiveness of the proposed method.