The constraint forces have the dot product 0 ($\textbf C \cdot \textbf x=0$, where $\textbf C$ and $\textbf x$ are vectors, x being the virtual displacement. But the dot product is 0 if $\textbf C$ and $\textbf x$ are perpendicular. So, are the constraint forces always perpendicular to the virtual displacement? Forces such as tension are not always perpendicular to the virtual displacement. Thus, I am asking why forces like tension are not written in the lagrangian equation of lagrangian mechanics? To be more specific, see the example of the Atwood machine.
II) Concerning Atwood's machine:
The tension forces at the two ends of an infinitesimal segment of a massless string cancel each other.
The internal forces of an unstretchable string and the internal forces of the wheel produce no virtual work, cf. this Phys.SE post.
The normal force between the wheel and the string produces no virtual work.
Sliding friction between the wheel and the string could produce virtual work.