[HN Gopher] A canonical Hamiltonian formulation of the Navier-St...
       ___________________________________________________________________
        
       A canonical Hamiltonian formulation of the Navier-Stokes problem
        
       Author : Anon84
       Score  : 151 points
       Date   : 2024-04-07 00:46 UTC (22 hours ago)
        
 (HTM) web link (www.cambridge.org)
 (TXT) w3m dump (www.cambridge.org)
        
       | jackhalford wrote:
       | The Hamiltonian formulation of classical mechanics is such a
       | beautiful way of describing classical motion compared to the
       | Newtonian formulation. See Laundau & Lifschitz book 1! All the
       | Hamilton-Jacobi equations are derived from observing symmetries
       | in space time, even Newton's 3 principles are derived (F=ma an
       | the rest). All of this has the added benefit of transposing well
       | into quantum mechanics, where forces are anyway replaced with
       | hamiltonians.
       | 
       | For fluid mechanics I don't know if Hamiltonians are the right
       | formulation.
        
         | Horffupolde wrote:
         | That's a correct usage of the factorial.
        
         | fransje26 wrote:
         | Although not the same, I remember the first time I encountered
         | the description of dynamic systems using Lagrangian mechanics
         | and it was beautiful. It finally made sense.
         | 
         | Instead of doing what seemed like some mumbo-jumbo sarting from
         | a static system, that, eventually and through convoluted ways,
         | lead to the equations we were kind of looking for, here was a
         | clean and logical way to look at what was relevant to the
         | dynamics of the system, with an infaillible, straightforward,
         | mathematical way of getting the equations of motion.
         | 
         | I'm not that familiar with Hamiltonian formulations, but its
         | conservation properties could bring some important improvements
         | to the current way the Navier-Stokes equations are treated.
         | Conservation of linear and angular momentum, for a start, could
         | be nice..
         | 
         | Now, let's see if I understand anything from this paper..
        
           | om2 wrote:
           | I have tried to teach myself both Hamiltonian and Lagrangian
           | classical mechanics and there's one mental hurdle I have not
           | been able to get over. The problems are generally set up with
           | starting position and momentum known, and ending position and
           | momentum known, and then the math tells you the path taken
           | along the way. But what if the ending position and momentum
           | is unknown? How does one use these formulations of mechanics
           | to predict the future and not just postdict the past? Is this
           | just how beginner problems tend to be set up?
        
         | bdjsiqoocwk wrote:
         | Since you sound like you know what you're talking about, wanna
         | tell us what is the difference between the hamiltonian and
         | lagrangian formulations?
        
           | ajkjk wrote:
           | Not the person you were responding to, but: the Lagrangian
           | formulation describes physics in terms of Least Action (so
           | minimizing (or maximizing) S = [?] L dt) on a manifold in
           | (x,v) coordinates, and its equations of motion are like L_x -
           | d_t L_v = 0. The second term tends to be second-order in
           | time.
           | 
           | The Hamiltonian formulation performs a Legendre
           | transformation[1] on L giving H = v L_v - L, which is
           | essentially a convenient trick: it reparameterizes L in (q,p)
           | coordinates, where p = L_v, and writes S as [?] (pv - H) dt.
           | This changes the E.o.M. to (qdot, pdot) = (H_p, -H_q), which
           | is (a) first-order in time and therefore easier to deal with
           | and (b) geometrically elegant because it is a rotation in
           | (q,p) space, which is easy to think about.
           | 
           | At least those are the reasons everyone gives why it's
           | important. I think the real reason is that QM is formulated
           | in terms of H so you need to know it, and also that this
           | (q,p) thing makes statistical mechanics easier because it has
           | good geometric properties: it amounts to saying that time
           | evolution conserves area in (q,p) space, which means that you
           | can treat the evolution of many-particle systems as being in
           | a whole block of states at once, treated as a geometric
           | object that flows over time.
           | 
           | I've never been able to understand if there is something
           | "truly fundamental" about H compared to L, or if H is more of
           | a mathematical convenience for making the equations first-
           | order.
           | 
           | [1]: https://blog.jessriedel.com/2017/06/28/legendre-
           | transform/ is a good exposition, if still pretty tough to
           | understand. Legendre transforms are hard to grok.
        
             | adrian_b wrote:
             | In classical mechanics the Lagrangian and Hamiltonian
             | formulations are mostly equivalent (though, confusingly the
             | Lagrangian formulation is due to Hamilton, who has shown
             | that the Lagrange equations can be derived from a
             | variational principle, while the complete Hamiltonian
             | formulation is due to some later phycisists; for what has
             | become the Hamiltonian formulation, Hamilton has shown only
             | how to obtain the system of first order equations from the
             | system of second order equations, but that had already been
             | done before by Cauchy in 1831 in a journal that few were
             | reading, so it was ignored).
             | 
             | Still, in classical mechanics some consider the Hamiltonian
             | formulation to be more fundamental, because the first order
             | equations can be applicable to some problems that have
             | discontinuities incompatible with second-order equations,
             | though such problems are artificial (real systems are
             | continuous enough, strong discontinuities appear only
             | through approximations).
             | 
             | However this changes completely in relativistic mechanics,
             | where the Hamiltonian is not invariant, while the
             | Lagrangian is a relativistic invariant quantity.
             | 
             | This makes the Lagrangian formulation a far better choice
             | in relativistic mechanics and it is a strong argument to
             | consider the Lagrangian formulation as the fundamental one
             | and the Hamiltonian formulation as only an approximation
             | that can be used at small velocities or only as a
             | mathematical trick for numeric solutions.
             | 
             | When the Lagrangian formulation is used, after a coordinate
             | system is chosen, it is always possible to use the Legendre
             | transformation to obtain a Hamiltonian system of first
             | order equations. However, in the relativistic case the
             | system depends on the coordinate system. Therefore, if the
             | coordinate system is changed, the Hamiltonian equations
             | must be derived again from the invariant Lagrangian
             | formulation.
             | 
             | The reason why the Lagrangian is a relativistic invariant
             | is that this scalar value is the projection of the energy-
             | momentum 4-vector on the trajectory curve in space-time.
             | The Hamiltonian is just the temporal component of the
             | 4-vector, which is changed by any coordinate
             | transformation. Therefore L is more fundamental than H, in
             | the same sense that the magnitude of a vector is more
             | fundamental than any of the components that the vector
             | happens to have in some particular coordinate system.
             | 
             | The traditional formulation of the quantum mechanics using
             | H is a serious inconvenience for extending it to the
             | relativistic case. Coherent formulations of the
             | relativistic quantum mechanics must also use L instead of
             | H.
        
               | oddthink wrote:
               | Thank you! The Lagrangian as projection of energy-
               | momentum actually makes sense, unlike the "let's just
               | subtract potential from kinetic. No reason, it just
               | works" story. I'd been idly wondering that for a while
               | (and this is as someone with a physics degree, though in
               | astro, which is a good bit more applied).
        
               | adrian_b wrote:
               | Hamilton has introduced what he has called the "Principal
               | Function S", which is used in his variational principle
               | on which the Lagrangian formulation is based.
               | 
               | Nowadays this function is frequently called "Hamilton's
               | action", though this is not a good idea because it causes
               | confusions with what Hamilton, like all his predecessors,
               | called "action", which is the integral of the kinetic
               | energy.
               | 
               | The "Principal Function S", which is a scalar value, i.e.
               | a relativistic invariant quantity, is the line integral
               | of the Lagrangian over the trajectory in space-time, i.e.
               | it is the line integral of the energy-momentum 4-vector
               | over the trajectory in space-time.
               | 
               | Like any line integral of a vector, the line integral of
               | the energy-momentum 4-vector is equal to the line
               | integral over the trajectory of its projection on that
               | trajectory.
               | 
               | This is why the Lagrangian is the projection of the
               | energy-momentum 4-vector. Hamilton has found the correct
               | form of this line integral in relativistic theory, even
               | if that was about 3 quarters of century before the
               | concept of 4-vectors became understood.
               | 
               | The "Principal Function S", i.e. the integral of the
               | energy-momentum, can be considered as a more fundamental
               | quantity than the Lagrangian, which is its derivative
               | (the energy-momentum vector is its gradient). In quantum
               | mechanics the "Principal Function S" is the phase of the
               | wave function, so it is even more obvious that it must be
               | an invariant quantity.
        
               | ajkjk wrote:
               | Do you know of a good source on the history of this
               | stuff, such as the relationship with cauchy? Or is it
               | just something you pick up?
        
             | kurthr wrote:
             | It's worth mentioning that Feynman's dissertation was on a
             | Lagrangian formulation of quantum mechanics. However, just
             | because Feynman thought it was interesting doesn't mean
             | it's a good idea for the rest of us (although it's a
             | relatively short 69 pages and an interesting read).
             | 
             | http://files.untiredwithloving.org/thesis.pdf
             | 
             | The path integral method of QED does make the Lagrangian
             | for field theories easier.
             | 
             | https://en.wikipedia.org/wiki/Path_integral_formulation
        
             | lr1970 wrote:
             | > I've never been able to understand if there is something
             | "truly fundamental" about H compared to L, or if H is more
             | of a mathematical convenience for making the equations
             | first-order.
             | 
             | Actually, Hamiltonian formulation, being equivalent, offers
             | more room for finding solutions. Lagrangian formulation of
             | the Least Action principle allows you to search for a
             | solution employing arbitrary smooth re-parameterizations of
             | the configuration variables `q`. The Hamiltonian
             | formulation, on the other hand, allows you to re-
             | parametrize the entire phase space (q,p) and find solutions
             | that are much harder to get in Lagrangian formulation.
        
         | ajkjk wrote:
         | Is it not the case that F=ma and other Newtonian laws are
         | encoded in the Lagrangian, and therefore not derived from
         | symmetries? After all nature and her symmetries alone do not
         | tell us how her physics works; there has to be some rule for
         | time-evolution as well, and that's what's encoded in L (L's
         | form is essentially a list of pairings of variables and their
         | costs of evolution, which for classical mechanics is L = T - V
         | = [?] p*dv + [?] F*dx, which says "the cost of changing v is p
         | and the cost of changing x is F").
         | 
         | (QFT sort-of has an explanation for time evolution in terms of
         | symmetries alone, but it requires a lot more machinery. But
         | afaik classical mechanics does not.)
        
           | om2 wrote:
           | > the cost of changing v is p and the cost of changing x is F
           | 
           | I'm sure the equation is right and all but this seems
           | sideways in terms of an intuitive explanation - velocity
           | changes position, and force changes momentum. Force doesn't
           | directly change position (only indirectly via changing
           | momentum) and momentum doesn't change velocity, having
           | momentum is consistent with a constant velocity. It doesn't
           | even make much sense to me to think of integrals as being
           | about "costs of changing", would that not be a derivative?
        
         | techas wrote:
         | Please read "Story of your life" by Ted Chiang. A beautiful
         | story that involves a discussion of Newtonian and Hamiltonian
         | formulations. One of the best stories I have read.
        
       | tekla wrote:
       | Haha, great paper. I read the title and the abstract and went
       | WTF?!?
       | 
       | > Given the title of this paper, it is incumbent on the authors
       | to assure the reader that we do not claim to have done the
       | impossible
       | 
       | Awesome. Though I have no clue what the Hamiltonian formulation
       | is.
        
         | comment_ran wrote:
         | It descripts a system using the energy concept. The total
         | energy of the system, which is the sum of kinetic energy and
         | potential energy. Its formula often looks like H = T + V, where
         | T represents kinetic energy and V represents potential energy.
         | 
         | Both the quantum mechanics and molecular dynamics have shared a
         | similar concept.
         | 
         | In structural mechanics, we use the virtual method to calculate
         | the hyperstatic structure to determine displacements in a
         | structure, given forces acting on the structure. Another kind
         | of Hamiltonian.
        
           | tekla wrote:
           | I'm classically educated on fluids so asking me to deviate
           | from Newtonian mechanics for viscous fluids is ... difficult.
           | 
           | Nothing against this tho, I just don't have the foundation
           | for this.
        
             | comment_ran wrote:
             | I still remember in high school, we only need two or three
             | equations to solve a free-fall problem. In another book,
             | basically the same question, but someone uses Hamiltonian
             | framework to solve really complex PDEs and couple pages
             | with those crazy equations to basically solve the same
             | thing, and eventually got the same results.
             | 
             | I still remember that was mind-blowing. High school physics
             | is so simple, whereas the Hamilton is so complex. I later
             | on notice that Hamilton is kind of a more standard way to
             | solve the problem. Never mind, I'm not an expert on it, but
             | I'm just kind of amazed by the Hamiltonian mechanics.
        
               | jfengel wrote:
               | The Hamiltonian is a lot more flexible with respect to
               | frame. The Newtonian formulation works great for simple
               | cases but as it gets more complex it's harder and harder
               | to pick a reference frame that's easy to compute.
               | 
               | Effectively, by working with energy rather than force,
               | you can avoid working with vectors. That ends up being
               | simpler as the components add up.
        
             | spenczar5 wrote:
             | I am curious about what you mean by "classically educated."
             | In my undergrad physics education, computing Hamiltonians
             | was pretty much an entire semester of classical mechanics
             | in my junior year.
             | 
             | We didn't really touch fluids though. Does "classical" mean
             | something different there?
        
               | kyykky wrote:
               | I assume that the classical exposition to fluid mechanics
               | uses newtonian concepts, mainly forces.
        
       | abnry wrote:
       | I have no clue about this paper. Only comment is that this was
       | published April 1st.
        
       | mikewarot wrote:
       | Does this result mean that aerodynamic simulation can be made far
       | less compute intensive, like I think it does?
       | 
       | This could be as useful as Feynman diagrams are to physics
       | calculations.
        
         | 2four2 wrote:
         | Okay I gotta be honest, and maybe I'm a little ignorant, but
         | when did we start saying compute instead of computation? I feel
         | like I went away on vacation and missed out on an in-joke.
         | Should I be saying compute instead?
        
           | javajosh wrote:
           | 'Compute' connotes hardware, 'computation' does not.
        
             | 2four2 wrote:
             | Thank you! I always just assumed the difference was
             | verb/noun.
        
             | cvoss wrote:
             | Rather, 'compute' is a verb, 'computation' is a noun, and
             | 'computationally' is an adverb (which is the most
             | appropriate choice in the context of GGP's statement). All
             | of these words refer to the same concept and may involve
             | hardware computers (a more modern use of these words) or
             | people-as-computers (the older, but still valid, use of the
             | words).
        
               | 2four2 wrote:
               | Digging more into other internet discussions, a lot of
               | people disagree about the usage. Many believe it's fine
               | to use compute as a noun since it's a truncation of
               | compute resources or compute nodes. Seems like an
               | industry shibboleth like how data/stats people say "data"
               | as a countable plural.
        
               | ajross wrote:
               | "Compute" as used upthread is in fact a noun. That's the
               | point, it's a new word. And sort of a dumb one, but new
               | nonetheless.
        
               | hasmanean wrote:
               | I think Compute is a gerund (a noun derived from a verb,
               | like "swimming" as in the activity.)
        
           | gyrovagueGeist wrote:
           | It's been commonly used as a noun in the HPC / scientific
           | computing space for a long time (relevant to this thread)
           | typically talking about "compute bound" and "memory bound"
           | algorithms. It's spilled over everywhere now that number
           | crunching is hip for machine learning.
        
           | hansvm wrote:
           | People favor shorter words for common concepts. We've started
           | needing something equivalent to the 4-syllable "computation"
           | frequently lately, so we nouned the verb "compute."
           | 
           | In the short-term, I think both words are fine. If it
           | matters, use whichever one will best help you achieve your
           | goals (e.g., if you're talking to a person who frequently
           | uses n>>1 devices to perform computationally intensive
           | workloads, you'll probably sound very mildly out-of-place
           | nowadays if you don't choose "compute," which may or may not
           | be the image you want to portray of yourself).
           | 
           | Slightly longer term, I expect this will be one of those
           | cases where dictionaries and pedants try to settle the
           | matter, nobody complies, and we have a "gray" vs "grey"
           | scenario indefinitely. Beyond the next year or two I'm
           | hesitant to place bets on the multitude of possible outcomes.
           | 
           | Way off-topic, patterns of speech like that might be a fun
           | way to fingerprint the training data used for an LLM.
        
           | smallnamespace wrote:
           | Compute as a noun may be a newer usage, but a noun sharing
           | the same form as the verb is common in English, so it at
           | least conforms to the patterns of the language.
           | 
           | For example dispute/disputation or repute/reputation ("a
           | person of ill repute").
        
           | meindnoch wrote:
           | "compute" is used by the same people who call a collection of
           | things a "stack".
        
           | ajkjk wrote:
           | I think of "compute" as referring to the resources for
           | computations, rather than the computations themselves. For
           | instance "compute-intensive" for an algorithm means that it
           | is expensive in terms of computation resources, i.e. CPU
           | cycles, as opposed to say I/O or network usage or something.
           | Sometimes it refers to the actual physical hardware,
           | sometimes to the theoretical resource of CPU time.
        
           | semi-extrinsic wrote:
           | This exact topic came up in another thread a.few months ago,
           | and I did some digging:
           | 
           | I believe the term "compute node" was first used in the
           | context of the Intel ASCI Red supercomputer that was
           | installed at Sandia in 1997. This later led to the Cray XT3,
           | XT4, XT5 families of machines that used the same terminology.
           | 
           | But I believe the term was not in generic usage outside of
           | those specific supercomputers until around 2005-2010.
           | 
           | And it is more recently that the term has been extended
           | beyond referring to hardware.
        
           | SilasX wrote:
           | It looks like the general trend of truncating nouns down to
           | the verb they're based on instead of requiring the noun-ified
           | form. You may have seen these:
           | 
           | 1) an invitation to the party -> an invite to the party
           | 
           | 2) I like that quotation. -> I like that quote.
           | 
           | 3) I gave him a consultation. -> I gave him a consult.
           | 
           | You could even count:
           | 
           | 4) What's the request? -> What's the ask?
           | 
           | Also, broken English seen on receptacle in China:
           | 
           | 5) "The environment needs your conserve." (instead of
           | "conservation")
        
         | kyykky wrote:
         | What makes you think so? I quickly skimmed through and found
         | nothing of the sort.
         | 
         | Edit: My take home message was that there is an equivalent
         | higher order formulation which allows more structure and might
         | be theoretically interesting. Usually higher order formulations
         | are numerically more challenging.
        
         | somat wrote:
         | Do Feynman diagrams reduce computation? my understanding is
         | that Feynman diagrams are a clever simple way to document
         | particle interaction. That is, more for human consumption than
         | machine. My gut tells me it is the same as saying "we were able
         | to reduce the computational complexity of our simulation
         | because we had a good flowchart", by which I mean, It may help,
         | but the flowchart is not the code(yes, uml, I am looking at
         | you)
        
         | splittingTimes wrote:
         | I worked in that field doing numerical many-body simulations of
         | electron dynamics interacting with their environment in solid
         | state devices like quantum dots, graphene, photonic waveguides
         | & cavities , etc.
         | 
         | You would start from a Lagrangian formulation of the classical
         | interaction, let's say Light-Matter, that would yield for
         | example the Schrodinger and Maxwell equations. Following a
         | Legendre transformation (there a post on the HN front page the
         | other day on that) you end up with a so-called Hamilton
         | operator from which you can derive a (huge) set of coupled
         | differential equations which you then solve.
         | 
         | Here, if you wanted to increase temporal accuracy, it typically
         | leads simply to longer calculation times.
         | 
         | We also tried a different approach using Feynman's path
         | integrals and boy did that explode numerically. We optimized
         | our programs to the point where everything was reduced to work
         | on bits, but to no avail it was numerically unstable and the
         | memory consumption when through the roof the longer or more
         | accurate you wanted to make the simulation.
         | 
         | So, I would argue that NO, Feynman does not make it easier per
         | se.
         | 
         | However, other groups made it work somehow.
         | 
         | As a starting point you can check that paper and it's
         | references from the introduction section.
         | 
         | https://doi.org/10.1002/pssb.201000842
        
       | nextworddev wrote:
       | For a second I thought they solved it
        
       | neonate wrote:
       | https://www.linkedin.com/posts/johnwsanders_a-canonical-hami...
        
       | cherryteastain wrote:
       | So, the gist of the paper seems to be:
       | 
       | 1. Put all terms of the momentum and mass conservation equations
       | of Navier Stokes on the right hand side. These should be normally
       | identically 0.
       | 
       | 2. Define an error term ('residual') R for each equation, this is
       | basically the value of the RHS from step 1. The error term is 0
       | when pressure and velocities satisfy N-S.
       | 
       | 3. Define the Lagrangian as the sum of residuals squared
       | 
       | 4. Apply the Legendre transformation to the Lagrangian to get the
       | Hamiltonian and the conjugate momenta
        
       ___________________________________________________________________
       (page generated 2024-04-07 23:02 UTC)