I am trying to design a custom MPC to follow a trajectory. The cost function has the form of
(x-x_i)^T Q_i (x-x_i) + (u-u_i)^T R (u-u_i)
where the x_i is desired value at that point. Is this possible using this framework? if so how would I go about setting up such a cost function?