Finding the value of the holonomic constraint forces is done as follows.
- The equations are:
\begin{align*}
&\frac{\partial L}{\partial\vec{q}}-\frac{d}{dt}\frac{\partial L}{\partial\vec{\dot{q}}}=\sum_{i}^{n_c}\lambda_i\frac{\partial f_i(\vec{q},t)}{\partial\vec{q}}\quad,\text{($n_q$ equations )}\tag{1}\\
& f_i(\vec{q},t)=0\quad i=1\,,\ldots\,,n_c\quad\text{($n_c$ constraints equations) }\tag{2}\\\\
&\text{If we evaluate equation (1) we get:}\\
&\vec{f}_q(\ddot{\vec{q}}\,,\dot{\vec{q}}\,,\vec{q}\,,\vec{\lambda)}=0
\tag{3}\\
&f_i(\vec{q},t)=0 \tag{4}
\end{align*}
Equations (3) and (4) are $n_q+n_c$ equations for $\ddot{\vec{q}}$ and $\vec{\lambda}$ unknowns.
How to solve:
- Example: Pendulum
\begin{align*}
&T=\frac{1}{2} m\,\dot{x}^2+\frac{1}{2} m\,\dot{y}^2 \qquad V=\,m\,g\,y\
\qquad L=T-V\\
&\text{with:}\quad q_1=x\quad q_2=y\quad \Rightarrow\\
&\frac{\partial L}{\partial\vec{q}}=[0\,,-m\,g]\, ,\qquad \frac{d}{dt}\frac{\partial L}{\partial\vec{\dot{q}}}=
[m\,\ddot{q}_1\,,m\,\ddot{q}_2]\\\\
&\text{constraint equation (where $l$ is the pendulum length) :}\\\
&f_1=x^2+y^2=l^2=q_1^2+q_2^2-l^2=0\tag{5}\\
& \sum_{i}^{n_c}\lambda_i\frac{\partial f_i(\vec{q},t)}{\partial\vec{q}}=\lambda[2\,q_1\,,2\,q_2]\\\\
&\Rightarrow\quad\text{Insert into equation (3)}\\
&[0\,,m\,g]-
[m\,\ddot{q}_1\,,m\,\ddot{q}_2]-\lambda[2\,q_1\,,2\,q_2]=0\quad &\tag{6}\\\\
&\text{if we differentiate twice the constraint equation (5) we get: }\\
&\frac{d^2}{dt^2}f_1=\frac{d^2}{dt^2}(q_1^2+q_2^2-l^2)=
2(\dot{q}_1^2\,\ddot{q}_1+\dot{q}_2^2\ddot{q}_2)=0\tag{7}
\end{align*}
We can now solve equation (6) and (7) to get $\ddot{q}_1\,,\ddot{q}_2$ and the generalized constraint force $\lambda$:
\begin{align*}
&\ddot{q}_1=-g\,\frac{q_1\,\dot{q}_2}{q_1\,\dot{q}_1^2+q_2\,\dot{q}_2}\tag{8}\\
&\ddot{q}_2=-g\,\frac{q_1\,\dot{q}_1^2}{q_1\,\dot{q}_1^2+q_2\,\dot{q}_2}\tag{9}\\
&\lambda=\frac{1}{2}\,m\,g\frac{\dot{q}_2}{q_1\,\dot{q}_1^2+q_2\,\dot{q}_2}\\\\
&\text{The constraint force $F_x$ [N] toward the $x$-axis is:} |F_x|=|\lambda\,2\,q_1|\\
&\text{and toward the $y$-axis: }\qquad \qquad
\qquad \qquad \quad\, |F_y|=|\lambda\,2\,q_2|
\end{align*}