# Writing Lagrangian

mattmatt321

## Homework Statement

I worked a textbook problem earlier where I had to write the Lagrangian for a pendulum (of mass m and length l) connected to a massless support moving along the x-axis. I chose the angle theta as my generalized coordinate, since the problem specified that the acceleration of the massless support was constant in the +x direction, the coordinate "theta" seemed to completely describe the system.

Now, I'm trying to figure out how the Lagrangian would change if the support was no longer massless, and if it was free to move along the x-axis, instead of at a constant acceleration in one direction.

## Homework Equations

The potential energy stays the same, U = -mglcosθ.

The kinetic energy I found when the support was massless and at constant acceleration is (1/2)(m)(a2t2 - 2atlcosθ(dθ/dt) + l2(d2θ/dt2).

The Lagrangian is defined as L = T - U.

## The Attempt at a Solution

So, now we have the support with mass M and the acceleration is no longer a constant "a". I considered just adding the mass M to m in the kinetic energy equation, but I think there's more to it. I suppose I need to incorporate both θ and the x location of the support to describe the system, but it's tricky to describe the kinetic energy fully. Any help is appreciated as always.

## Answers and Replies

Maxim Zh
You should add the kinetic energy of the support as a separate term:
$$T = T_{\text{pend}} + T_{\text{sup}}$$

mattmatt321
Thanks, that was my primary question. I'm always a little worried when I'm doing problems like this, that the different parts of the system are actually interacting with each other, and I'll forget term(s) in the kinetic energy.