How do I know if the Hamiltonian is constant?

AI Thread Summary
The discussion revolves around the Hamiltonian H = (m/2)(\dot{Q}^2 - ω^2Q^2) and whether it can be treated as constant when differentiating with respect to time. Participants clarify that while the Hamiltonian appears independent of time, the variables Q and \dot{Q} are functions of time, complicating the differentiation. It is noted that the correct form for the Hamiltonian of an oscillator should include a positive sign in the second term. The conversation also emphasizes that for H to be constant, it must be expressed in terms of p and q, and if time does not appear explicitly, it is conserved. Ultimately, the participants suggest substituting Q into the Hamiltonian to check for time-dependence.
komodekork
Messages
17
Reaction score
0
Lets say H = \frac{m}{2} (\dot{Q}^2 - \omega^2 Q^2 )
where Q is the generalized coordinate.
It doesn't explicitly depend on time, but the Q and the \dot{Q} does.
If i differentiate it with respect to time it should be zero if it's constant, right?
So i guess my question is should i treat the Q's as constants or as functions depending on time when i differentiate?
 
Last edited:
Physics news on Phys.org
komodekork said:
Lets say H = \frac{m}{2} (\dot{Q}^2 - \omega^2 Q^2 )
where Q is the generalized coordinate.
It doesn't explicitly depend on time, but the Q and the \dot{Q} does.
If i differentiate it with respect to time it should be zero if it's constant, right?
So i guess my question is should i treat the Q's as constants or as functions depending on time when i differentiate?

If you want to view it like that, then if the Hamiltonian is explicitly independent of time, then it just comes from equality of mixed partials.

\dot{H}=\frac{\partial H}{\partial q}\dot{q}+\frac{\partial H}{\partial p}\dot{p} =<br /> \frac{\partial H}{\partial q} \left(\frac{\partial H}{\partial p}\right)+<br /> \frac{\partial H}{\partial p}\left(-\frac{\partial H}{\partial q}\right)<br /> =0
 
Last edited:
RedX said:
If you want to view it like that, then if the Hamiltonian is explicitly independent of time, then it just comes from equality of mixed partials.
I don't understand what you mean, could you please explain?
 
komodekork said:
I don't understand what you mean, could you please explain?

oops, you're right. it's not equality of mixed partials, but comes from Hamilton's equations.

so take H=.5(p2+q2)

Then dH/dp=p and dH/dq=q
But p.=-q and q.=p

So H.=p(-q)+q(p)=0
 
Hm...
I don't know if I see what you are getting at. I'm not sure if you are telling me that what you did is right or wrong.

Should it be \frac{d}{dt}(H) = m ( \dot{Q} \ddot{Q} - \omega^2 Q \dot{Q} )

or just

\frac{d}{dt}(H) = 0
 
komodekork said:
Hm...
I don't know if I see what you are getting at. I'm not sure if you are telling me that what you did is right or wrong.

Should it be \frac{d}{dt}(H) = m ( \dot{Q} \ddot{Q} - \omega^2 Q \dot{Q} )

or just

\frac{d}{dt}(H) = 0

oops, sorry. First of all, your Hamiltonian doesn't represent an oscillator. If it does, then the second term should be + rather than -:
<br /> H = \frac{m}{2} (\dot{Q}^2 + \omega^2 Q^2 )<br />

So as you say: <br /> \frac{d}{dt}(H) = m ( \dot{Q} \ddot{Q} + \omega^2 Q \dot{Q} ) <br />

Now from the equations of motion of an oscillator, \ddot{Q}=-\omega^2 Q. PLugging that in should get you zero.
 
I don't know what my Hamilton represents. I may have done something wrong.

I all i got is this lagrangian L = \frac{m}{2} (\dot{q}^2 sin^2(\omega t) + \dot{q} q \omega sin(2\omega t) + \omega^2 q^2)
and this new coordinate Q = q sin(\omega t)

after this substitution i get L = \frac{m}{2} (\dot{Q}^2 + \omega^2 Q^2)

then i make the Hamiltonian H = p\dot{Q} - L

and get H = \frac{m}{2}(\dot{Q}^2 - \omega^2 Q^2)



Then the question is, is the Hamiltonian constant?

Thanks for helping me out btw.
 
But forget all of that, just in a genreal case,
if H=H( \dot{q},q) is it constant just because it's not H=H(p,q,t)?
Or because it cancels out?
 
Last edited:
you need to write your Hamiltonian in terms of p and q not in terms of q and q-dot,
and THEN if time doesn't appear explicitly it's conserved.
 
  • #10
komodekork said:
I don't know what my Hamilton represents. I may have done something wrong.

I all i got is this lagrangian L = \frac{m}{2} (\dot{q}^2 sin^2(\omega t) + \dot{q} q \omega sin(2\omega t) + \omega^2 q^2)
and this new coordinate Q = q sin(\omega t)

after this substitution i get L = \frac{m}{2} (\dot{Q}^2 + \omega^2 Q^2)

then i make the Hamiltonian H = p\dot{Q} - L

and get H = \frac{m}{2}(\dot{Q}^2 - \omega^2 Q^2)



Then the question is, is the Hamiltonian constant?

Thanks for helping me out btw.

Can't you just plug in <br /> Q = q sin(\omega t)<br /> into your Hamiltonian H = \frac{m}{2}(\dot{Q}^2 - \omega^2 Q^2), and see if the time-dependence vanishes?
 
Back
Top