Efficient calculation of the solutions of nonlinear optimal control problems (NOCPs) is becoming more and more important for today's control engineers. The systems to be controlled are typically described using differential-algebraic equations (DAEs), which can be conveniently formulated in Modelica. In addition, the corresponding optimization problem can be expressed using Optimica. Solution algorithms based on collocation methods are highly suitable for discretizing the underlying dynamic model formulation. Thereafter, the corresponding discretized optimization problem can be solved, e.g. by the interior-point optimizer Ipopt. The performance of the optimizer heavily depends on the availability of derivative information for the underlying optimization problem. Typically, the gradient of the objective function, the Jacobian of the DAEs as well as the Hessian matrix of the corresponding Lagrangian formulation need to be determined. If only some or none of these derivatives are provided, usually numerical approximations are used by the optimizer internally. OpenModelica supports the Optimica language and is capable of automatically generating the discretized optimization problem using collocation methods as well as the whole symbolic machinery available. In addition, all necessary derivative information is determined using the automatic differentiation capabilities of ADOL-C, which has now been integrated into the OpenModelica environment.