cp_gradient Gradient-based solution to the nonlinear optimal control problem, applied to the under-actuated cart-pole system. Check out a writeup here: (link coming) Main script is cartpole.m. Run it! Developed/tested on Matlab R2014b.