# Constraining a Double Pendulum

My question is, how do I apply boundary constraints to a Lagrangian such as:

$$90 > \theta_1 > -45$$

and

$$\theta_2 > 0$$

I am trying to use a constrained double pendulum to simulate an underhand throw. I am trying to use the Lagrangian defined from Wolfram's site equation (9) and add constraints to it through Lagrange multipliers.

My confusion comes from the fact that constraints for Lagrange multipliers are normally written as equalities with multiple variables such as:

$$f(\theta_1, \theta_2) = \theta_1 + 2\theta_2 = 90$$

and not as inequalities.

When I looked up inequality optimization, the method I got was to set the inequality as an equality and then solve for the boundaries. This doesn't make to me (in my application) because the system might not be at the boundary through the entire simulation, so setting $$\theta_2 = 0$$ doesn't makes sense to me.

• Constraint reduces the degrees of freedom, but your constraint is numerical, you can’t solve it with Lagrange method. – Eli Jun 24 at 19:35
• Do you have a recommended method instead? – Boto Jun 24 at 19:48
• If you solve the equation numerical you can use limiter integrator for a state variable like $\Theta(t)$ for example – Eli Jun 24 at 20:20
• Why not a variable change like $\theta_1 = f(\mu)$ with $-\frac{\pi}{4}\le f(\mu)\le \frac{\pi}{2}$ like a logistic function? – Cesareo Jun 26 at 16:36