Why does the Hamiltonian represent something different after plugging in the solution?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












so I am beginning to learn Hamiltonian mechanics. We have learned that the Hamiltonian is a function of q, p, and t. Once we have a Hamiltonian, we can use the Hamiltonian equations to derive the equations of motion. Say we have the Hamiltonian of a particle in a gravitational field:




$H = p^2/2m + mgy$




I can solve this and it will give me, using Hamiltons equations:




$dotp = -mg$



$doty = p/m$




If I solve this out, I get that (up to a constant)




$y = -gt^2/2$




Now, lets say that someone arbitrarily gives me the Hamiltonian




$H = p^2/2m - m g^2 t^2 /2$




If I use Hamiltons equations on this Hamiltonian, my equations are totally different (because there is no y dependence, we have $dotp = 0$). How can I change Hamilton's equations to give me back the same equations of motion? All I have done in the second case is plugged in a solution for y(t), why does it mess everything up?



Going a bit further, if I have a Hamiltonian with some explicit t dependence, how do I know whether I need to write that time dependence in terms of $q$ or $p$ or whether I can leave it as is? Because in the second Hamiltonian above, if I recognized that the second term could be written as $mgy$, then I could solve it with Hamiltons equations normally.



My professor said that the second Hamiltonian is totally different from the first one, and I don't really understand how they are, it seems to me that they should describe the same motion.










