Hi, I hope this message finds this community well.

I am now using a discrete dynamics module to solve the MPC problem using Acados while part of the model is shown below:

x_{N+1}=f(x_{N},u_N,z_N)

z_{N+1}=g(z_{N})

I use model.disc_dyn_expr to update my state vector model.x according to the first equation. However, If I set z to be the algebraic variables of the DAE, are there any ways to update my variable z during optimization? Or I must augment the variable z into x to make it happen?

Thank you guys！

Hi

the discrete dynamics module does not support algebraic variables. From the equations that you provided, it looks like z should not be an algebraic variable but part of your state vector.

I am not exactly sure what you mean by updating the values of z during optimization. If z should just be fixed values you might want to implement them as problem parameters.

Best, Katrin