Code for verlet frog leap method.

  • Thread starter Thread starter MathematicalPhysicist
  • Start date Start date
  • Tags Tags
    Code Method
Click For Summary

Discussion Overview

The discussion revolves around finding C code for the Verlet leapfrog method, which is used to advance a system of particles by updating their acceleration, velocities, and displacements over time. The conversation includes inquiries about resources, coding assistance, and references to related methods.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks C code for the Verlet leapfrog method, expressing a desire for assistance.
  • Another participant questions the initial poster's motivation, suggesting a lack of effort in coding.
  • A participant admits unfamiliarity with the Verlet leapfrog method and asks for clarification.
  • It is noted that the method is also known as the leapfrog method, which may yield better search results.
  • A description of the leapfrog method is provided, outlining the time-stepping process for updating velocities and positions.
  • A link is shared that includes pseudocode and additional information about the leapfrog method and its higher-order variants.
  • One participant suggests checking Numerical Recipes for information on the method.
  • Another participant reports not finding relevant information in Numerical Recipes regarding the leapfrog method.
  • A suggestion is made to look for user-supplied Matlab codes and translate them into C.
  • A specific reference to the staggered leapfrog method in Numerical Recipes is provided, including a link to the relevant section.

Areas of Agreement / Disagreement

Participants express varying levels of knowledge about the Verlet leapfrog method, with some agreeing on its alternative name and others disagreeing on the availability of resources in Numerical Recipes. The discussion remains unresolved regarding the specific C code sought.

Contextual Notes

Some participants express uncertainty about the method's details and its implementation in C, indicating a potential gap in knowledge or resources.

MathematicalPhysicist
Science Advisor
Gold Member
Messages
4,662
Reaction score
372
im searching for a C code for verlet leap method, i.e a one the advances the system of particles with acceleration,velocities,displacements.

anyone knows where may i find such a code?

thanks in advance.
 
Technology news on Phys.org
too lazy to code yourself?
 
neurocomp2003 said:
too lazy to code yourself?

Now, now, take it easy. I'd love to help, but I have no idea of what a verlet leap method is. Anyone? :blushing:
 
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
etc.
 
Useful link, with both the pseudocode and additional info:

http://artcompsci.org/kali/vol/two_body_problem_2/ch01.html

[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 by a moderator:
neurocomp2003 said:
too lazy to code yourself?

i wish that were the case.
 
didn't find anything there about leap frog method.
 
Try looking at the user supplied codes for Matlab and then translate the code into C if someone has done it.
 
  • #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
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K