54 people are already enjoying it.

Linear and Nonlinear MPC in Practice
Most Model Predictive Control courses stop at theory. This one DOESN’T.
You’ll go from first principles to running C code.
In this course, you will:
- Design MPC controllers from first principles
- Tune and validate both linear and nonlinear MPC controllers
- Build a linear MPC controller for a DC motor
- Develop a nonlinear MPC controller for hovercraft trajectory tracking
- Implement every controller twice: once in MATLAB/Simulink and once in Python (acados)
- Generate the C code for each control system and run it in simulation
All the code is provided!
Practical Model Predictive Control: Course Overview

Not convinced?
Try the following free lessons first
No sign-up required. Just dive in.
Model Predictive Control Theory
2.1 – Intro – Architecture – Linear and Nonlinear Prediction Model
MATLAB/Simulink – Linear MPC (DC Motor)
Python – Linear MPC (DC Motor)

What you’ll learn
This is an intermediate-to-advanced course. What you’ll gain here is everything between “I know what MPC is” and “I can deploy my controller on hardware.”
Linear MPC – DC Motor (MATLAB/Simulink and Python/acados)
Start with a classic SISO system: a DC motor. You’ll model it, design an MPC controller around it, and systematically explore every tuning lever – prediction horizon, control horizon, sample time, weights, hard constraints, soft constraints, and measured and unmeasured disturbance rejection. You’ll also design a discrete Kalman Filter for state estimation and study its gain convergence.
This topic is covered in both MATLAB/Simulink and Python (using acados on Ubuntu/WSL), so you see exactly how the same problem is approached in each environment.
Nonlinear MPC – Hovercraft Trajectory Following (MATLAB/Simulink and Python/acados)
The nonlinear section is where this course separates itself from everything else available. You’ll build a MIMO nonlinear MPC controller for a hovercraft – a 2-thruster and 3-thruster configuration – doing full trajectory following with obstacle avoidance.
You’ll design an Extended Kalman Filter (EKF) for state estimation, implement trajectory preview functions, and simulate the complete closed-loop system. Again: done twice – once in MATLAB/Simulink, once in Python with acados.
C Code Generation and Simulation
Every controller designed in the course ends with C code generation. From MATLAB Coder / Simulink Embedded Coder on the MATLAB side, and from acados’s native C code output on the Python side, you’ll run the generated code inside a simulator and verify results. This is the bridge between algorithm and deployment.
Course curriculum
- Chapter 1 – Introduction: What the course covers, tools required, and how to get the most from it.
- Chapter 2 – Model Predictive Control Theory: What MPC is, the receding-horizon architecture, linear vs nonlinear prediction models, cost functions, constraints, and state estimation with Kalman and Extended Kalman Filters.
- Chapter 3 – Overview of What’s Ahead: A guided map of the practical sections so you know what to watch depending on your focus (MATLAB, Python, or both).
- Chapter 4 – MATLAB/Simulink: Linear MPC (DC Motor): 19 lessons. DC motor model in Simscape, MPC object design, constraints, soft constraints, cost and status, horizons, sample time, weights, robustness, Kalman Filter, disturbance rejection (measured and unmeasured), time delay, online weight changes, constraint on current, setpoint preview, and C code generation.
- Chapter 5 – MATLAB/Simulink: Nonlinear MPC (Hovercraft): 22 lessons. 2-thruster and 3-thruster hovercraft models in Simscape, nonlinear MPC design, EKF implementation, trajectory generation, trajectory preview, simulation results, and C code generation with a full C simulation of the closed-loop system.
- Chapter 6 – Python Setup: acados and Ubuntu (WSL): Installing WSL and Ubuntu on Windows, building acados from source, setting up the Python virtual environment and acados Python interface. Step-by-step. Everything is free and open source.
- Chapter 7 – Python: Linear MPC (DC Motor): 21 lessons. DC motor ODE model, discrete model for MPC, Kalman Filter with gain convergence analysis, acados solver setup, Python simulation architecture, and the same systematic tuning sequence as Chapter 4 – then C code generation via acados.
- Chapter 8 – Python: Nonlinear MPC (Hovercraft): 12 lessons. Hovercraft ODE and discrete models, EKF in Python, acados solver functions for nonlinear problems, trajectory preview, simulation and results, and C code generation with results.
What is Model Predictive Control – and why should you consider this course?
Model Predictive Control (MPC) is an advanced control strategy in industry. At every sampling interval, an MPC controller solves an optimisation problem over a future prediction horizon, respects hard and soft constraints on inputs and outputs, and applies only the first computed move before repeating the process.
It can be used everywhere: automotive systems, aerospace, robotics, energy grids, and chemical processes.
The challenge? Designing MPC that actually works in deployment – handling nonlinear dynamics, state estimation, constraint tuning, and real-time computation – requires going well beyond textbook equations.
That’s what this course teaches.
Who this Model Predictive Control course is for
This course is designed for people who already know what a control system is and want to go deeper into predictive control – with real code and real examples.
It suits: control engineers wanting to add MPC to their toolkit; mechanical, electrical, and aerospace engineers working on motion control, robotics, or embedded systems; researchers and PhD students who want to implement MPC in Python or MATLAB rather than simulate it in papers; and computer science professionals working with of optimisation and control.
You do not need prior MPC experience. You do need to be comfortable with linear algebra, basic state-space control, and either MATLAB or Python.
Tools and software
MATLAB side: MATLAB, Simulink, Simscape, Simscape Multibody, Control System Toolbox, Model Predictive Control Toolbox, Optimization Toolbox, MATLAB Coder, and Embedded Coder. A trial licence includes all toolboxes except for Embedded Coder, which is only used for the code generation.
Python side: Everything is free and open source. Ubuntu (via WSL on Windows), Python 3, acados (built from source), CasADi, and the acados Python interface. Full installation covered step by step in Chapter 6.

Course Content
You don't currently have access to this content
You don't currently have access to this content
You don't currently have access to this content
You don't currently have access to this content
You don't currently have access to this content
You don't currently have access to this content
Want to know more about me?
Check out my profile and content on LinkedIn and YouTube:
Simone Bertoni – Control Lab – YouTube
and see if you like the topics I discuss!
FAQ – Frequently Asked Questions
No. The course is structured so the MATLAB and Python sections are self-contained. You can follow only the Python path (Chapters 2, 3, 6, 7, 8) at zero cost. Watch Chapter 4 and 5 regardless – they contain important MPC design discussions not repeated elsewhere.
No. Chapter 2 covers the necessary theory to follow the course from scratch, however, deep theorectical knowledge is not covered (that kind of knowledge is better studied in a book). Prior experience with state-space models and control system basics is assumed.
Everything on the Python side – Ubuntu, acados, CasADi, the Python interface – is free and open source. Chapter 6 walks through installation from zero.
Acados is a high-performance, open-source software package for solving nonlinear optimal control problems. Written in C with Python, MATLAB, and Octave interfaces, it’s designed for real-time embedded applications and is used in robotics, automotive systems, and aerospace research worldwide.
Yes. Both the MATLAB and Python sections end with C code generation and verify the results in a C simulator. This is a core part of the course, not an optional add-on.
A DC motor (linear SISO MPC) and a hovercraft in 2-thruster and 3-thruster configurations (nonlinear MIMO MPC with trajectory following and obstacle avoidance).


