Before revision: Open source code examples Python library with various implementations can be found here in this this github repository: MPC vs. LQR Model predictive control and linear-quadratic regulators are both expressions of optimal control, with different schemes of setting up optimisation costs.
After revision: MPC vs. LQR Model predictive control and linear-quadratic regulators are both expressions of optimal control, with different schemes of setting up optimisation costs.