share|cite|improve this question



























    up vote
    2
    down vote

    favorite












    so I am beginning to learn Hamiltonian mechanics. We have learned that the Hamiltonian is a function of q, p, and t. Once we have a Hamiltonian, we can use the Hamiltonian equations to derive the equations of motion. Say we have the Hamiltonian of a particle in a gravitational field:




    $H = p^2/2m + mgy$




    I can solve this and it will give me, using Hamiltons equations:




    $dotp = -mg$



    $doty = p/m$




    If I solve this out, I get that (up to a constant)




    $y = -gt^2/2$




    Now, lets say that someone arbitrarily gives me the Hamiltonian




    $H = p^2/2m - m g^2 t^2 /2$




    If I use Hamiltons equations on this Hamiltonian, my equations are totally different (because there is no y dependence, we have $dotp = 0$). How can I change Hamilton's equations to give me back the same equations of motion? All I have done in the second case is plugged in a solution for y(t), why does it mess everything up?



    Going a bit further, if I have a Hamiltonian with some explicit t dependence, how do I know whether I need to write that time dependence in terms of $q$ or $p$ or whether I can leave it as is? Because in the second Hamiltonian above, if I recognized that the second term could be written as $mgy$, then I could solve it with Hamiltons equations normally.



    My professor said that the second Hamiltonian is totally different from the first one, and I don't really understand how they are, it seems to me that they should describe the same motion.










    share|cite|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      so I am beginning to learn Hamiltonian mechanics. We have learned that the Hamiltonian is a function of q, p, and t. Once we have a Hamiltonian, we can use the Hamiltonian equations to derive the equations of motion. Say we have the Hamiltonian of a particle in a gravitational field:




      $H = p^2/2m + mgy$




      I can solve this and it will give me, using Hamiltons equations:




      $dotp = -mg$



      $doty = p/m$




      If I solve this out, I get that (up to a constant)




      $y = -gt^2/2$




      Now, lets say that someone arbitrarily gives me the Hamiltonian




      $H = p^2/2m - m g^2 t^2 /2$




      If I use Hamiltons equations on this Hamiltonian, my equations are totally different (because there is no y dependence, we have $dotp = 0$). How can I change Hamilton's equations to give me back the same equations of motion? All I have done in the second case is plugged in a solution for y(t), why does it mess everything up?



      Going a bit further, if I have a Hamiltonian with some explicit t dependence, how do I know whether I need to write that time dependence in terms of $q$ or $p$ or whether I can leave it as is? Because in the second Hamiltonian above, if I recognized that the second term could be written as $mgy$, then I could solve it with Hamiltons equations normally.



      My professor said that the second Hamiltonian is totally different from the first one, and I don't really understand how they are, it seems to me that they should describe the same motion.










      share|cite|improve this question















      so I am beginning to learn Hamiltonian mechanics. We have learned that the Hamiltonian is a function of q, p, and t. Once we have a Hamiltonian, we can use the Hamiltonian equations to derive the equations of motion. Say we have the Hamiltonian of a particle in a gravitational field:




      $H = p^2/2m + mgy$




      I can solve this and it will give me, using Hamiltons equations:




      $dotp = -mg$



      $doty = p/m$




      If I solve this out, I get that (up to a constant)




      $y = -gt^2/2$




      Now, lets say that someone arbitrarily gives me the Hamiltonian




      $H = p^2/2m - m g^2 t^2 /2$




      If I use Hamiltons equations on this Hamiltonian, my equations are totally different (because there is no y dependence, we have $dotp = 0$). How can I change Hamilton's equations to give me back the same equations of motion? All I have done in the second case is plugged in a solution for y(t), why does it mess everything up?



      Going a bit further, if I have a Hamiltonian with some explicit t dependence, how do I know whether I need to write that time dependence in terms of $q$ or $p$ or whether I can leave it as is? Because in the second Hamiltonian above, if I recognized that the second term could be written as $mgy$, then I could solve it with Hamiltons equations normally.



      My professor said that the second Hamiltonian is totally different from the first one, and I don't really understand how they are, it seems to me that they should describe the same motion.







      lagrangian-formalism hamiltonian-formalism hamiltonian






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited 4 hours ago









      knzhou

      35.7k8100173




      35.7k8100173










      asked 4 hours ago









      Zach

      112




      112




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote













          You might think that nothing should change if you plug $x(t)$ and $p(t)$ back into the Hamiltonian, because the Hamiltonian is a number, equal to the total energy.



          That's not the right way of thinking about it. You should think of the Hamiltonian as a function $H(x, p)$ whose structure tells you how $x$ and $p$ change in time. For each solution $(x(t), p(t))$ of these equations, the number $H(x(t), p(t))$ is independent of time, and is equal to the energy.



          To take it a bit further, for any Hamiltonian without explicit time dependence, the energy is conserved. So if you really allowed yourself to plug in solutions, you could replace every single such Hamiltonian with a constant. A single constant (like "$3 textJoules$") clearly isn't enough to say how a physical system behaves.



          For Hamiltonians with explicit time dependence, we have a function $H(x, p, t)$, which give you Hamilton's equations as usual. This time dependence has nothing to do with the time dependence in a particular solution, $H(x(t), p(t), t)$, they mean completely different things.






          share|cite|improve this answer



























            up vote
            -1
            down vote













            The Hamiltonian $H$ must (originally$^[1]$) be function of $p$ and $y$ (with a possible additional explicit time dependence).



            Originally, $H_1 = H_1(p,y)$. To arrive at your second Hamiltonian $H_2 (p,t)$, you plugged in the equation of motion (eom) for $y = y(t)$ into $H_1$. Given that you plugged in the eom, you $already$ knew the dynamics of the system, so you can always make a switch $t rightarrow y$ in $H_2(p,t)$. In fact, you $must$ make the switch from $t rightarrow y$ in order to return to the original Hamiltonian $H_1$ (which provided you the eom for $y$ in the first place). Then $H_1 = H_1 (p,y)$, and things fall into place.



            Not making the switch $t rightarrow y$ can only be justified if you did not use the eom (derived from $H_1$). In that case, you get a Hamiltonian which is different from $H_1$ and $H_2$, say, $H_3(p,t)$. Now this $H_3 (p,t)$ is not related to $H_1$ (or $H_2$) because the thing that connects $H_3$ and $H_1$ is absent: eom. $H_3$ has explicit time dependence. This is what your professor means to say:



            When eom are used: $H_1(p,y) = H_3(p,t)$.



            When eom are not used: $H_1(p,y) neq H_3(p,t)$.




            $^[1]$ that is, when eom are not used






            share|cite|improve this answer




















              Your Answer




              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("mathjaxEditing", function ()
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
              );
              );
              , "mathjax-editing");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "151"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fphysics.stackexchange.com%2fquestions%2f431212%2fwhy-does-the-hamiltonian-represent-something-different-after-plugging-in-the-sol%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote













              You might think that nothing should change if you plug $x(t)$ and $p(t)$ back into the Hamiltonian, because the Hamiltonian is a number, equal to the total energy.



              That's not the right way of thinking about it. You should think of the Hamiltonian as a function $H(x, p)$ whose structure tells you how $x$ and $p$ change in time. For each solution $(x(t), p(t))$ of these equations, the number $H(x(t), p(t))$ is independent of time, and is equal to the energy.



              To take it a bit further, for any Hamiltonian without explicit time dependence, the energy is conserved. So if you really allowed yourself to plug in solutions, you could replace every single such Hamiltonian with a constant. A single constant (like "$3 textJoules$") clearly isn't enough to say how a physical system behaves.



              For Hamiltonians with explicit time dependence, we have a function $H(x, p, t)$, which give you Hamilton's equations as usual. This time dependence has nothing to do with the time dependence in a particular solution, $H(x(t), p(t), t)$, they mean completely different things.






              share|cite|improve this answer
























                up vote
                4
                down vote













                You might think that nothing should change if you plug $x(t)$ and $p(t)$ back into the Hamiltonian, because the Hamiltonian is a number, equal to the total energy.



                That's not the right way of thinking about it. You should think of the Hamiltonian as a function $H(x, p)$ whose structure tells you how $x$ and $p$ change in time. For each solution $(x(t), p(t))$ of these equations, the number $H(x(t), p(t))$ is independent of time, and is equal to the energy.



                To take it a bit further, for any Hamiltonian without explicit time dependence, the energy is conserved. So if you really allowed yourself to plug in solutions, you could replace every single such Hamiltonian with a constant. A single constant (like "$3 textJoules$") clearly isn't enough to say how a physical system behaves.



                For Hamiltonians with explicit time dependence, we have a function $H(x, p, t)$, which give you Hamilton's equations as usual. This time dependence has nothing to do with the time dependence in a particular solution, $H(x(t), p(t), t)$, they mean completely different things.






                share|cite|improve this answer






















                  up vote
                  4
                  down vote










                  up vote
                  4
                  down vote









                  You might think that nothing should change if you plug $x(t)$ and $p(t)$ back into the Hamiltonian, because the Hamiltonian is a number, equal to the total energy.



                  That's not the right way of thinking about it. You should think of the Hamiltonian as a function $H(x, p)$ whose structure tells you how $x$ and $p$ change in time. For each solution $(x(t), p(t))$ of these equations, the number $H(x(t), p(t))$ is independent of time, and is equal to the energy.



                  To take it a bit further, for any Hamiltonian without explicit time dependence, the energy is conserved. So if you really allowed yourself to plug in solutions, you could replace every single such Hamiltonian with a constant. A single constant (like "$3 textJoules$") clearly isn't enough to say how a physical system behaves.



                  For Hamiltonians with explicit time dependence, we have a function $H(x, p, t)$, which give you Hamilton's equations as usual. This time dependence has nothing to do with the time dependence in a particular solution, $H(x(t), p(t), t)$, they mean completely different things.






                  share|cite|improve this answer












                  You might think that nothing should change if you plug $x(t)$ and $p(t)$ back into the Hamiltonian, because the Hamiltonian is a number, equal to the total energy.



                  That's not the right way of thinking about it. You should think of the Hamiltonian as a function $H(x, p)$ whose structure tells you how $x$ and $p$ change in time. For each solution $(x(t), p(t))$ of these equations, the number $H(x(t), p(t))$ is independent of time, and is equal to the energy.



                  To take it a bit further, for any Hamiltonian without explicit time dependence, the energy is conserved. So if you really allowed yourself to plug in solutions, you could replace every single such Hamiltonian with a constant. A single constant (like "$3 textJoules$") clearly isn't enough to say how a physical system behaves.



                  For Hamiltonians with explicit time dependence, we have a function $H(x, p, t)$, which give you Hamilton's equations as usual. This time dependence has nothing to do with the time dependence in a particular solution, $H(x(t), p(t), t)$, they mean completely different things.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered 4 hours ago









                  knzhou

                  35.7k8100173




                  35.7k8100173




















                      up vote
                      -1
                      down vote













                      The Hamiltonian $H$ must (originally$^[1]$) be function of $p$ and $y$ (with a possible additional explicit time dependence).



                      Originally, $H_1 = H_1(p,y)$. To arrive at your second Hamiltonian $H_2 (p,t)$, you plugged in the equation of motion (eom) for $y = y(t)$ into $H_1$. Given that you plugged in the eom, you $already$ knew the dynamics of the system, so you can always make a switch $t rightarrow y$ in $H_2(p,t)$. In fact, you $must$ make the switch from $t rightarrow y$ in order to return to the original Hamiltonian $H_1$ (which provided you the eom for $y$ in the first place). Then $H_1 = H_1 (p,y)$, and things fall into place.



                      Not making the switch $t rightarrow y$ can only be justified if you did not use the eom (derived from $H_1$). In that case, you get a Hamiltonian which is different from $H_1$ and $H_2$, say, $H_3(p,t)$. Now this $H_3 (p,t)$ is not related to $H_1$ (or $H_2$) because the thing that connects $H_3$ and $H_1$ is absent: eom. $H_3$ has explicit time dependence. This is what your professor means to say:



                      When eom are used: $H_1(p,y) = H_3(p,t)$.



                      When eom are not used: $H_1(p,y) neq H_3(p,t)$.




                      $^[1]$ that is, when eom are not used






                      share|cite|improve this answer
























                        up vote
                        -1
                        down vote













                        The Hamiltonian $H$ must (originally$^[1]$) be function of $p$ and $y$ (with a possible additional explicit time dependence).



                        Originally, $H_1 = H_1(p,y)$. To arrive at your second Hamiltonian $H_2 (p,t)$, you plugged in the equation of motion (eom) for $y = y(t)$ into $H_1$. Given that you plugged in the eom, you $already$ knew the dynamics of the system, so you can always make a switch $t rightarrow y$ in $H_2(p,t)$. In fact, you $must$ make the switch from $t rightarrow y$ in order to return to the original Hamiltonian $H_1$ (which provided you the eom for $y$ in the first place). Then $H_1 = H_1 (p,y)$, and things fall into place.



                        Not making the switch $t rightarrow y$ can only be justified if you did not use the eom (derived from $H_1$). In that case, you get a Hamiltonian which is different from $H_1$ and $H_2$, say, $H_3(p,t)$. Now this $H_3 (p,t)$ is not related to $H_1$ (or $H_2$) because the thing that connects $H_3$ and $H_1$ is absent: eom. $H_3$ has explicit time dependence. This is what your professor means to say:



                        When eom are used: $H_1(p,y) = H_3(p,t)$.



                        When eom are not used: $H_1(p,y) neq H_3(p,t)$.




                        $^[1]$ that is, when eom are not used






                        share|cite|improve this answer






















                          up vote
                          -1
                          down vote










                          up vote
                          -1
                          down vote









                          The Hamiltonian $H$ must (originally$^[1]$) be function of $p$ and $y$ (with a possible additional explicit time dependence).



                          Originally, $H_1 = H_1(p,y)$. To arrive at your second Hamiltonian $H_2 (p,t)$, you plugged in the equation of motion (eom) for $y = y(t)$ into $H_1$. Given that you plugged in the eom, you $already$ knew the dynamics of the system, so you can always make a switch $t rightarrow y$ in $H_2(p,t)$. In fact, you $must$ make the switch from $t rightarrow y$ in order to return to the original Hamiltonian $H_1$ (which provided you the eom for $y$ in the first place). Then $H_1 = H_1 (p,y)$, and things fall into place.



                          Not making the switch $t rightarrow y$ can only be justified if you did not use the eom (derived from $H_1$). In that case, you get a Hamiltonian which is different from $H_1$ and $H_2$, say, $H_3(p,t)$. Now this $H_3 (p,t)$ is not related to $H_1$ (or $H_2$) because the thing that connects $H_3$ and $H_1$ is absent: eom. $H_3$ has explicit time dependence. This is what your professor means to say:



                          When eom are used: $H_1(p,y) = H_3(p,t)$.



                          When eom are not used: $H_1(p,y) neq H_3(p,t)$.




                          $^[1]$ that is, when eom are not used






                          share|cite|improve this answer












                          The Hamiltonian $H$ must (originally$^[1]$) be function of $p$ and $y$ (with a possible additional explicit time dependence).



                          Originally, $H_1 = H_1(p,y)$. To arrive at your second Hamiltonian $H_2 (p,t)$, you plugged in the equation of motion (eom) for $y = y(t)$ into $H_1$. Given that you plugged in the eom, you $already$ knew the dynamics of the system, so you can always make a switch $t rightarrow y$ in $H_2(p,t)$. In fact, you $must$ make the switch from $t rightarrow y$ in order to return to the original Hamiltonian $H_1$ (which provided you the eom for $y$ in the first place). Then $H_1 = H_1 (p,y)$, and things fall into place.



                          Not making the switch $t rightarrow y$ can only be justified if you did not use the eom (derived from $H_1$). In that case, you get a Hamiltonian which is different from $H_1$ and $H_2$, say, $H_3(p,t)$. Now this $H_3 (p,t)$ is not related to $H_1$ (or $H_2$) because the thing that connects $H_3$ and $H_1$ is absent: eom. $H_3$ has explicit time dependence. This is what your professor means to say:



                          When eom are used: $H_1(p,y) = H_3(p,t)$.



                          When eom are not used: $H_1(p,y) neq H_3(p,t)$.




                          $^[1]$ that is, when eom are not used







                          share|cite|improve this answer












                          share|cite|improve this answer



                          share|cite|improve this answer










                          answered 3 hours ago









                          Avantgarde

                          8071312




                          8071312



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fphysics.stackexchange.com%2fquestions%2f431212%2fwhy-does-the-hamiltonian-represent-something-different-after-plugging-in-the-sol%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              What does second last employer means? [closed]

                              One-line joke