Better HN
topnewbestaskshowjobs
Log inSign up

the_happy_koala

52 karma · joined Nov 30, 2018 (8y ago) · 12 submissions

Submissions

comment 7y ago · link · parent

Aww, thanks for sharing. If anyone has any questions, let me know and I would be very happy to answer them!

comment 7y ago · link · parent

That's the intention!

comment 8y ago · link · parent

Can't stop myself from staring at those modulating peaks; hypnotizing stuff! Leapfrog integration, as foxes pointed out, is not symplectic if you apply an adaptive time step. I'm not that concerned about the integrator being symplectic as it's not my intention to run simulations that last for millions of years. If it's possible to add comments to a thread here on hacker news (new to this site!) indefinitely, I'll give you a heads up when I've implemented an integrator with an adaptive time step, and in case you get to it before I do, do share :D!

comment 8y ago · link · parent

Hi Paul!

Many thanks for your feedback! Implementing an integrator with an adaptive time step is on my bucket list of features that I intend to implement, as tweaking the time step manually, especially with the freaking slider, is somewhat of a pain in the neck. Another reason for why I want to implement an adaptive time step is that collisions don't really work with a fixed one as sometimes a mass will travel farther in one time step than the radius (I use a simple radius check for collisions since it doesn't require that much computing power) of the body it is smacking into, and as such the hit won't get registered, which looks kind of shoddy (implemented collisions but removed them for this reason).I've had an eye on the RK45 method, but I'm definitely going to give implementing the Bulirsch-Stoer Integrator a go as I want the user to be able to select the integrator they want to run a scenario with (right now I've just implemented Euler and RK4). As for using spherical or cylindrical coordinates, the thing is that the intention is for the user to be able to, for instance, add another sun to our solar system to marvel at all the cosmic shenanigans that would take place, so while a lot of the scenarios start out with a single large mass, that might not be the case for long if the user has a penchant for destruction.

comment 8y ago · link · parent

I just realized that I'm yet to properly introduce myself to you folks; name's Darrell (the Happy Koala - I love koalas the way other people seem to love cats!). I'm a self taught developer and the project this thread is concerned with is actually the reason, pretty much, I started dabbling with code. If you want more of a background, you can check out an article I wrote over at Medium about the evolution of this project and how it led to me becoming a web developer - https://medium.com/@darrell.arjuna.huffman/how-an-interest-i... (please bear with any spelling or grammatical mistakes as English is not my first language). I'm still very much of a junior empty stack developer, but I love coding and intend to continue doing so, so hopefully we'll have lots of interesting discussions here on Hacker News in the future! Having said that, have a nice start to the week!

comment 8y ago · link · parent

Orbiter, like magnetic pointed out, is probably what you're looking for! That having been said, I plan to introduce spacecraft that can be controlled by the user in a realistic manner at some point, although I want to get the physics (thrust, attitude control and so on) right before introducing this feature. If you check back in a couple of days there will be a simulation of the up and coming Dear Moon mission (the plan, to send a bunch of artists in a free return trajectory around the Moon, concocted by a Japanese billionaire that will be executed by SpaceX).

comment 8y ago · link · parent

Hi Pavel!

Every body in the simulation start out with a set of initial position and velocity vectors. For the solar system scenarios, I got these vectors from NASA JPL's Horizon System (https://ssd.jpl.nasa.gov/horizons.cgi#top), so the orbit of Juno that you are observing is its actual orbit... Its eccentricity (the extent to which the shape of the orbit departs from a perfect circle) is extremely high; at its closest point, the orbit brings Juno right above the cloud tops of Jupiter, and at its furthest point Juno finds itself beyond Themisto (one of Jupiter's irregular Moons which I should perhaps add to the scenario). Juno was meant to have a less eccentric orbit, but as technical problems were encountered when they were going to fire Juno's thrusters to reduce the eccentricity of the orbit, NASA played it safe and let Juno stay on its eccentric orbit. One of the advantages of this is that Juno only spends a very short amount of time in Jupiter's insanely powerful and to a spacecraft damaging magnetic field, so the technical mishap is probably one of the reasons JunoCam is still operating and giving us beautiful images of Jupiter's swirling clouds! Here's a gif from WikiPedia showing how stretched out Juno's orbit is https://en.wikipedia.org/wiki/Juno_(spacecraft)#/media/File:.... Sorry for the long rant, but I find these things to be awesomely fascinating.

comment 8y ago · link · parent

Thankie!

comment 8y ago · link · parent

My CSS skills aren't what they should be, but I'm going to try to make a mobile friendly version of the simulator at some point once I know more about flexboxes, media queries and what have you.

comment 8y ago · link · parent

If for whatever reason you have time and would like to make a contribution, I think doing so should be quite easy as I think you'd just have to subclass the Euler class. You can get an idea of how to do this by looking at how I did it with the RK4 subclass (https://github.com/TheHappyKoala/Harmony-of-the-Spheres/tree...). If not, I'll add Verlet integration myself one of these days, but right now I'm working on introducing a particle system so that I can simulate the rings of Saturn (the particles will feel the gravity of all the masses in the simulation, but they won't exert a gravitational force on the other particles and masses in the simulation; this way you should be able to have fun distorting the rings of Saturn with a celestial object of your choice).

comment 8y ago · link · parent

I'm working on implementing an integrator with an adaptive time step, so that the time step is high when masses are far away from each other and just coasting, but low when they get close to each other and interesting things happen; think the orbit of a comet getting altered as it encounters Jupiter after a long journey from the Oort cloud. As things are now, such a scenario would be painfully slow to simulate if you want to maintain accuracy, but if you speed up the time step, nothing remotely realistic will come out of the simulator... So good point, and I hope I'll be able to cobble together a solution soon enough :D. As for symplectic integrators, I'm not sure they stay symplectic if you alter the time step, but I could be wrong!

12.

Show HN: Harmony of the Spheres – Gravity Simulator(thehappykoala.github.io ↗)

69 points · by the_happy_koala · 8y ago · 26 comments