Model Predictive Control Python Code