3
$\begingroup$

Question: How can I mix the concepts of Lagrange Mechanics and KKT conditions? I've learned that Lagrange Mechanics derivation comes from variational calculus, and in some formulations, we can add Lagrange multipliers $\lambda$ due to equality constraints $\mathbf{h} = \mathbf{0}$. But I have no idea how to treat the inequality constraints $\mathbf{g} \le \mathbf{0}$ or even make a variational formulation for it. Can anyone help me?

Some reminders of Lagrange Mechanics and KKT conditions are below with an example of two pendulums that can collide with each other.

My final interest is to get a numerical method (like I do have one that works without $\mathbf{g}$) such that I only iterate matrix without the verification if $\mathbf{g}$ is always negative. With that, I can model a bouncing ball or a system with $n$ rigid bodies which can collide with each other.

Given a function $f(\mathbf{x})$, we want to minimize $f$ subject to functions $\mathbf{g}$ and $\mathbf{h}$ such that

$$ \mathbf{h}(\mathbf{x}) = \mathbf{0} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mathbf{g}(\mathbf{x}) \le \mathbf{0} $$

Then we define a new function $\mathfrak{L}$

$$ \mathfrak{L}(\mathbf{x}, \ \mu, \ \lambda) = f(\mathbf{x}) + \sum_{i} \mu_i \cdot g_i + \sum_{j} \lambda_j \cdot h_j $$

And then we want to find the triad $(\mathbf{x}^{\star}, \ \mu^{\star}, \ \lambda^{\star})$ such that.

$$ \nabla f(\mathbf{x}^{\star}) + \sum_{i} \mu_i^{\star} \cdot \nabla g_i(\mathbf{x}^{\star}) + \sum_{j} \lambda_j^{\star} \cdot \nabla h_j(\mathbf{x}^{\star}) = \mathbf{0} $$

$$ \mu_{i}^{\star} \cdot g_{i}(\mathbf{x}^{\star}) = 0 \Rightarrow \begin{cases} \text{if} \ \ \ \mu_{i}^{\star} = 0 \ \ \ \ \ \ \ \ \ \text{then} \ \ \ \ g(\mathbf{x}^{\star}) < 0 \\ \text{if} \ \ \ g(\mathbf{x}^{\star}) = 0 \ \ \ \ \text{then} \ \ \ \ \mu_{i}^{\star} > 0 \end{cases} $$

Given the kinetic $T$ and the potential $V$ energies, we have the Lagrangian as $\mathcal{L} = T - V$. If there's no force and no constraint functions, we get the Lagrange's equation (second kind)

$$ \underbrace{\dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \mathbf{\dot{x}}}\right) - \dfrac{\partial \mathcal{L}}{\partial \mathbf{x}}}_{\mathbf{L}} = \mathbf{0} $$

When we allow constraint functions $h$, we get an additional term due the Lagrange Multipliers and then we get the Lagrange's equation (first kind)

$$ \mathbf{L} + \sum_{i} \lambda_{i} \dfrac{\partial h_{i}}{\partial \mathbf{x}} = \mathbf{0} $$

Example:

I want to model two pendulums of mass $m$ which are at the same origin and they can collide one with each other. To this question, I will use cartesian coordinates cause we don't need to treat $\cos$ and $\sin$, and the matrix are constants.

  • Circular orbit: The points $(x_1, \ y_1)$ and $(x_2, \ y_2)$ are in the circle of center $(0, \ 0)$ and radius $1$

\begin{align*} h_{1}(x_1, \ y_1, \ x_2, \ y_2) & = x_1^2 + y_1^2 - 1\\ h_{2}(x_1, \ y_1, \ x_2, \ y_2) & = x_2^2 + y_2^2 - 1 \end{align*}

  • Collision: The point $(x_2, \ y_2)$ is always to the left of $(x_1, \ y_1)$.

$$ g_{1}(x_1, \ y_1, \ x_2, \ y_2) = x_2 - x_1 $$

  • Kinetic Energy: Translation of each point

$$ T = \dfrac{m}{2}\left(\dot{x}_1^2+\dot{y}_1^2+\dot{x}_2^2+\dot{y}_2^2\right) $$

  • Potential Energy: The vertical position of each point

$$ V = -mg \left(y_1 + y_2\right) $$

  • Lagrange mechanical term:

$$ \mathbf{L} = \dfrac{d}{dt}\left(\dfrac{\partial \mathcal{L}}{\partial \mathbf{\dot{x}}}\right) - \dfrac{\partial \mathcal{L}}{\partial \mathbf{x}} = \begin{bmatrix} m & & & \\ & m & & \\ & & m & \\ & & & m \\ \end{bmatrix} \begin{bmatrix} \ddot{x}_{1} \\ \ddot{y}_{1} \\ \ddot{x}_{2} \\ \ddot{y}_{2} \end{bmatrix} - \begin{bmatrix} 0 \\ mg \\ 0 \\ mg \end{bmatrix} $$

PS: I did not put the collision type yet (elastic, inelastic, so on).

$\endgroup$
2

0

You must log in to answer this question.

Browse other questions tagged .