Hello @MIDHUNTA30,
First of all, thank you for making this content available. I am beginning my introduction to NMPC and I have two questions regarding the use of fmincon as an optimization solver. First, the vector z is constructed by aggregating Xk and Uk (states and manipulated variables). When you call fmincon, how does it know that it should solve and find the values of only the inputs U for minimizing the cost function? As it is, won't it find the overall combination of X and U which minimizes the cost function?
Second, can you please explain how you defined the non-linear constraints in NMPC1 and NMPC2? And why you didn't do it in the LMPC examples?
Moreover, I am having working on a problem with eight states and two inputs, all with different lower and upper bounds, and I defined them like this:
lb=[x1minones(1,(N+1)),x2minones(1,(N+1)),x3minones(1,(N+1)),x4minones(1,(N+1)),x5minones(1,(N+1)),x6minones(1,(N+1)),x7minones(1,(N+1)),x8minones(1,(N+1)),u1minones(1,N),u2minones(1,N)];
ub=[x1maxones(1,(N+1)),x2maxones(1,(N+1)),x3maxones(1,(N+1)),x4maxones(1,(N+1)),x5maxones(1,(N+1)),x6maxones(1,(N+1)),x7maxones(1,(N+1)),x8maxones(1,(N+1)),u1maxones(1,N),u2maxones(1,N)];
Is this correct?
Thank you!