Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Term in Verlet Integration Page #994

Closed
harshaxnim opened this issue Mar 17, 2022 · 4 comments · Fixed by #998
Closed

Error Term in Verlet Integration Page #994

harshaxnim opened this issue Mar 17, 2022 · 4 comments · Fixed by #998
Labels
Discussion This is open for a discussion.

Comments

@harshaxnim
Copy link

Hi team,

This is regarding the Verlet Integration page that's here: https://www.algorithm-archive.org/contents/verlet_integration/verlet_integration.html

Similar to how Equation 4 is sum of Eq. 2 and 3, we can see that Eq. 5 is a difference of 2 and 3. When we do that, the error term turns out to be O(del. t^3) and not O(del. t^2) as stated in the page. Did I get something wrong? Or should that page be corrected? Happy to provide more information if this post is not clear.

Best,
Harsha

@harshaxnim harshaxnim added the Problem This is a problem in the archive or an implementation. label Mar 17, 2022
@Amaras
Copy link
Member

Amaras commented Mar 17, 2022

Right, I was confused as well when reading your issue, and I would have agreed with you.
However, I did the working out, and this is why it's an O(dt^2).

As you noticed, Equation 5 is the difference of equations 2 and 3. As such, the jerk term does not cancel out, because of their different signs.
Thus (using dt instead of delta t): x(t + dt) - x(t-dt) = 2 v(t) dt + 1/3 b(t) dt^3 + O(dt^4).
Solving for v(t), we get: v(t) = [x(t + dt) - x(t - dt)] / (2 dt) - 1/6 b(t) dt^2 + O(dt^3).
However, since we don't use the jerk in the computation, it is lumped in a O(dt^3) at the start.
As such, we have a O(dt^3) in the difference step, and thus only a O(dt^2) term in the velocity.

Hope this helped!

@Amaras Amaras added Discussion This is open for a discussion. and removed Problem This is a problem in the archive or an implementation. labels Mar 17, 2022
@leios
Copy link
Member

leios commented Mar 18, 2022

I think this should be explicitly mentioned. I'll do that today.

@harshaxnim
Copy link
Author

@Amaras Ah, yes. It's a mistake on my part! That makes perfect sense, thank you!

@harshaxnim
Copy link
Author

@leios that sounds great. Maybe I'll leave this open for you to track and close when you're done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion This is open for a discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants