Is it possible to change the number of decision variables while computing?

Good Day!

I’m working on the implementation of a stochastic MPC using Acados python interface. I’m wondering if it’s possible to change the number of decision variables based on a external flag of each single node. For instance, I want to use 8 state variables for the first five nodes, and afterwards I only want to use the first 4 states from all 8 states. Currently I just keep the rest of the states as the same and only propagate the first 4 states through system dynamics. It already works well but I still want to improve the computational time. In my case, I think if it’s possible to change the number of state variables, it will significantly decrease the computational time.

Besides, do you have some suggestions or tricks that might help improve the computational speed? It would be very nice if you could share some experience! Thanks in advance!

Best,
Chenyang

Hi,

varying state dimensions are not supported in acados for now.

It would be nice to add support for this though.
I don’t have a good alternative suggestion for this, unfortunately.

Cheers!