How to Implement Model Predictive Controllers