[math-fun] Not particularly math, possibly fun, particularly particles
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
Bill, I thought a bit more about reversibility, and I think the only way to do that in general would be to modify the collision results so that they satisfied certain constraints (like having the rational values have some limit on the denominator sizes) and making sure that the collision calculation run backwards would return the previous values. I'm not sure this is actually possible, but if it is it would mean the simulation had some sort of law of conservation of information. Then, your idea of updating the particles in reverse order ought to work (but currently I think the collisions are processed strictly in time order, and I don't think the order matters for ties). I suppose it would be possible to allow a querystring to specify the starting configuration. But if you wanted to specify a local file in the querystring, I don't think that's possible due to browser security protections not letting it read local files without user intervention. Another possibility is to allow you to specify a title in the querystring and attempt to load that from a cookie previously saved by SAVE. Would you like any of these options? As currently implemented, the only way to override the default configuration is to make a copy of gas.html and edit the code where the makeWall and makeBall calls are; you could then save the file and run it with file:///, or put it on a server of your choosing and run it from there. --ms On 14-Nov-16 01:01, Bill Gosper 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
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
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
participants (2)
-
Bill Gosper -
Mike Speciner