Optimization algorithm based on matrix calculus for reference trajectory tracking/model predictive control that I wrote during my PhD.