zmint=0∑Nft(xt+1,ut)s.t.⎩⎨⎧xt+1=g(xt,ut),h(xt,ut)≤0,x0:given,z=(u0,x1,u1,x2,…uN−1,xN)Tt=0,…,N−1t=0,…N Where N: The prediction horizon ft: The state cost gt: The dynamic model ht: State-and input constraints