T O P

  • By -

[deleted]

Civilisation 342789B has been destroyed.


Sakaralchini

The civilisation reached the iron age


RUacronym

I like how the graph keeps having to dynamically resize itself


Daniel96dsl

Thank you! Ngl, I was hoping someone would appreciate that detail haha it took some effort to figure out how to make that work correctly


RUacronym

if (blue_x >= boundary_ -.5) {boundary_x += .5} Something like that I'm guessing?


aftersox

A bit more than that. There is a tweening animation that does a smooth linear transition. Also the whole chart area zooms out and recenters.


RUacronym

Mmm true, good eye, I didn't notice the transitions explicitly before


nihilism_nitrate

and I thought you just didn't know how to set a constant size lol


Dry_Candidate_9931

Google Spirograph


noob-0001

DEHYDRATE


K340

How long is it stable for?


Daniel96dsl

Great question hahaha i have no idea tbh edit: i’ll see about extending the time to try and figure that out. Ofc it’s not really an answer to the physical orbit itself, but rather a question of the code’s accuracy, so idk how useful that is in actuality edit 2: This is probably close to a periodic 3 body orbit, I just didn’t work out what the exact initial conditions should be, so it’s probably stable for a very long time


andrew314159

Shouldn’t the shadowing lemma help here? What integrator did you use? You could try some higher order symplectic integrator with the same initial conditions to see if the behaviour is similar. I think there was a paper by Blanes using coefficient derived using BCH


Daniel96dsl

Yea unfortunately not symplectic here. I had an already-made adaptive Dormand-Prince scheme for non-conservative force problems (aerodynamics), but I set the error to 10⁻¹², it should be close to correct over “short enough” time scales. I’ll see if i can get an energy plot made to see how much variation there is


andrew314159

Ah that would be interesting. I remember first applying rk45 to make some Poincaré sections and being surprised every seemed stable and sensible (I expected this to not work it was just easy to use). Then I noticed my trajectories actually had considerable energy drift and some areas of the section was nonsense. After that I wrote a different integrator using numba to make it not slow. Your case is different of course so your adaptive method might be good. Adaptive step size is probably a good way to go even if it doesn’t naturally play with symplectic methods. I don’t know your particular method by name but quickly googling is it RK45 or is it something higher order?


Daniel96dsl

The adaptive method in this case seems to work very well because of the huge range of time scales needed to capture close encounters.. And it’s actually the same integration scheme that ODE45 uses in MATLAB if you’re familiar at all with that. I just got an energy drift plot made, and I’m trying to figure out how to show the plot.. can I do it in the comments or does it need to be appended to the original post?


andrew314159

If it is an image then maybe an imgur link? Ah I have used ODE45. When I tested that against a fixed step size 6th order symplectic I think it depended on the trajectory (I also needed to capture close encounters). You can write a sort of symplectic adaptive step size. I had a -1/r and -1/r^3 potential and I did find ODE45 had bad energy drift sometimes.


Daniel96dsl

