Skip to content

Instantly share code, notes, and snippets.

@Aracturat
Created June 6, 2015 17:52
Show Gist options
  • Save Aracturat/0c33ce2642ba68136f19 to your computer and use it in GitHub Desktop.
Save Aracturat/0c33ce2642ba68136f19 to your computer and use it in GitHub Desktop.
loop
For[i = 1, i <= pointNumber - 1, i++,
x[[i + 1]] = x[[i]] + v[[i]] * dt + 1 / 8 * (5 * a[[i]] - a[[i - 1]]) * dt^2;
a[[i + 1]] = -dU[x[[i + 1]]] / m / 836700;
v[[i + 1]] = v[[i]] + 1 / 8 * (3 * a[[i + 1]] + 6 * a[[i]] - a[[i - 1]]) * dt;
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment