# Lagrangian Mechanics + Account for friction of block

$\newcommand{\dd}{\mathrm{d}}$ I am trying to work out the Lagrangian mechanics for a pendulum problem in order to animate it. I'm working on one of the examples in the Wikipedia page on Lagrangian mechanics where a pendulum is attached to a block as in the picture below

I understand how most of this works with the exception of the friction between the block and the surface it resides on.

I've solved the problem with just the Kinetic + Potential energy of the block

$$\frac{\partial L}{\partial x} - \frac{\dd}{\dd t}\left(\frac{\partial L}{\partial \dot{x}}\right) = 0;$$ $$\frac{\partial L}{\partial \theta} - \frac{\dd}{\dd t}\left(\frac{\partial L}{\partial\dot\theta}\right) = 0;$$

From another example from my class notes of a disk rolling down an inclined plane in 2D the friction can be accounted for by adding a constraint that relates the two generalized coordinates. Do I need to do something similar for friction in this case? How would I do that?

• Google friction, Lagrange, multiplier and you will get answers. – Lewis Miller Mar 5 '16 at 0:28
• In the past, I've set the Euler La Grange equation for the x variable equal to the non-conservative forces acting in that direction instead of equal to 0. – Mephistopheles Mar 5 '16 at 0:35
• So, @Mephistophales, it should be dL/dx - (d/dt)(dL/dx') = frictionCoefficient * Mg;...? – Nick Mar 5 '16 at 0:39
• Friction coefficient times the NORMAL force – Mephistopheles Mar 5 '16 at 0:43
• You will have to do this piecewise, with a friction "potential" term equal to $\pm \mu F_{n} x$, solve the EOM for both signs, and then piece together a solution so that $\dot x$ and $x$ are both continuous at the turnaround points where $\dot x = 0$ – Jerry Schirmer Mar 5 '16 at 1:17