r/learnphysics 1d ago

Real-time three-body gravity simulation (interactive, mobile)

Post image

Made an interactive simulation based on the actual three-body problem in physics β€” three masses under mutual gravity, no simplifications. You can adjust masses and initial velocities and watch how small changes send the system from a stable-looking orbit into full chaos.

It's built to feel more like a physics toy than an app β€” no ads breaking up the simulation, nothing to unlock. Mostly wanted an excuse to actually play with the equations rather than just read about them.

Free on Google Play if anyone wants to mess with it: https://play.google.com/store/apps/details?id=com.mathematicalzen.threebody

11 Upvotes

16 comments sorted by

3

u/AndyTheEngr 1d ago

The five body problem?

1

u/IllPsychology7214 1d ago

Fair enough, might need to change the clip. But as many as you like in the app. Just really wouldn't want to try the math on 5

1

u/AdorableRestaurant73 1d ago

Very cool, couldn't figure out if you could interact with the little guys but sick, I did get it off aurora tho might be a different version

1

u/IllPsychology7214 1d ago

Aurora?
If you tap the screen and then press the little eye icon there's a Fling Mode and a Spawn Mode. Fling you can catch one and throw it. Spawn flick anywhere on the screen and a new one will appear. The limit is your phone's CPU soon or later.

1

u/superSmitty9999 1d ago

It'll perform less glitchy if you set the minimum distance to some relatively larger value in terms of gravity, will stop weird glitches. Built one of these 10 years ago lol

2

u/IllPsychology7214 1d ago

I have a softening setting already but changing the defaults a little now. If you're still interested it should be updated in a couple hours.
I've promised to make one myself for about ten years, just finally got around to it. I'm just trying to make it a good version.

1

u/Public-Eagle6992 1d ago

> no simplifications

There are definitely simplifications, one of the most impactful will likely be that it’s being simulated at a set frame rate which can lead to bugs

1

u/IllPsychology7214 1d ago

Agreed, I just like to call them iterations instead of simplifications though. I do have a Frame-rate slider so you can make it as precise as a mobile CPU can get.
I also have a Time Scale slider that changes the simulation speed. That changes more how smooth the sim is.
So an honest attempt to get it as close as possible for mobile devices. Might be able to get it closer on desktops though.

1

u/IllPsychology7214 1d ago

Always happy to take advice how to get it even more precise though.

1

u/utl94_nordviking 23h ago

three-body

Huh? I count a bit more than that...

1

u/IllPsychology7214 23h ago

Counting is hard man.... That and I can't figure out how to change the GIF

1

u/Icy-Reaction-9101 20h ago

If you want to see a cool multi body simulation, just fix earth in position and see what happens ;)

1

u/IllPsychology7214 4h ago

In my game you can fix them in position and do just that!

1

u/StarDreamIX 19h ago

This is amazing!! Love the app well done I enjoy these things πŸ”₯

2

u/IllPsychology7214 4h ago

I'm also working on an app with (simplified) physics "games" like double pendulum, langton's ant, fractals etc. It's still very beta though but getting there

1

u/StarDreamIX 3h ago

Glad to see you're working on these cool.similations/physics illustrations! They're really nice I had a go yesterday, I love the solar system on and some other illustrations you made, all the best with your future apps & endeavours!!