| Given | Model f, initial conditions x(0), prediction horizon p, control horizon m, sampling time Δt, and weighting matrices Q and R |
| Step 1 | At the current sampling time , set |
| Step 2 | Solve Equations (23)-(26) for a sequence of m optimal input variables |
| Step 3 | Set and inject the input to the plant |
| Step 4 | At , obtain the plant measurement |
| Step 5 | Corresponding to , estimate the states |
| Step 6 | set |
| Step 7 | Shift the prediction horizon p forward and repeat Step 1 |