I'm working on a simple simulation for an inverted pendulum mounted on a cart. I derived the equations of motion using Lagrangian dynamics, but I want to go back and add viscous damping terms to the linear motion of the cart, as well as the angular motion of the pendulum. I also want to add a driving force to the cart (my end goal is a non-linear controls simulation). Can I add these terms to the equation I initially derived, or do I need to re-derive the equations from the beginning? I think I know the answer to this, but I was hoping someone might have better advice - it's been a long time since I've done anything with Lagrange multipliers (or Lagrange dynamics at all, for that matter).(adsbygoogle = window.adsbygoogle || []).push({});

This is what I came up with for the conservative system: [tex]x[/tex] is the position of the cart, and [tex]\theta[/tex] is the angular position of the pendulum, with zero being straight up (vertical) from the cart. The cart has mass [tex]m_{c}[/tex] and the pendulum has mass [tex]m_{p}[/tex] and length [tex]l[/tex]. The below equation is a combination of the equations for both generalized coordinates.

[tex]\stackrel{..}{x}(m_{c} + m_{p} - cos(\theta)) + \stackrel{..}{\theta}(m_{p}l cos(\theta) - l/4) + sin(\theta)(g/2 - m_{p}l\stackrel{.}{\theta}^{2})=0[/tex]

My gut feeling is that I cannot simply add [tex]B_{c} \stackrel{.}{x} + B_{p} \stackrel{.}{\theta}[/tex] to the left hand side and set the equation equal to [tex]F(t)[/tex]... Am I wrong?

Thanks for your help!

-Kerry

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Equations of Motion for Inverted Pendulum

**Physics Forums | Science Articles, Homework Help, Discussion**