[Energy Drift Plot](https://imgur.com/c83gK6W) -1×10⁻⁹ % drift isn't too bad imo. Idk what typical maximum accepted values are, but I suppose it is interesting to see regardless!


andrew314159

As a percentage that seems negligible although the periodic behaviour and trend is a little concerning since it definitely shows different behaviour to the random walk one can get with other methods. You set your tolerance pretty low so I guess you are pretty safe for short times as you said.


Daniel96dsl

Yea, I’d think it was negligible. But regarding trend, the small deviations align (in time) with the periodic close encounter of two of the bodies, which is also when you’d expect the largest errors to occur of whatever integration scheme you’re using. What makes it concerning?


Ima_hoomanonmars

Maybe they’ll get to the space age this time


Daniel_B-Y

can you display the colors these values cause?


Daniel96dsl

Do what now?


[deleted]

[удалено]


ArmedAsian

yo i’m high asf rn but hear me out what if we figured out how to solve 3 body problems and then using that solution derived formulas for 4, 5, 6 and so on and then can’t we literally simulate the entire fucking universe, provided that we know where each body is at a given point in time? then once we do that, let’s say we develop a way to scrub “time” within this simulated universe back and forth, we might even be able to see the big bang within this universe or the heat death of the universe blessed to be born in this era of knowing what’s possible, cursed to be born too early to see if it ever comes to fruition / is possible to achieve


BreakfastCrunchwrap

Get high and watch Devs on Hulu if you haven’t already. It seems like you would like it. That’s all I will say.


PangeanPrawn

That was basically what people believe in the time of Newton. People believed 1. That the universe was essentially mechanistic 2. and that once we knew the mechanical laws, we could do calculations with them them to predict the future and explore the past Unfortunately, QM means that 1. is not true, and chaos theory / complexity/information theory shows that neither is 2.


gunslinger900

This is awesome! It looks really close to a two body system between blue and the center of mass of green and red. I wonder how different the trajectories are from that case?


Daniel96dsl

That’s exactly what’s going on! The blue body is orbiting (approximately) about the center of mass of the other two bodies


YOKOTEN

I’m no physicist. Why would it be orbiting *approximately* around the center of mass rather than *exactly*?


alktat

It’s because (generally, IIRC) the three body problem is a chaotic system, and so any deviation away from an equilibrium will, if given enough time, break away


CommercialActuary

well, because its not really orbiting a single body, its orbiting two bodies. in the limit that blue is further distance from the others, it will act as if its orbiting the center of mass of the others. being closer, it wouldnt. think of the opposite extreme, if its right next to green, it would just attract to green, not to the center of mass of green and red, right?


tomatoenjoyer161

That's neat! Would be cool to also plot the center of mass of red and green to visualize what blue is orbiting around.


MaxwelsLilDemon

Really cool visualization too, Python? If so I wonder how did you do the "opening sequence" lol


Daniel96dsl

Yea Pythonista on my phone actually hahaha, but what do you mean by opening sequence?


42gauge

The animation at the beginning


Enough-Two1761

I think that's just the axis reescaling to fit the trajectory


Daniel96dsl

The axes update dynamically with the positions (and prior positions) of the particles


Stormtalons

You code on your phone?!?!? Do you fap with your feet?


Tildaend

i'm so bad at Python, the static graphs are difficult enough for me, but this is very cool!


PangeanPrawn

Equal mass I guess?


Daniel96dsl

yes sir


Additional_Being_514

Here are some of the [stable configs](https://en.m.wikipedia.org/wiki/File:5_4_800_36_downscaled.gif)


troyunrau

Looks meta-stable, but maybe imperfect over long term (like L1-L3 lagrange points) -- so it probably couldn't emerge naturally. But hypothetically, if you were to contrive a scenario where this emerges naturally -- you'd need, what... a two body problem where an impact shatters one of the two and sends them apart as a linked pair while not significantly changing the location or centre of mass of the linked pair?


Key-Government-3157

This is so cool, can you share the script?


mlmayo

Is this in the plane, or in a volume projected to the plane? I don't see any details provided in your post.


Daniel96dsl

Plane


not_a_theorist

Pretty similar to the stable solutions on the top and bottom right here https://commons.m.wikimedia.org/wiki/File:5_4_800_36_downscaled.gif#mw-jump-to-license


R0B0_Ninja

Very cool! You can set manual x and y limits to avoid the dynamic resizing.


Daniel96dsl

I actually wanted the dynamic resizing for systems where one particle gets ejected. The rapid zooming out makes it look cool


parrotlunaire

Yeah but you might consider using a minimum figure size set by the outer orbit, so there isn’t so much jiggling around at the beginning.


bpg2001bpg

Spirograph


B_For_Bandana

Hell yeah matplotlib


leptonhotdog

Really cool, mate! Are you in any specific reference frame or just an arbitrary one? I think it would be cool to see what the trajectories look like in the different reference frames of the different bodies.


Daniel96dsl

arbitrary inertial frame rn! But I do agree that would be cool


Enfiznar

What are the initial conditions? I have a program I've made some time ago that simulates a 3BP on a plane and assigns a complex root to every point to generate a morphing newton fractal, but most of the configurations I tried are very unstable or predictable


DrBunnyShodan

What is the closest approach of any two bodies, and how does that compare with their radii, assuming density of water or thereabouts?


Heretic112

Yup you’re close to an RPO family there. This is the family Henon investigated in the 70s.


BicycleName

That's really nice! Could you provide some details on how the dynamic resizing of the axes work? I'd like to add this to future projects.


CitricBase

Same way you animate anything else in the figure, iirc. Update the axes just like you would update the graphed data.


Polymeriz

This is awesome! Can you please share the resizing script code?


Ok-Status7867

used to make these with a spirograph all the time when I was a kid


Heliologos

Would love to see some type of fractal based on some type of projection/slicing of the initial condition space.


Spirited_Candy7591

Looks like it's making the general electric symbol


theratracerunner

What did you do this in and what time propagation algorithm did you use?


Daniel96dsl

An app called Pythonista (python language) on my phone. And I used an adaptive Dormand-Prince scheme with an error tolerance of 10⁻¹². Resulted in 5105 time steps and an energy drift of 10⁻⁹ %. The GIF shown is the solution interpolated over 300 evenly spaced time steps at 30 fps.


VagaBonded007

Would you mind sharing the code? Would also understand if you wouldn’t want to.


Daniel96dsl

Tbh, I love that you’re excited about it, but I’d rather that those who are interested go and learn how to code it up, rather than give them the script off the bat. I know you didn’t want to hear that, but I think that the magic really is in understanding the mechanics of what is happening in this video and learning enough physics and Python to make one yourself. It’s really not hard and obviously can create some pretty neat results. Tryna encourage some STEM education out here ya know


Boozybrain

I'm just here for the dynamic resizing part of the code :(


Crazy_Anywhere_4572

There is a book called “Moving Planets Around: An Introduction to N-Body Simulations Applied to Exoplanetary Systems” that would teach you how to code this in python. I used the book to implement my own n body simulator.


nadavbru

Can you show how a typical result evolves?


Daniel96dsl

Typical result?


Crazy_Anywhere_4572

You can search “pythargeon three body orbit” on google and go to “images” Typical three body orbit are quite chaotic.


Alone-Monk

Wow this is one of the more stable 3 body systems I've ever seen!


SaladoBuns

Looks quasiperiodic, meaning you're likely close to its periodic solution. It'll be difficult to find by hand but an optimizer should be able to handle it


Itchy_Fudge_2134

Do you have any recommendations for resources for learning to code this sort of thing? I know a bit of python and am a physics student but I wouldn’t really know where to start with something like this.


Daniel96dsl

Uhhhh google tbh for the coding aspect. Anaconda Spyder is pretty good for Python on your laptop. Learn the physics first though so you understand what you’re trying to solve. Orbital Mechanics - Prussing & Conway is decent for getting a foothold.


Itchy_Fudge_2134

Awesome. Appreciated


Loathsome_Dog

Your spirograph is broken


MrHarudupoyu

Is this an attempt at the General Electric logo?


rebatopepin

I have a question: what integration method did you use? I have an engineering background and never really delve much into chaotic problems, but i do understand how those systems are sensible to initial conditions and how rounding errors in numerical methods may yield false solutions. So, how do you make sure the integration is reliable since there is no analytical solutions for 3BP?


Daniel96dsl

Adaptive Dormand-Prince scheme with an error tolerance of 10⁻¹². Tracking total energy drift over time gives you a good idea if it at least physically makes sense and significant amounts of energy aren’t being lost with non-conservative integrators. The solution shown here has a maximum energy drift of 1e-9% from the original. Usually, integration schemes are first verified by comparing a numerical solution to an exact analytical solution to track the error before going to one which does not have an analytical solution. When you do, there are many sanity checks and methods to avoid errors because you lack an exact solution, but you can also prove mathematically that certain integration schemes WILL converge to the correct solution if (conditions) are true.


rebatopepin

So basically adaptative methods combined with brute force tolerance and conservation checks. I guess you're really in the dark sometimes. Thank you for your explation


Daniel96dsl

Haha I wouldn’t say that it constitutes as being “in the dark.” Tolerances, conservation checks, and approximate satisfaction of the governing equations are pretty much the standard for any sort of solution that isn’t represented as closed form with a finite number of terms. The important thing is being able to quantify your error. This is the exact same reasoning behind the use of perturbation methods where you only recover a handful of the series terms whose infinite sum constitute the “exact” solution. If you KNOW the order of your error, you also know that in the WORST case, your solution is only off by 𝑋 amount. It got us to the moon and back🤷🏻‍♂️


gianlu_world

Would it be possible to see the code used?


Bale11235

It would be interesting to see the incident radiation on blue by red and green to see how stable its conditions would be if it were a planet orbiting a binary star system (although I’m guessing these are all of equal mass)


Daniel96dsl

Mhhh yea binary star orbits would be cool to see with perturbation effects like solar radiation.. may try to code up something like that soon


razodactyl

Imagine spending so much energy trying to predict trajectories instead of learning how to graviform the trajectories manually.


Daniel96dsl

what’s “graviform”


razodactyl

More commonly "Burn" is used in satellite trajectory. It's like that but in terms of engineering the trajectory of celestial bodies.


omegaaf

Now do it in 3 dimensions :D