# Deriving equations of motion using Lagrangian formalism for inverted pendulum on a cart with friction between pendulum and pin

I know this is a problem with plenty of examples and solutions but I can't find one where the friction between pendulum and pin (I know it's negligible) is taken into account. My main question is if you insert friction between pendulum do you need to insert additional terms in the equation for the cart (I assume the force of friction that appears on the pendulum should have a counter force on the cart)? And if so how would you put that in the lagrangian?

• So really the more general question is how do you account for dissipative forces in Lagrangian mechanics? – Aaron Stevens Dec 3 '18 at 17:45
• Not really, I know that you can insert dissipative forces in the Lagrangian by using Rayleigh's function. What I'm wondering about is if we insert a friction force that opposses the movement of the pendulum do we need to put an equal but oppossite force that affects the cart? Since I assume no force can appear out of nowhere. – Giedrius Želvys Dec 3 '18 at 17:52