This example code features in Hidden invariant convexity for global and conic-intersection optimality guarantees in discrete-time optimal control by Jorn H. Baayen and Krzysztof Postek, published in Journal of Global Optimization and available online at https://link.springer.com/article/10.1007/s10898-021-01072-5 The approach introduced in the paper and illustrated with this example forms the basis of KISTERS Real Time Optimization (RTO), an enterprise solution for real-time global optimization of hydraulic systems. A related approach is implemented in the open source software package RTC-Tools, version 2.0 and higher. This code was tested with CasADi 3.5.1.