How can I update algebraic state vector model.z using acados python during period T in MPC?

Hi, I hope this message finds this community well. :wave:
I am now using a discrete dynamics module to solve the MPC problem using Acados while part of the model is shown below:
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 :wave:

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