You are browsing as a guest. Sign up (or log in) to start making projects!

BlackHole Simulation

  • 5 Devlogs
  • 7 Total hours

A simulation of a black hole using python

Ship #1 Pending review

I built an interactive 3D black hole simulation using pure python using matplotlib, scipy, numba, and numpy! It simulations gravitational lensing, light bending, and accretion disk Doppler beaming, inspired by Jean-Pierre Luminet's simulation of a black hole in a 1979 IBM computer

The hardest part about the project was figuring out the math, the equations and the geometry of a black hole; as well as solving the lag problems and figuring out how to make this thing work without needing WebGL shaders and heavy engines.

And that brings me to the part that makes me the most proud about this project, mostly people make a project like this in python using shaders and heavy engines but i didnt, i made it all in a standard window!

  • 5 devlogs
  • 7h
Try project → See source code →
Open comments for this post

2h 18m 26s logged

BLACKHOLE SIMULATION

#Devlog-5

Howdy everyonee! This afternoon i decided to SCRAP EVERYTHING AND START OVER AND FINISH THIS MUEHEHEHE, with the help of some prior research and experimenting I FINALLY CREATED THE BLACKHOLE SIMULATION.

I completely scrapped the stippled IBM 1979 idea instead i used a different method!

Enhancements in Visual and Post-Processing

  • High-Energy Glow & Bloom: I added a delicate Gaussian makeup of bloom to the accretion disk for it to appear as though it were made of high-energy plasma, which also emits light.
  • Tone Mapping: The high-contrast areas now remain visible as details rather than turning into glowing blobs.
  • Relativistic Asymmetry: The side of the disk facing the observer emits brighter light while the side moving away appears dimmed.
  • Dynamic Accretion Disk: The radial bands of plasma are animated now and flow smoothly around the horizon instead of appearing as an immovable ring.
  • Smooth Camera Movements The interactive camera movement allows to move it around incidentally without impacting on performance.
0
0
3
Open comments for this post

1h 13m 6s logged

BLACKHOLE SIMULATION

#Devlog-4

Hii everyone im back with more updates mueheheh! now this looks much more cooler than before ikik im so amazing and… nvm im being weird again lol! anywho! sooo i am using the ray tracer engine like before and i added some changes to the code to make it look even better like promised!

Photon ring

I added a glowing ring right around the event horizon, so the black hole pops even more!

Gradient update

Earlier in the code the whole colors looked blotchy but this time i made it look more seamless and better!

Cleaner Silhouette

you have to admit, this looks WAYYY cleaner than before and more cooler and yayyyy! im so hepy!! :much-screaming-cat:

Conclusion

So in the end we are getting more closer to the agenda of the IBM 1979 Luminet simulation, tho i would not wanna copy it whole since yk i wanna make this a bit of my own!

Agenda for next time

Make this look even more accurate since the physics engine is working phew

0
0
2
Open comments for this post

1h 25m 42s logged

BLACKHOLE SIMULATION

#Devlog-3

Alrighty everyone!sorry didnt post a devlog sooner, yk exams happened. ANYWAYS! i decided that the cereal looking wtv that was really pissing me off and besides looking at that thing was making me really demotivated so today i decided to change everything and instead of that weird thing i changed it to a ray tracer!

PHYSICS ENGINE UPDATE

the code previously only produced a flat ring, but now it looks like its bending light in the gravitational field. that means that its better than that cereal thing (yes i hated that with my whole heart, idk what made me think it looked cool).

COOL RETRO LOOK

it looks retro (inspired by luminets IBM supercomputer 1979 simulation yess) i know ball ikik.

conclusion

i fixed it a bit :p: :wilted-rose:

agenda

honestly idk atp lets see what happens :msn-brokenheart: (yes i discovered emojis on here js now dont judge me)
P.S this thing actually like “rotates” meaning that the dots you see move so like it looks sickk muehehe

0
0
21
Open comments for this post

1h 4m 22s logged

BLACKHOLE SIMULATION

#Devlog-2

Today I spent the day learning about the basic maths and fundamentals that i would need to understand how to simulate a black hole since i realized that my simulation rn doesnt look like a blackhole, and instead looks like im playing with cereal ngl.

Todays agenda was to understand the geometry and physics behind Black Holes and the math on a high school level understanding, enough to code a bit more accurately, i made a txt file in the Project Folder too so that i could keep track of all the things i understood.

THE MEANING BEHIND THE EQUATION

I used the Schwarzschild Metric equaiton (yes the brian greene one, i know its inaccurate) in this case, and understood basically how we measure intervals in 4D space, and understanding the coefficients in the equation, although its inaccurate considering black hole actually spins and the equation that Brian Greene had upoladed assumed it as a non spinning and uncharged sphere in space, but all i needed was to know the coefficients so that i could understand the Matrix

THE GEOMETRY

So basically in this part, in the video i watched, we used Metric Tensors to actually ploth the graph and to define the space-time warping, so that i could simulate the effects on the simulation when im coding

INTERSTELLAR CALCULATIONS

I used this too muehehe it was a ScienceClic video, couldnt understand much, thought about noting some equations down in my notebook but oh well, i dont think ill be using them, tho to approach the black hole and the simulation of it, i would need to ask AI since again im not a PhD level student and im dumbo too, but oh well im very ambitious so yeahh.

my next agenda would be to figure how to incorporate these infos and maths parts into the code to make it look more realistic and accurate, so probably ill be using books and AI to understand that!

Conclusion

  1. Learnt about the Schwarschild Equation
  2. Learnt about how we use the equation as a metric tensor to polt the space-time warping
  3. Learnt a bit about the calculations for the black hole in the movie Interstellar
  4. Made a txt file about it so that i could keep referencing it as i work
0
0
2
Open comments for this post

39m 28s logged

BLACKHOLE SIMULATION

#Devlog-1

Decided to start this project to appear cool, added the main physics part in the code, and had some progress :P will make it look more realistic next time for sure!

0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…