Most active commenters
  • shashanktomar(5)
  • (3)

Show HN: Strange Attractors

(blog.shashanktomar.com)
635 points shashanktomar | 68 comments | | HN request time: 1.746s | source | bottom

I went down the rabbit hole on a side project and ended up building this: Strange Attractors(https://blog.shashanktomar.com/posts/strange-attractors). It’s built with three.js.

Working on it reminded me of the little "maths for fun" exercises I used to do while learning programming in early days. Just trying things out, getting fascinated and geeky, and being surprised by the results. I spent way too much time on this, but it was extreme fun.

My favorite part: someone pointed me to the Simone Attractor on Threads. It is a 2D attractor and I asked GPT to extrapolate it to 3D, not sure if it’s mathematically correct, but it’s the coolest by far. I have left all the params configurable, so give it a try. I called it Simone (Maybe).

If you like math-art experiments, check it out. Would love feedback, especially from folks who know more about the math side.

1. Grosvenor ◴[] No.45777901[source]
This is so cool. Back in highschool during the Jurassic age I used ti play with attractors a lot. Unfortunately on a 486 it took 20-30 minutes to draw one even at low resolution. This renders in realtime and in 3D. Great work!

Still they've had a strong impact in how I see systems - orbits, instability, etc.

replies(1): >>45778795 #
2. cs702 ◴[] No.45777989[source]
Beautiful.

Thank you for sharing this on HN.

3. JKCalhoun ◴[] No.45777995[source]
"IMSAI guy" created a Lorenz attractor circuit [1]. He talks more about it later [2]. I remember seeing the Lorenz attractor on some TV show about chaos.

[1] https://youtu.be/0wD2WbG7loU

[2] https://youtu.be/c14aXxlSxZk

4. Loughla ◴[] No.45778041[source]
I got really into fractals and attractors when I was also really into mushrooms, lsd, and dmt during my graduate studies.

It actually shaped my post doc work quite a bit and shifted my focus from individual classroom education to strategic systems analysis of entire university and k-12 institutions. Somewhere along the way, a switch flipped and allowed me to view complicated hierarchies like college systems as 2-d fractal geometry in my mind. I can't really explain it, but now that I consult, I can feel when a department is broken before I can prove it with data. It's like they don't fit or reflect the main structure of the institution.

I would not suggest taking this route though. Maybe just take some graduate courses or something.

Fun fact, though, defending your dissertation to a room of around 200 people while still feeling the effects of dmt is a really good way to induce a panic attack. Source: it's me. I'm source material.

5. orzig ◴[] No.45778052[source]
Hobbyists hacking around and sharing their art, best part of the Internet!
6. hshdhdhehd ◴[] No.45778123[source]
Very pleasant to watch!
7. adtac ◴[] No.45778150[source]
too many of these vaguely look like what galaxies look like from earth

e.g. https://i.imgur.com/ZjiBF8f.png

just a coincidence?

replies(2): >>45778463 #>>45778473 #
8. HeliumHydride ◴[] No.45778153[source]
How can I code my own attractor?
replies(1): >>45778416 #
9. vis_lover ◴[] No.45778191[source]
Super cool visulitations.

Side note: Did anyone else know it was AI before reading the post? Mathematicians would be argent enough to assume the name was enough, displaying the algo when clicking the name was the give away.

replies(1): >>45778222 #
10. shashanktomar ◴[] No.45778222[source]
Author here, I have tried labeling the "More Information" sections as "AI Generated" where it was directly summarized from the wikipedia article, otherwise most of the post is written by me. I have taken help from AI to fact check and refine few things here and there, but boundaries are so blur now that am not sure if i should label the full post as AI Assisted.
11. cableclasper ◴[] No.45778311[source]
Visualizations like this truly highlight how much there is to be gained from viewing the 3D phase space, but also how much richness we miss in >3D!

(I wonder if there are slick ways to visualise the >3D case. Like, we can view 3D cross sections surely.

Or maybe could we follow a Lagrangian particle and have it change colour according to the D (or combination of D) it is traversing? And do this for lots of particles? And plot their distributions to get a feeling for how much of phase space is being traversed?)

This visualization also reminds me of the early debates in the history of statistical mechanics: How Boltzmann, Gibbs, Ehrenfest, Loschmidt and that entire conference of Geniuses must have all grappled with phase space and how macroscopic systems reach equilibrium.

Great work Shashank!

replies(1): >>45779257 #
12. slicktux ◴[] No.45778344[source]
Lorenz Equations and Chua Circuits probed with an analog oscilloscope is mesmerizing! Great videos of a Chua Circuit being probed with an analog scope… Also, plugging the circuit to a speaker via AUX port gives white noise ;)
13. dmbche ◴[] No.45778416[source]
Pick one and implement it. Find the equations to the lorentz attractor and use those if you need a suggestion.
14. pkspks ◴[] No.45778451[source]
This is absolutely stunning. Wonderful some function of the state of a point can give it colour.
replies(2): >>45778481 #>>45779125 #
15. layer8 ◴[] No.45778463[source]
Galaxies don't really look like that.
16. ◴[] No.45778473[source]
17. shashanktomar ◴[] No.45778481[source]
Author here, there is a setting to pick colour mode. I implemented it after similar suggestion by someone on twitter. Give it a try.
18. jerf ◴[] No.45778696[source]
"not sure if it’s mathematically correct,"

There isn't always "a" correct extension into higher dimensions. There may be many, there may be none, and either way something "close enough" may well be interesting in its own right.

If you'd like something concrete to poke at you can try searching around for people's adventures in trying to make a 3D Mandelbrot. I've seen a couple of good write-ups on those adventures. I don't know if anyone has ever landed on a "correct" solution, it's been years since I last looked, but certainly some very interesting possibilities have been found.

19. Xophmeister ◴[] No.45778698[source]
Neat :) When I was a teenager, some 25+ years ago, I wrote a chaotic attractor visualiser like this — but only in 2D — and it occurred to me, “What if instead of visualising it, I rendered it to audio?” I don’t remember the details: I think frequency was correlated with polar angle and amplitude to magnitude. It forced me to learn how to write WAV format — which was my first introduction to endianness — but the result wasn’t completely inaudible! A bit like the sound effects for computers in old sci-fi movies; random(ish) but not discordant beeps and boops!
replies(1): >>45779063 #
20. anjel ◴[] No.45778795[source]
Fractint4life https://fractint.org/
21. metacortexx ◴[] No.45778891[source]
Love seeing projects like this, just pure curiosity, creativity, and fun
22. Figs ◴[] No.45778943[source]
The demo makes some nice spirals on the ends. They look like galaxies with the rendering.

It reminded me of one of my (cranky) musings from back in college about galaxy formation and whether they were more like tossed pizzas (i.e. spreading out) than like whirlpools getting sucked in.

23. aniijbod ◴[] No.45779010[source]
I don't care about the math, the computation, the physics. This is just by far the most beautiful thing(s) I have ever seen.
24. neilpmas ◴[] No.45779041[source]
Well that's my productivity blown for the day. Love it.
25. gausswho ◴[] No.45779063[source]
Along these lines there are at least two modules that I know of in Eurorack focused on strange attractors, and they're both a LOT of fun adding this kind of unpredictable-but-cyclical movement to your sounds:

- Hypster by Nonlinear Circuits (https://modulargrid.net/e/nonlinearcircuits-ian-fritz-s-hyps...)

- Orbit 3 by Joranalogue (https://modulargrid.net/e/joranalogue-audio-design-orbit-3)

26. pkspks ◴[] No.45779125[source]
It already supports colour!
27. srvmshr ◴[] No.45779174[source]
Coincidentally enough, I dug out my 11th grade CS project on generating fractals from 2002 & modernized it using SFML graphics lib just this week.

https://github.com/gradientwolf/fractals_SFML

Your post gives me so much joy. These tiny little things take me back to teenage years, simpler times & when interests were different. (I put a little note as "why" in my GH repo readme)

replies(1): >>45779594 #
28. flatline ◴[] No.45779257[source]
The conclusion I’ve come to from works like Flatland, 4D toys, etc., is that we simply don’t have the neural circuitry to grasp anything beyond three dimensions. We can reason about them, we can make inferences about the whole from partial understanding, but we cannot truly grasp more than three, or perhaps only for an instant of forced conceptualization using heuristics like you mentioned. Even three is a stretch, our minds have adapted to build a three dimensional realm from something like a 2.5 dimensional field of combined visual, tactile, and auditory stimuli. I suspect 3D reasoning itself is a huge adaptive trait compared to most other animals.
replies(4): >>45779561 #>>45780567 #>>45781132 #>>45781143 #
29. navigate8310 ◴[] No.45779265[source]
The way you explained the mathematical theory was very intuitive and refreshing. It would be every interesting to read if you could also write more on other topics of your interest.
30. tmshapland ◴[] No.45779302[source]
Beautiful. Reminds me of starling murmurations. https://www.youtube.com/watch?v=V4f_1_r80RY
31. felipelalli ◴[] No.45779330[source]
I have no idea what is this, but it's beautiful.
32. imoverclocked ◴[] No.45779397[source]
Reminds me of the xscreensaver, “strange” :)
33. sunjester ◴[] No.45779410[source]
reminds me of phong. https://phong.com/
34. Sreenington ◴[] No.45779438[source]
this is so cool! would be awesome if you can add params to mess with a and b value so we can "find" our own strange attractor patterns. maybe a free mode?
replies(1): >>45779454 #
35. shashanktomar ◴[] No.45779454[source]
Author here, it already supports that for the best attractors. On phone there is a menubar at bottom, on desktop you can’t miss it.
36. cantor_S_drug ◴[] No.45779561{3}[source]
Do you think an AI can learn this intuition by training it in similar environment?
replies(2): >>45779658 #>>45780329 #
37. shashanktomar ◴[] No.45779594[source]
Thanks a lot, it was clearly worth the effort.
38. vincnetas ◴[] No.45779658{4}[source]
Can we train our neurons? Like the experiment where human vision adapted to upside down image, could our brains somehow adapt to understanding 4D data from VR headset?
replies(2): >>45780245 #>>45781340 #
39. Atiscant ◴[] No.45779723[source]
Absolutely great. Thank you for sharing.
40. bntr ◴[] No.45779838[source]
Great visualization! It would be good to add some fog for a better perception of 3D.
41. gigatexal ◴[] No.45779865[source]
This is mesmerizing and very cool. Thank you!
42. GistNoesis ◴[] No.45779889[source]
How do I write my custom attractor equation ?
43. gf000 ◴[] No.45780245{5}[source]
I'm sure some form of training is possible where you get a better understanding of a 4D universe with some limited inference abilities, but with a bad analogy, this would all be "software emulated" with no hardware acceleration - we only have the latter for 3D and we can't update it without a hardware change.
replies(1): >>45780416 #
44. eps ◴[] No.45780267[source]
Mesmerizing stuff.

Can you allow changing attractor control constants without resetting the sim? E.g. going from 0.19 to 0.21 in Thomas while it's already in a stable state.

It's be interesting to see what'll happen.

45. axi0m ◴[] No.45780270[source]
I'd like one of these as my screen saver. Great work!
46. apples_oranges ◴[] No.45780329{4}[source]
Good point, why not? Communicating it back to us could be a problem. Hmm.. what if future ais hide data from us in dimensions we can’t wrap our heads around?
47. logicchains ◴[] No.45780416{6}[source]
With future improvements in brain-computer interfaces it might well be possible to send a 4D visual signal into the brain.
48. nxpnsv ◴[] No.45780511[source]
This is really pretty. A loong time ago when I wrote a Lorentz attractor on my 486 with turbo pascal and inline assembler, I could only dream of such smoothness back then...
49. ilovefood ◴[] No.45780534[source]
Super cool and well done. They are much better in 3D! :)

I made a similar experiment a while ago and randomized the parameters. Given it's difficult to stumble on a stable arrangement, I turned it into a small game to find pretty ones: (big disclaimer: this involves NFT tech, please skip if you're against that sort of stuff) https://karimjedda.com/symmetry-in-chaos-my-first-generative...

50. sorokod ◴[] No.45780567{3}[source]
At least for 4D, would you not consider 3D-over-time as a four dimensional model? Doesn't watching the evolution as seen here allows for building up an intuition ?
replies(1): >>45780920 #
51. Libidinalecon ◴[] No.45780621[source]
Really visually wonderful. I tried to self learn about nonlinear dynamics after reading about Takens's theorem last year but I have to admit, I have no idea what an attractor is actually showing like this.

This might be inspiration to try to grasp these ideas again.

Rotating the Lorenz makes me think otherwise though because given the amount of time I put into this, I should understand that much more than I do.

Chance and Chaos by David Ruelle is a wonderful little book.

52. sometimes_all ◴[] No.45780690[source]
This gives me Johnny Quest theme song vibes.
53. tliltocatl ◴[] No.45780920{4}[source]
Well, what's interesting about 4D is that's not just an extra dimension slapped on top, it's extra rotational degrees of freedom. You can't really get that with time (at least not until you get relativistic, and it still would be hyperbolic rotation, not euclidean).
replies(1): >>45781046 #
54. dmarinus ◴[] No.45781009[source]
very nice, if you want to know more of the history of chaos I recommend the following book: https://en.wikipedia.org/wiki/Chaos%3A_Making_a_New_Science?...
55. lazide ◴[] No.45781046{5}[source]
Sure you do - waves only exist in 4D as they have a time vector (frequency).
56. teunlao ◴[] No.45781110[source]
Learned more about attractors dragging this around than from wiki. This is how math should be taught.
57. Gooblebrai ◴[] No.45781132{3}[source]
I've been waiting for Miegakure for ages
58. Laremere ◴[] No.45781143{3}[source]
I've managed to visualize a Klein bottle in 4d. I easily visualize 3d objects. However I can't really do color - I startled myself recently when I briefly saw red. On that aphantasia test with an apple, I can hold it's 3d shape, but no surface texture or color.

People seem to have surprisingly different internal experiences. I don't know how common 4d visualization is, and I suspect even those capable require exposure to the concepts and practice. However I do think it possible.

replies(4): >>45782147 #>>45782240 #>>45782302 #>>45782419 #
59. atombender ◴[] No.45781144[source]
I bought "Strange Attractors: Creating Patterns in Chaos" (1993) by J. C. Sprott recently, which is a fun book about these kinds of attractors. The whole book can be downloaded online [1] from the author's web site [2].

It's such a typical object of its time. Garishly colored cover, comes with a floppy disk (!) and there are even 3D glasses to view some of the stereoscopic color plates (unfortunately these were missing from the used copy I got). I was surprised to find that most of the programs are in BASIC (maybe easier to do graphics on Windows back then?), though a small number of them are in C.

It's a nice book, and the author seems to have a lot of publications about chaotic systems. Anyone know him? He seems to still be teaching at the University of Wisconsin - Madison.

[1] https://sprott.physics.wisc.edu/fractals/booktext/SABOOK.PDF

[2] https://sprott.physics.wisc.edu/

60. alansaber ◴[] No.45781180[source]
I am shocked by how well this runs
61. evanb ◴[] No.45781318[source]
> A small change in the parameter a can lead to vastly different particle trajectories and the overall shape of the attractor. Change this value in the control panel and observe the butterfly effect in action.

I think this is slightly inaccurate. The butterfly effect is about the evolution of two nearby states in phase space into well-separated states. But the parameter a is not a state. To see the butterfly effect by changing a we would need to let the system settle down, give the parameter a small change, and then change it back. The evolution during the changed time acts as a perturbation on states.

Instead, showing that the attractor changes qualitatively as a function of the parameter is more akin to a phase transition.

62. lioeters ◴[] No.45781340{5}[source]
Yes, I believe it's possible to train our brains and learn to perceive better in higher dimensions. There's a great description in the science-fiction book Neverness, where pilots meld their minds with the spaceship computer to visualize and navigate hyperspace.
63. ◴[] No.45781347[source]
64. d_tr ◴[] No.45782147{4}[source]
For me, being able to visualize 4D would imply that I can picture four mutually perpendicular axes, something which I find completely impossible for me to do. And I thought it is impossible for any human brain. It would be fascinating if I am wrong.
65. ◴[] No.45782240{4}[source]
66. cantor_S_drug ◴[] No.45782302{4}[source]
The blind French mathematician Bernard Morin is well-known for creating the first visualization of a sphere eversion, a method for turning a sphere inside out without creasing it. His work was based on Stephen Smale's 1958 proof of sphere eversion's existence and on ideas shared by Arnold Shapiro. Morin's method involved constructing a sequence of models, including his "Morin surface," to demonstrate the process.

https://en.wikipedia.org/wiki/Bernard_Morin

67. soulofmischief ◴[] No.45782419{4}[source]
Your hippocampus has several special clusters of neurons whose members activate and deactivate based on your body's understanding of your position and momentum in a 3D world.

The arrangement of these neurons physically corresponds to reality, and so things are pretty hardwired.

Repurposing these neurons might be possible with advanced training and nootropics, but I'm not sure. You might have better luck engaging other parts of your brain, for example using metaphor or abstraction such as mathematics.