# Why cant Hamilton mechanics deal with friction

I know the Liouville's theorem. but i just cant understand.
so i considered an example of friction:
ma=-bv;
and the Lagrange is:
L=1/2 mv$$^{2}$$+bxv
/b is a coefficient of friction/

after i substituted it into Hamilton formulation, it turns out to be:
ma=0

so the friction is vanished.

but what's wrong?

Andy Resnick
Friction is a dissipative process; it cannot be derived from a potential and so it has to be put in as a constraint force. Linear friction can be considered by using a dissipation function D = 1/2 kv^2, and so Q =- dD/dv = -kv (sorry for the 'D'). Lagrange's equation then becomes

$$\frac{d}{dt}(\frac{\partial L}{\partial \dot{q}})-\frac{\partial L}{\partial q} = Q$$

Mute
Homework Helper
Friction is a dissipative process; it cannot be derived from a potential and so it has to be put in as a constraint force. Linear friction can be considered by using a dissipation function D = 1/2 kv^2, and so Q =- dD/dv = -kv (sorry for the 'D'). Lagrange's equation then becomes

$$\frac{d}{dt}(\frac{\partial L}{\partial \dot{q}})-\frac{\partial L}{\partial q} = Q$$

What is your "v"? Is it supposed to be the velocity that is identified with $\dot{q}$? If so, then your proposed addition to the Lagrangian is just a kinetic energy term and contributes no friction term, just another ma-like term. If v is something different, then what is it supposed to be?

To the OP: to get dissipation in a Lagrangian you usually have to include an explicitly time dependent term, such as multiplying the "frictionless" lagrangian by $\exp(\gamma t/m)$. Because of the explicit time dependence you will have to use the product rule when doing the time derivative, and as a result the $\dot{q}$ will survive, and afterwards the overall exponential factor cancels out leaving you with the damped equation of motion.

Now, it should be noted that there was no physical insight that got us this lagrangian, so although we derived a damped equation of motion there was no physics to it. Another, more physical way of deriving a damped equation of motion is to couple the system you're interested in to a large (essentially infinite) reservoir system, typically harmonic oscillators, and then "integrate out" the reservoir degrees of freedom which leaves you with an effective damping term. See

http://en.wikipedia.org/wiki/Caldeira-Leggett_model

That discusses it in the quantum case, and what manipulations one does to recover the "classical dissipation" scenarios.

Last edited:
physicsworks
Gold Member
What is your "v"? Is it supposed to be the velocity that is identified with $\dot{q}$? If so, then your proposed addition to the Lagrangian is just a kinetic energy term and contributes no friction term, just another ma-like term.

Where do you see "m" (the mass) in Andy's equation?
Andy Resnick said:
D = 1/2 kv^2

Mute
Homework Helper
Where do you see "m" (the mass) in Andy's equation?

His "k" is the "m". It's an "ma-like" term in that the result will be $k\ddot{q}$, so it contributes an acceleration term to the lagrangian, not a friction term, unless he is using v to mean something different than $\dot{q}$.

physicsworks
Gold Member
Have you ever heard about Rayliegh's dissipation function?
$$\mathcal{F} = \frac{1}{2} \sum_{i} \left( k_x v_{ix}^2 + k_y v_{iy}^2 + k_z v_{iz}^2 \right)$$
where the summation is over the particles of the system.
I believe it is this function that Andy wrote for one particle and for one degree of freedom. And there is no way that "k" there are masses. This makes no sense.

gabbagabbahey
Homework Helper
Gold Member
His "k" is the "m". It's an "ma-like" term in that the result will be $k\ddot{q}$, so it contributes an acceleration term to the lagrangian, not a friction term, unless he is using v to mean something different than $\dot{q}$.

No, $k$ does not have units of mass, and he is not adding $D$ to the Lagrangian.

I know the Liouville's theorem. but i just cant understand.
so i considered an example of friction:
ma=-bv;
and the Lagrange is:
L=1/2 mv$$^{2}$$+bxv
/b is a coefficient of friction/

after i substituted it into Hamilton formulation, it turns out to be:
ma=0

so the friction is vanished.

but what's wrong?
If I take the $L$ you gave, then the partial derivatives with respect to $x$ and $v$ are:

$$\frac{\partial L}{\partial v} = m v + b x$$

$$\frac{\partial L}{\partial x} = b v$$

so the equation of motion corresponding to this Lagrange function is:

$$\frac{d}{dt}(m v + b x) - b v = 0$$

$$m \dot{v} + b v - b v = 0$$

$$m \ddot{x} = 0$$

So, this does not give the equation that you started with.

Mute
Homework Helper
No, $k$ does not have units of mass, and he is not adding $D$ to the Lagrangian.

Ok, as long as D is not being added to the Lagrangian, then yes, k need not have units of mass.

If D is not added to the Lagrangian, then that avoids the problem of ending up with another inertia term in the equation of motion, but then my question is how does it find its way into the equation of motion? Do you just put it there, or is there an actual derivation?

physicsworks
Gold Member
So, this does not give the equation that you started with.
Exactly!
see enricfemi's first post
after i substituted it into Hamilton formulation, it turns out to be:
ma=0

Exactly!
see enricfemi's first post

But, I am saying that even the Lagrange's equations do not give the equation he started with.

physicsworks
Gold Member
If D is not added to the Lagrangian, then that avoids the problem of ending up with another inertia term in the equation of motion, but then my question is how does it find its way into the equation of motion? Do you just put it there, or is there an actual derivation?
Yes, you just put this term
$$-\frac{\partial D}{\partial \dot{x_i}}$$
in the right-hand side of the Lagrange's equations.

physicsworks
Gold Member
But, I am saying that even the Lagrange's equations do not give the equation he started with.
Because he added the friction term to Lagrangian.

Exactly!
see enricfemi's first post

Because he added the friction term to Lagrangian.

You clearly do not understand what I am saying. He says he wants to get the equation of motion $m \ddot{x} = - b \dot{x}$ from some Lagrange function $L$. This means that, given $L$, the Euler-Lagrange equation $\frac{d}{dt}(\frac{\partial L}{\partial \dot{x}}) - \frac{\partial L}{\partial x} = 0$ should be equivalent to the above stated second order differential equation. I am just saying that the $L$ he had provided does not give the equation of motion under friction proportional to the speed of the particle.

physicsworks
Gold Member
Dickfore, I don't know where did enricfemi get his L, but you can't just add the friction term to Lagrangian at all. To take into account the friction you need to put $$-\frac{\partial D}{\partial \dot{x_i}}$$ to the right-hand side of the Lagrange's equations. In these new equations L still contains the potenital of conservative forces as before and $$-\frac{\partial D}{\partial \dot{x_i}}$$ represents the forces not arising from a potential.

Dickfore, I don't know where did enricfemi get his L, but you can't just add the friction term to Lagrangian at all. To take into account the friction you need to put $$-\frac{\partial D}{\partial \dot{x_i}}$$ to the right-hand side of the Lagrange's equations. In these new equations L still contains the potenital of conservative forces as before and $$-\frac{\partial D}{\partial \dot{x_i}}$$ represents the forces not arising from a potential.

What is the friction term is the friction force is, let's say, proportional to the square of the speed of the particle, i.e.:

$$\mathbf{F}_{\textup{fr}} = -c v \mathbf{v}$$

Mute
Homework Helper
Yes, you just put this term
$$-\frac{\partial D}{\partial \dot{x_i}}$$
in the right-hand side of the Lagrange's equations.

Surely there's a better derivation than that. Otherwise one might as well just say
"Yes, you just put this term
$$-k\dot{q}$$
in the right-hand side of Lagrange's equations"

The best I can find is a derivation that shows that when there are non-conservative forces

$$\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q}}\right) - \frac{\partial L}{\partial q} = \sum_{k=1}^p \mathbf{F}^{n.c.}_j \cdot \frac{\partial \mathbf{r}_j}{\partial q_k},$$
where $\mathbf{r}_j = \mathbf{r}_j(q_1,q_2,\dots,q_p,t)$ is the position of "particle" j in terms of the generalized coordinates q.

It looks to me like viscous damping will just generate the -kv term, which then gets identified as being the derivative of (1/2)kv^2 (or a more complicated form for more degrees of freedom).

In any event, this is interesting to know about, but I should again point out that this isn't the only way to get friction. Like I said earlier, the Lagrangian

$$L = e^{\gamma t/m}\left( \frac{1}{2}m\dot{q}^2 - V(q)\right)$$
will, upon plugging it into the usual Euler Lagrange equation, will give you a damped equation of motion. It's not exactly a physical derivation, but I wager it may be more useful than Rayleigh's dissipation function when doing path integral calculations, for instance, as this way you have an actual lagrangian to work with.

Last edited:
sorry for the confusion.what i mean is that:

i modified Lagrange function by this form (which i saw in some books):
L=T-U+W
w here is the work by dissipation force.

and it really worked for
$$\frac{d}{dt}(\frac{\partial L}{\partial \dot{q}})-\frac{\partial L}{\partial q} = 0$$

my question is that(like Dickforce said):
when i substitute it into hamilton's equations:
$$\frac{\partial L}{\partial v} = m v + b x$$

$$\frac{\partial L}{\partial x} = b v$$
it cannt be right.
why such modification worked for Langrang's equation, but not hamilton's.
(i examined it also with changed particle in uniform magnetic field, it really works for both)

Last edited:
Andy Resnick
What is your "v"? Is it supposed to be the velocity that is identified with $\dot{q}$? If so, then your proposed addition to the Lagrangian is just a kinetic energy term and contributes no friction term, just another ma-like term. If v is something different, then what is it supposed to be?

To the OP: to get dissipation in a Lagrangian you usually have to include an explicitly time dependent term, such as multiplying the "frictionless" lagrangian by $\exp(\gamma t/m)$. Because of the explicit time dependence you will have to use the product rule when doing the time derivative, and as a result the $\dot{q}$ will survive, and afterwards the overall exponential factor cancels out leaving you with the damped equation of motion.

Now, it should be noted that there was no physical insight that got us this lagrangian, so although we derived a damped equation of motion there was no physics to it. Another, more physical way of deriving a damped equation of motion is to couple the system you're interested in to a large (essentially infinite) reservoir system, typically harmonic oscillators, and then "integrate out" the reservoir degrees of freedom which leaves you with an effective damping term. See

http://en.wikipedia.org/wiki/Caldeira-Leggett_model

That discusses it in the quantum case, and what manipulations one does to recover the "classical dissipation" scenarios.

I'm having a very difficult time trying to understand what you are saying. For example, in your first paragraph, you say I added a term to the Lagrangian when I did not.

Then there was some other claims about dissipation that didn't make sense (to me).

In case my original message was unclear (because I was sloppy about the notation), let me write it out explicitly:

(for example) L = 1/2 mv^2 - 1/2 kx^2

This gives me: ma - kx = Q (= bv)

Or, ma - bv - kx = 0, which is the usual damped oscillator equation. I don't see why I need an 'explicit time dependent term'.

Or am I not understanding you?

Is the constraint force bv given by a first-principles derivation? Definitely not. We do not yet have a viable microscopic theory of dissipation.

Mute
Homework Helper
I'm having a very difficult time trying to understand what you are saying. For example, in your first paragraph, you say I added a term to the Lagrangian when I did not.

Then there was some other claims about dissipation that didn't make sense (to me).

In case my original message was unclear (because I was sloppy about the notation), let me write it out explicitly:

(for example) L = 1/2 mv^2 - 1/2 kx^2

This gives me: ma - kx = Q (= bv)

Or, ma - bv - kx = 0, which is the usual damped oscillator equation. I don't see why I need an 'explicit time dependent term'.

Or am I not understanding you?

Is the constraint force bv given by a first-principles derivation? Definitely not. We do not yet have a viable microscopic theory of dissipation.

I misunderstood your original post: I thought you were adding a term to the Lagrangian that you claimed gave the desired damping term in the equation of motion. The later posters then explained what you meant. You were using an extension of the Euler-Lagrange equations that I had not previously seen, thus the confusion.

As for the time-dependent term, this is a way one can modify the Lagrangian directly such that the Euler-Lagrange equation with zero right hand side holds. As this modifies the lagrangian instead of the equation of motion, it may be more useful for certain calculations, such as path integral calculations.

Of course, as I said, perhaps the more natural way to model dissipation is coupling to a bath of harmonic oscillators. It's a phenomenological approach, but seems to be pretty useful.

I misunderstood your original post: I thought you were adding a term to the Lagrangian that you claimed gave the desired damping term in the equation of motion. The later posters then explained what you meant. You were using an extension of the Euler-Lagrange equations that I had not previously seen, thus the confusion.

As for the time-dependent term, this is a way one can modify the Lagrangian directly such that the Euler-Lagrange equation with zero right hand side holds. As this modifies the lagrangian instead of the equation of motion, it may be more useful for certain calculations, such as path integral calculations.

Of course, as I said, perhaps the more natural way to model dissipation is coupling to a bath of harmonic oscillators. It's a phenomenological approach, but seems to be pretty useful.

guys! why not focus on the original question first?

Mute
Homework Helper
guys! why not focus on the original question first?

The question was not answered to your satisfaction? Ok, perhaps we're not quite getting what your question is. Let's double check: If I understand you from your posts so far, your question is "Why does the lagrangian $L = 1/2 m\dot{q}^2 -kq\dot{q}$ give you the correct equation of motion when I plug it into the Euler-Lagrange equations but not when I plug it into Hamilton's equations?"

The answer to that is, as Dickfore showed, that Lagrangian does not give you the correct equation of motion in either scenario. Using the EL equation you still find that ma = 0. So the problem is a) you didn't use the correct lagrangian or b) you didn't properly modify the EL equations.

Andy Resnick provided you with a solution to b, and I gave you a solution to a.

Last edited:
The question was not answered to your satisfaction? Ok, perhaps we're not quite getting what your question is. Let's double check: If I understand you from your posts so far, your question is "Why does the lagrangian $L = 1/2 m\dot{q}^2 -kq\dot{q}$ give you the correct equation of motion when I plug it into the Euler-Lagrange equations but not when I plug it into Hamilton's equations?"

The answer to that is, as Dickfore showed, that Lagrangian does not give you the correct equation of motion in either scenario. Using the EL equation you still find that ma = 0. So the problem is a) you didn't use the correct lagrangian or b) you didn't properly modify the EL equations.

Andy Resnick provided you with a solution to b, and I gave you a solution to a.