Closed jrleeman closed 9 years ago
Could try to really tighten tolerances and shrink time step and see if the problems lessen or disappear.
Ok. Looks like the spring displacement is what causes this phenomena, but my solution and Chris' both exhibit some time dependance. Small time steps often leads to over estimation, large ones to under. Instantaneous velocities should be correct, but we multiply them by time to get displacement in the end. Not sure if that should be handled as a warning or if we can cleverly fix it. Example: https://gist.github.com/jrleeman/64ca917e1876c4bc3801
Looks like you're integrating yourself using cumsum
. At a minimum, IMO you should use the trapezoidal method. You can get a cumulative integral version from scipy.integrate.cumtrapz
. That might help with some integration error. If that's not enough, you could look at some of the "better" integration methods in there.
This is also an issue with Marone's code, so I'm not sure if it is numerical or something more fundamental with the modeling. My gut says that we are compounding error for coarse steps, but I have not investigate it.