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

Code for verlet frog leap method.

  1. Jun 30, 2007 #1
    im searching for a C code for verlet leap method, i.e a one the advances the system of particles with accleration,velocities,displacements.

    anyone knows where may i find such a code?

    thanks in advance.
  2. jcsd
  3. Jul 3, 2007 #2
    too lazy to code yourself?
  4. Jul 3, 2007 #3


    User Avatar

    Staff: Mentor

    Now, now, take it easy. I'd love to help, but I have no idea of what a verlet leap method is. Anyone? :blushing:
  5. Jul 3, 2007 #4
    its known also plainly as the leapfrog method which gives more hits for a search than verlet.

    Basically you have some timestep dt...each halfstep you update v and each fullstep you update x. (you might also beable to update v each fullstep).

    t=0 => initial cfg
    t+0.5dt=> update v
    t+1.0dt=> update x
    t+1.5dt=> update v
  6. Jul 3, 2007 #5
    Useful link, with both the pseudocode and additional info:


    [edit]: More general versions ('higher order leapfrog') are also available. fourth-, sixth- and eighth-order leapfrog methods are available online, all of which are (naturally) symplectic. Do a search for 'Yoshida integrator', that should turn up some useful results.
    Last edited: Jul 3, 2007
  7. Jul 5, 2007 #6
    i wish that were the case.
  8. Jul 5, 2007 #7

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    Is it not in Numerical Recipies?????? www.nr.com
  9. Jul 7, 2007 #8
    didn't find anything there about leap frog method.
  10. Jul 7, 2007 #9

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    Try looking at the user supplied codes for Matlab and then translate the code into C if someone has done it.
  11. Jul 7, 2007 #10
    The staggered leapfrog method is described in Numerical Recipes in C in chapter 19 (Partial Differential Equations) section 1 (Flux-Conservative Initial Value Problems) on the bottom half of page 842: http://www.nrbook.com/a/bookcpdf/c19-1.pdf
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Code for verlet frog leap method.
  1. Code Blocks (Replies: 2)

  2. The Source Code! (Replies: 15)