Hi
and welcome to the acados forum! Your analysis of the issue is quite right: In approach 1, the jacobian of f_expl
is singular leading to NaNs right away. In approach 2, the number of differential and algebraic states does not match the number of equations.
I am wondering why you need to model s
as an algebraic variable in the first place. If they only appear in the constraint x2*s +x1*(1-s)
, you might simply model them as controls with additional bounds constraining them to be in [0, 1].
Best, Katrin