5 ms·
HTML5 Gravity/Galaxy Simulator
- hliyan 12y agoWhat emerges from the random field looks remarkably like the large scale structure of the known universe.
- jpco 12y agoThis is cool, and I'm a sucker for gravity/space simulators (as my hours logged on Celestia would prove), but it should be noted that in terms of "galaxy" it's inaccurate. Specifically, this inaccuracy (the galaxy rotation problem) is the driving force behind the hypothesis of dark matter [0]. I don't mean to be pedantic or anything. I just think it's interesting. [0] http://abyss.uoregon.edu/~js/cosmo/lectures/lec17.html http://abyss.uoregon.edu/~js/cosmo/lectures/lec17.html
- drinchev 12y agoYeah maybe it would be nice idea if when you generate a galaxy it also generates small dark matter particles around the regular particles.
- bitJericho 12y agoFirst a simulator like this would have to be written with Einstein's equations. This is (just a guess) a newtonian physics sim.
- cge 12y agoNo. The dark matter problem exists in Newtonian models as well.
- phkahler 12y agoWhat laws of gravity would those particles have to obey?
- drinchev 12y agoI think the answer of your question is being seek by a lot of physicists.
- phkahler 12y agoAFAICT the rotation problem stems in large part from trying to use Keplers laws for a galaxy where they simply do not apply. I've even seen this problem in an article in Nature. It's quite a bit more than a 2-body problem. I'm in favor of these simulators plotting the rotation curves of simulated galaxies.
- pacmon 12y agoIf you like simulators like this you might be interested in this game: http://store.steampowered.com/app/72200/ http://store.steampowered.com/app/72200/
- mcdevhammer 12y agoI also wrote a 3D version in C++ using OpenGL https://github.com/claassen/GalaxySim3D https://github.com/claassen/GalaxySim3D
- conistonwater 12y agoI can't help but notice there is a magical "Theta" parameter, with the description "Higher = faster, less accurate". I think here it's a threshold for ignoring children nodes' internal structure in an octree. As a matter of good software engineering (and numerical analysis, and mathematics, too), your software shouldn't have magical parameters with mysterious consequences for the correctness of your software. (I know correctness is maybe not the point here, but still...) Also, note that there is no way for a user to check how accurate the simulation is for a given "Theta" parameter. The name is completely non-descriptive as well. There are mathematically sound ways to determine the accuracy of the simulation. If they are expensive, tell that to the user explicitly, but default to the correct implementation, not the fast one. Note that while the user has no clue what "Theta" is, the user might instead be able intuitively specify that they want the simulation to be accurate "to X digits for the first Y seconds of the simulation". I think that would be a better software design. As it is, "Theta" is an exposed quirk of the implementation.
- mcdevhammer 12y agoIt was really meant just as a toy and not a scientifically rigorous simulation. Any value of theta is going to make not 100% accurate (not to mention the simulation speed which also affects accuracy).
- conistonwater 12y agoMy criticism is aimed not at you personally, but at the general pattern in (what I consider to be) poorly designed numerical software.
- lutusp 12y ago> As a matter of good software engineering (and numerical analysis, and mathematics, too), your software shouldn't have magical parameters with mysterious consequences for the correctness of your software. To some extent, yes, but consider that we're speaking of a numerical differential equation solver. If we make the time steps too large, the program runs fast but the simulation is less realistic. If we go too far and make the time steps very small, we'll start seeing rounding errors in the floating-point processing. The reason this class of simulation is numeric is because all but the the most trivial orbital simulations must be performed numerically. The reason for that, in turn, is because of the Three-Body Problem: http://en.wikipedia.org/wiki/Three-body_problem http://en.wikipedia.org/wiki/Three-body_problem By the way, while we're on the topic, here's my HTML5/JavaScript orbital simulator plus math tutorial: http://arachnoid.com/orbital_dynamics http://arachnoid.com/orbital_dynamics
- lemmingapex 12y agoWell done. Here's my HTML5 Version: https://news.ycombinator.com/item?id=8288434 https://news.ycombinator.com/item?id=8288434
- ellysetaylor21 12y agoI am not familiar with this but it seems like a playing tool for kids, can I have some tutorial to learn how this will make?