title: Verlet algorithm implementation in Python
body: <p>I have problem with implementation of verlet algorithm in Python. I tried this code:</p>
  
  <pre><code>x[0] = 1
  v[0] = 0
  t[0] = 0
  a[0] = 1
  for i in range (0, 1000):
      x[i+1] = x[i] - v[i] * dt + (a[i] * (dt**2) * 0.5)
      v[i] = (x[i+1] - x[i-1]) * 0.5 * dt
      t[i+1] = t[i] + dt
  </code></pre>
  
  <p>But it is not working properly. What is wrong?
  I am looking for general code for Verlet algorithm.</p>