Live data from Hacker News

How would you program a model of a universe?

news.ycombinator.com

11–15 of 15 posts

Re: How would you program a model of a universe?

#11
Google created this a while ago, was very cool.

http://stars.chromeexperiments.com/

And I also had played this game on Steam like 10 years ago and loved it. Very basic, very simple. You started out as a small speck of dust in space and as you flew threw space, your gravity would begin to absorb the elements and you would get bigger, becoming a planet, a bigger planet, a sun, a black hole... while it was mostly simuluation and you had no real enemies, gravity is always our biggest enemy and you could be ripped apart by another black hole or even a giant sun, which made the game so enjoyable. You could drift and float and control it.. you flew through space and moved the arrow keys to avoid objects. You could change your speed too.

Let me see if i can find it and i only bring it up since I can't answer your exact answer, but can show you an idea. Looks like it got a massive upgrade as it used to be 2D. https://store.steampowered.com/app/230290/Universe_Sandbox/

And CodePen can at least get you started with a simulation.

https://codepen.io/search/pens?q=universe

Re: How would you program a model of a universe?

#12

Google created this a while ago, was very cool. http://stars.chromeexperiments.com/ And I also had played this game on Steam like 10 years ago and loved it. Very basic, very simple. You started out as a small speck of dust in space and as you flew threw space, your gravity would begin to absorb the elements and you would get bigger, becoming a planet, a bigger planet, a sun, a black hole... while it was mostly simulu…

Very cool! Thanks for sharing! I'll check that out.

Re: How would you program a model of a universe?

#13

Google created this a while ago, was very cool. http://stars.chromeexperiments.com/ And I also had played this game on Steam like 10 years ago and loved it. Very basic, very simple. You started out as a small speck of dust in space and as you flew threw space, your gravity would begin to absorb the elements and you would get bigger, becoming a planet, a bigger planet, a sun, a black hole... while it was mostly simulu…

Very cool! Thanks for sharing! I'll check that out.

What you want to do reminds me of an episode of Futurama. https://www.youtube.com/watch?v=EL7e05pClKM

Re: How would you program a model of a universe?

#14
1/ Since we have an example of a working universe at hand, I think I would start by modeling the 4 basic interactions. And there is already a quite hard issue which is: 3 interactions are short range, and the 4th (gravitation) is long range. So you will need a large enough universe and a large number of particles from the start. Second issue is that you may not see interesting behavior emerging before your patience ends.

Compared to Conway's game of life: only one interaction (short range), interesting behavior almost immediate.

Maybe there is middle ground. (game of life with a long range interaction?)

2/ Initial data to be chosen randomly. Works both for game of life and our own universe.

Re: How would you program a model of a universe?

#15

1/ Since we have an example of a working universe at hand, I think I would start by modeling the 4 basic interactions. And there is already a quite hard issue which is: 3 interactions are short range, and the 4th (gravitation) is long range. So you will need a large enough universe and a large number of particles from the start. Second issue is that you may not see interesting behavior emerging before your patience e…

If I was God, I would first create a very dense three dimensional grid in the void. Then in any point of the grid there is a gravity vector that points to a direction with the highest combined force of gravity calculated at that point. So gravity must be a three dimensional vector field.

Now, the direction and length of those vectors have to be continuously updated due to moving particles so that we can efficiently move particles arriving at any point.

The most logical explanation is that our universe updates its state at frequency that is directly linked to speed of light. This update frequency dictates the maximum distance any particle can travel in one cycle. Similarly gravity vectors cannot be updated faster than this frequency dictates. So gravity must propagate as spherical waves at the speed of light.

Similarly the system needs to continuously calculate electromagnetic field vectors for all points.

So when you place any fundamental particle in points X in the grid, it is immediately moved based on the direction and amplitude of the vectors in that point - but only by vectors that have been defined by rules to have an impact on this particular fundamental particle. We can e.g. define particles that are not effected by gravity at all.

So at very minimum we need some fundamental particles, forces and a way to calculate how those particles move in the grid. The system has an update frequency which defines the maximum speed in the grid.

Then you need to define rules what happens when two or more fundamental particles come close enough to each other.

When you have those rules and they produce an evolving system that stays in motion when fed with enough "input data", you have cracked this problem.

Solving this problem is the key to understanding theory of everything. So although the initial models aren't exactly correct, this exercise forces you to think like a God.

Post reply on HN