This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I am trying to simulate a spring in a time-stepped manner. Mostly to sus out the correct order of operations, where to apply delta time, how to apply drag.
As such I have set up, with the new Desmos functions features, a time generator that randomly applies latency at each step and a velocity and y position generator. I have plugged in hookes law into the velocity update method.
Initially I set the y position to 1 and give it 0 velocity. There is not supposed to be gravity or anything in this simulation. Only the spring and eventually drag. It is suppose to oscillate around and eventually settle on 0.
I update velocity with V = -40 * y ^2 * sign(y) * dt each step.
This is the graph I get. The problem is every time I set up my constants the result is a simulation that grows in energy. Rather than settling on 0 it oscillates further and further away from 0. I am not sure why. Am I missing something about hookes law or how I am applying it?
I maybe wouldn't be surprised if it oscillated to the same point every time... but growing each time?? Thats a surprise.
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/desmos/comm...