I am writing my master thesis, which is to control a PMSM basically. Which is very non linear. I have got a decent MPC working with Casadi in simulink, but the result should be alot better (read alot of other thesis).
I want to minimize the following cost function:

I have made a symbolic object "SX" called "delta_u" which looks like:
delta_u(1) = U(1) - U(0)
delta_u(2) = U(2) - U(1) and so on. But I am getting the following error message in simulink:
