Somehow, a few days ago, my mind got stuck on the three-body problem. I wanted to develop a chaos source for Pure Data that would generate simply crazy curves. What could be more natural than developing a simulation for something that is completely unpredictable? The three-body problem is exactly what you need.
New in 0.3:
Fixed some bugs, added some more functions and updated the help file.
Bodies are only sent if their x/y is in the range -100 100.
The port to Organelle/ARM is still pending but will be done soon.
New in 0.2:
Seems to bo stable now. Values are now clipped at -100 and 100. I could not figure out to do it the soft way. This isn’t a problem mathematically, but in the visualization, gravitational effects appear in different places than they should. With scaling you can bring the values ​​into a usable range without clipping. However, with soft clipping, the problem became quite significant. But the visualization isn’t the goal, of course, but rather a PD extension for the Organelle. Perhaps I’ll implement soft clipping again.
This is especially noticeable in the new black hole with its enormous mass. It only works really well in the center. But it could also be a bug. I’ll have to look into that.
I’ve placed a bang all the way to the left to signal that a run is complete. This makes life a little easier with the somewhat difficult synchronization of values ​​in PD.
The visualization has been revised. It now looks quite nice. The black hole can be shown or hidden.
A small analysis tool has been added. With it, you can calculate a few more values.
The help file is a bit cleaner now. I’ve focused on the essential settings.
==============================
Next up is the build on the Organelle. And then we’ll see which patch will be my next one that uses it.
This is just a development stage that works sufficiently. I have the worst effects when bodies come closer together more or less under control. So, the speed of light can no longer be reached. So, no more singularity in the system. But there are still plenty of other things to work on until the calculations produce at least halfway reasonable values ​​for use in Pure Data. But I think I’m on the right track.
This isn’t currently a patch for the organelle, but the current development stage of the simulation for up to 10 bodies (or masses). I might make it available on GitHub. So far, it only runs reliably on Linux systems. Provided the appropriate build system is available, it could also run on Windows and Darwin. The Makefile is prepared, but untested.
In the “app” subdirectory, there is a server that receives the body state data from “threebp-help.pd.” If you then access http://localhost:8080, you can track the body movements.
npm and Node.js are required for this. The server is started with “npm -i” and “node server.js” in the “app” directory.
In the video, I simply attached oscillators to the X/Y positions of the bodies. But that’s a rather simple demonstration.
Once the values ​​are a bit more stable and usable, additional features such as distance triggers for bodies or any position in the system will be added. Angles, gravitational stress, energy, rotation detection, etc., will then generate value ranges with a wide variety of properties and possible uses.
So far, these values ​​are output:
Outlet 1: Body number, X-Pos, Y-Pos
Outlet 2: X/Y velocity of the body
Outlet 3: X/Y acceleration of the body
I’m curious to see where this leads. Stay tuned…