Hi,
We've been working on a program that tries to minimize the net moments in a double pendulum while moving to a desired final position. The base of the double pendulum is fixed at (0,0) and the endpoint of the double pendulum is constrained to only move in the y-direction.
The equations are formulated such that input force (F3x) is needed to enforce the constraint on the endpoint.
We have checked our expressions of the equations of motion in a passive (without input moments) forward simulation. We checked the constraint violation and the energetics of the system and in a forward simulation model these seem to check out fine.
However, when we try to run an optimal control optimization for this particular problem, we encounter the error: "Not enough degrees of freedom". Which seems to result from the equality constraint of the endpoint (line 91 92 in run_casadi_double_pendulum).
Thus our question is: how should we implement this kinematic constraint on a double pendulum in Casadi?
Attached is the program we wrote to tackle this problem and the script Ab_double_pendulum_F3x which defines our equations of motion.
Kind regards,
Roeland and Luuk