Differential Dynamic Programming With Nonlinear Function Examples