Right. Thanks--that explains everything. But it would be so cool to have exact reversibility. To (perhaps unnecessarily) repeat: Might it be possible to update the particles sequentially a la the (two skew) Minsky "circle" algorithm: newx -> x - floor(d y), newy -> y + floor(e newx) which is exactly reversible, no matter how batsh*t the floor function is. The penalty for this is (very remediable) non-circularity. Could we update the particles with sequential (and thus reversible) skews? If so, there are probably remedies for any visible imperfections in the forward simulation. --rwg On 2016-11-15 11:06, Mike Speciner wrote:
Bill, I'm assuming you created this by time-reversing an initial configuration. If so, .... The three balls that end up apparently motionless and linearly together at the lower left aren't really quite as motionless or linearly together as they appear, presumably due to tiny floating point "errors" that accumulate in both the reverse and the forward simulation. (You can examine the actual positions and velocities by mousing over the balls with the simulation paused.) In the forward simulation, there are probably no simultaneous collisions. In any case, only one collision (the earliest) is processed at a time, which might occur at a small fraction of the time step. Then all the positions and velocities are updated to the collision time post collision, and the process is repeated until all the collisions within the stepsize have been processed.
--ms
On 14-Nov-16 19:39, Bill Gosper wrote:
Simple experiment; negative result: I can't see a difference between
title:gas2 clearwalls clearballs time:0 speed:4 wall:{x:[[-256,-256],[-256,256]]} wall:{x:[[-256,256],[256,256]]} wall:{x:[[256,256],[256,-256]]} wall:{x:[[256,-256],[-256,-256]]} wall:{x:[[0,56],[-56,0]]}
ball:{x:[138.95544361180137,-53.80397594446178],v:[1.510335795838575,25.481978458903548],m:1,r:10,c:"gray"}
ball:{x:[-134.9335319061281,-186.86010684600106],v:[21.85076947267741,9.512509711816417],m:1,r:10,c:"gray"}
ball:{x:[54.22470051433805,245.51158342487696],v:[-24.566342384761167,-19.008502444414795],m:1,r:10,c:"gray"}
ball:{x:[-10.77118714505185,226.1293232034858],v:[-22.55619118918868,-2.3002862909202832],m:1,r:10,c:"gray"}
ball:{x:[-75.57273059907199,-225.01762417294833],v:[-1.2330104812166782,-0.14817511072452252],m:1,r:10,c:"gray"}
and the same text with the last five lines reversed. The continuation
from
time 400 should have one ball shuttling across the bottom for many periods. Do you presort the balls? Take pains to simulate parallel update? Either would foil my plan. --rwg One non-surprise: speed -2 is a poor slo-mo time-reversal of speed 4.
On Sun, Nov 13, 2016 at 10:01 PM, Bill Gosper <billgosper@gmail.com> wrote:
Maybe we can at least get Minsky-style reversibility by updating the particles in reverse order if time runs negative. --rwg I somehow missed the Load from file button! My file is small enough to fit in a url. Is there a way for it to override the default initial configuration?
Date: 2016-11-12 13:44 From: Mike Speciner <ms@alum.mit.edu> To: math-fun <math-fun@mailman.xmission.com> Reply-To: math-fun <math-fun@mailman.xmission.com>
If you SHOW AS TEXT, you can cut and paste to save in a file of your choosing (and edit it as you choose). You can load such a file with the "Load from file" function. (The LOAD and SAVE functions use cookies, with a nonstandard encoding to reduce their size.)
Good question about perfect computation with rationals. There are an awful lot of square roots in the calculations; I'm not sure the conditions under which they don't produce irrationals. I suspect one dimensional scenarios are more likely to be able to produce exact results. (It's been a long time since I looked at this code. I do remember deliberately not adding in gravity because that made reversibility harder. The PDP-6 version had gravity. And I vaguely remember having some code to make sure energy was [nearly] conserved, but I'm not sure it's in this new version.)
--ms
On 12-Nov-16 01:44, Bill Gosper wrote:
Date: 2016-11-05 09:51 From: Mike Speciner <ms@alum.mit.edu> https://ms0.github.io/gas.html This is a great toy! I delete everything except six identical balls (and maybe one wall), set one ball to bounce around for a while before disrupting the others, run it half a minute into the disruption, save it out, and show it time-reversed to some unsuspecting person. Or if I'm afraid they'll notice the negative time passage, I manually negate all the velocities before saving. (Is there a way to load one of those text files?)
Unfortunately, neither of these reversal stunts is perfect, due to accumulated numerical errors, which I assume you've worked hard to minimize.
So let's get particularly math-y and ask: Given rational positions and velocities, can we simulate one of these six-ball scenarios exactly and indefinitely, without runaway denominator buildup, nor irrational collision results? --rwg
math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun