I think I may be forming the Jacobian of the constraint function incorrectly. If the constraint function takes the free parameters (n * 6 + 12) as arguments and the jacobian of the partial is needed with respect to those parameters then you will have a 6 x (n * 6 + 12) jacobian matrix. Is the partial of f with respect to the ith and ith + 1 state variable the same thing? Is the Jacobian a sparse matrix full of sub-Jacobian's that all have the same numbers for the partials of the state variables?
I think I may be forming the Jacobian of the constraint function incorrectly. If the constraint function takes the free parameters (n * 6 + 12) as arguments and the jacobian of the partial is needed with respect to those parameters then you will have a 6 x (n * 6 + 12) jacobian matrix. Is the partial of f with respect to the ith and ith + 1 state variable the same thing? Is the Jacobian a sparse matrix full of sub-Jacobian's that all have the same numbers for the partials of the state variables?