Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Symplectic algorithm

  1. Feb 1, 2006 #1

    I have this hamiltonian
    [tex] K = \frac{1}{2}(P_1^2 + P_2^2) + P_1 Q_2 - P_2 Q_1 - (\frac{1-\mu}{R_1}+\frac{\mu}{R_2})[/tex]
    (see this link if there is any latex problem)

    with non separable variables.

    I am looking for a symplectic algorithm (runge kutta would be good) to solve the correspondant first order equations, but I can't find it on the internet.

    moreover it seems difficult and I don't understand enough what is a symplectic algorithm to code do it by myself..

    thx a lot.
    Last edited: Feb 1, 2006
  2. jcsd
  3. Feb 2, 2006 #2


    User Avatar
    Science Advisor
    Homework Helper

    Well, for starters are these those:

    [tex]\frac{dP_1}{dt}=\frac{\partial K}{\partial P_2},\quad \frac{dP_2}{dt}=-\frac{\partial K}{\partial P_1}[/tex]

    [tex]\frac{dQ_1}{dt}=\frac{\partial K}{\partial Q_2},\quad \frac{dQ_2}{dt}=-\frac{\partial K}{\partial Q_1}[/tex]

    [tex]\frac{dR_1}{dt}=\frac{\partial K}{\partial R_2},\quad \frac{dR_2}{dt}=-\frac{\partial K}{\partial R_1}[/tex]

    What then are the initial conditions?
  4. Feb 2, 2006 #3


    User Avatar
    Science Advisor
    Homework Helper

    Know what, I'm just gonna' run with this. Someone in the group just recently said, "you don't do mathematics by just staring at the problem and hope it comes to you".

    Anyway, Mathematica has a method called "SymplecticPartitionedRungeKutta". I shall wish to try this method once I figure out how symplectic methods differ from just regular numerical methods as I advocate learning the technique (in general) before using it in some math package. Perhaps I should just start with a pendulum first. Someone else said, "sometimes you have to take two steps backwards in order to move forwards". Might take a while.:smile:
  5. Feb 3, 2006 #4


    User Avatar
    Science Advisor
    Homework Helper

    For the record my equations posted above are totally incorrect and stems from my lack of familiarity with Hamilitoian sytems in general. But that's ok cus' I ain't staring and I'm not standing still. So it's 3:00a and I need to get up in a few hours to go to work. Well, that would mean I'm already sleeping but I'm fiddling with this instead. Whatever. Anyway I've learned that the Hamiltonian is conserved in Hamiltonian systems and that is the origin of the problem to seek symplectic methods in their numerical solution: most numerical methods do not preserve the constancy of the hamiltonian. Methods which do are called symplectic. Anyway, I have some references to work with and will pick it up later. Think I'll try and get in an hour or 2 of sleep. :zzz:
  6. Feb 9, 2006 #5


    User Avatar
    Science Advisor
    Homework Helper

    Some time ago I worked on what I considered a very beautiful problem (well ugly if you're a . . . nevermind). It's called an integral invariant of Poincare'. At the time, I didn't understand the connection to Hamiltonian systems. If you allow a set of initial points to evolve according to a Hamiltonian flow (run all the Hamiltonian differential equations for some time on a set of initial points and then compare the initial set of points to the set of final points), then a certain "measure" of the points is preserved in the flow. This is compactly expressed by the following integral invariant:

    [tex]\sum_{i=n}\oint_{\omega_i} p_idq_i=C[/tex]

    That is, the sum of areas projected onto the set of [itex](p_i,q_i)[/itex] planes is constant. This is shown graphically in the attached plot. I wish to verify this with a real set of Hamiltonian equations but I digress.

    Well, symplectic numerical methods are designed to preserve this measure. Consider first the undamped pendulum:



    The Hamiltonian function is:

    [tex]H(q,p)=1/2 p^2-Cos(q)[/tex]

    The standard (non-symplectic) Euler method for this system would be:



    A phase portrait (q vs. p) for 100 seconds is shown in the second plot. It's dissapating and not reflective of the actual dynamics of an undamped pendulum. A plot of the hamiltonian function would reveal a curve with a non-constant slope.

    We can slightly modify this method and convert it to a symplectic form as follows:



    The phase-portrait of this numerical simulation for 100 seconds is shown in the 3rd plot and reflects the actual dynamics of an undamped pendulum (back and forth and never loosing energy, that is the energy remains constant and reflects the invariant measure of Hamiltonian systems. A plot of the hamiltonian function for this simulation would be a straight line with zero slope. (can we get two more spaces for plots?)

    Attached Files:

    Last edited: Feb 9, 2006
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook