CasADi is a symbolic framework for algorithmic (a.k.a. automatic) differentiation and numeric optimization.