Is it possible to formulate an OCP with time horizon as a state variable

Hi all,

I wonder if one can use ACADOS also to formulate an OCP problem with the time horizon also as a state variable, such as {s}=[T, x, u]. In casadi, one can specify any variable as a state variable, and set dt=T/N as one of the constraints. Any suggestion is welcomed. Thanks a lot.