From what I understand it's not just floating point errors, but due to the nature of approximating continues function as simple discrete steps. Linked wikipedia article has a graph demonstrating that with large steps the error accumulates way before floating point precision is a concern.
There are different numeric integration techniques with different tradeoffs. Stuff like Eulers method, Verlet, Runge-Kutte. In some of them overall energy tends to accumulate in others it gets lost both of which is wrong. Some of the more complex ones tend to behave a bit better, but then you get into the problem whether gains from each individual step being more complex outweighs what you would get from running more iterations of simpler/faster algorithm.
[1] - https://scrawl-v8.rikweb.org.uk/demo/particles-008.html
It's not only the rounding error, it's also quantisation of time and other minor errors coming from the mathematical model itself.
If the error is on the damping side, you get the real life effect of motion eventually stopping due to energy dissipation. If it's on the acceleration side you get a runaway simulation.
rikroots•4h ago
[1] - https://codepen.io/dissimulate/pen/eZxEBO
[2] - https://github.com/Dissimulate/Tearable-Cloth
wingerlang•3h ago
It's very simple to implement a basic setup like this, and I agree that the results are super cool.
ribcage•2h ago