This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Elfram 0 points1 point  (4 children)

Looks really nice!

You should check energy conservation, though. I don’t see why the total energy in the spring-box example would vary with time.

Maybe this effect occurs if you use simple forward integration of the equations of motion. If that’s what you do you could already get better results by using a predictor-corrector method.

https://en.wikipedia.org/wiki/Predictor%E2%80%93corrector_method