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 t k , set x ( t k 1 ) ( t k )

Step 2

Solve Equations (23)-(26) for a sequence of m optimal input variables { U ( 1 ) , U ( 2 ) , , U ( m ) }

Step 3

Set u ( t k ) U ( 1 ) and inject the input to the plant

Step 4

At t k + 1 , obtain the plant measurement y m

Step 5

Corresponding to y m , estimate the states x * ( t k + 1 )

Step 6

set t k t k + 1

Step 7

Shift the prediction horizon p forward and repeat Step 1