Pere Rosselló Profile Banner
Pere Rosselló Profile
Pere Rosselló

@PeRossello

Followers
5,653
Following
41
Media
95
Statuses
415

Astrophysics student at Universidad de La Laguna, Tenerife (Spain). All media posted here is my own (unless otherwise stated).

Joined February 2023
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@PeRossello
Pere Rosselló
1 year
A few three body periodic orbits
50
495
2K
@PeRossello
Pere Rosselló
4 months
Disruption of planetary rings on close encounter
24
743
4K
@PeRossello
Pere Rosselló
5 months
Gravitational collapse of SpongeBob You can see how Virial equilibrium is eventually reached
56
554
3K
@PeRossello
Pere Rosselló
7 months
Gravitational Lensing for a Singular Isothermal Sphere using Inverse Ray Tracing
27
335
2K
@PeRossello
Pere Rosselló
8 months
A million particles in a Navarro-Frenk-White potential
28
303
2K
@PeRossello
Pere Rosselló
4 months
N-body problem and the Barnes-Hut algorithm: visualizing the quadtree spatial partitioning that cuts complexity from O(N²) to O(N logN) through hierarchical force approximation
15
225
2K
@PeRossello
Pere Rosselló
6 months
Ray Tracing meets General Relativity: Generating Images with Redshift through a Schwarzschild Black Hole
14
195
1K
@PeRossello
Pere Rosselló
6 months
Cosmological Simulation: Structure formation in a 50 Mpc/h cube with ~2 million dark matter particles.
29
210
1K
@PeRossello
Pere Rosselló
5 months
Spent some time trying to make a decently fast N-body simulator in python
35
70
767
@PeRossello
Pere Rosselló
8 months
Fractal Basins arising from Gravitational Potential
8
111
741
@PeRossello
Pere Rosselló
7 months
Gravitational Collapse of a Dark Matter Sphere
20
88
637
@PeRossello
Pere Rosselló
7 months
Spectrograms with Python (🔊)
22
115
634
@PeRossello
Pere Rosselló
4 months
Testing Numerical Schemes for Fluid Dynamics: How the Lax-Friedrichs scheme fails to conserve the angular momentum of a vortex
2
76
611
@PeRossello
Pere Rosselló
4 months
Code released for toy N-body simulator: convert any image into N-bodies and let them gravitate
12
83
613
@PeRossello
Pere Rosselló
7 months
The importance of using symplectic (energy conserving) integrators in numerical orbital mechanics.
16
98
601
@PeRossello
Pere Rosselló
6 months
Solving Geodesics: The Curvature and Redshift of Light Beams in the Vicinity of a Black Hole
9
96
579
@PeRossello
Pere Rosselló
9 months
A million particles in a Miyamoto-Nagai potential
14
91
537
@PeRossello
Pere Rosselló
4 months
Equipotential Surfaces on a Three-Body Periodic Orbit Made with python and matplotlib. Code at
10
79
541
@PeRossello
Pere Rosselló
6 months
I am thinking of making a video series on an Introduction to Physics and Math Animation with Blender. The plan is to do everything through Python Scripting. Maybe 4 to 5h of content: cover the basics, optimal set up, defining typical functions for math/physics stuff, making
49
39
496
@PeRossello
Pere Rosselló
8 months
@Rainmaker1973 Author of the gif here. I really like you content @Rainmaker1973 , but it would be greater if you could give credit!
19
14
421
@PeRossello
Pere Rosselló
8 months
This is the first ever periodic solution found for the Three-Body Problem. It was discovered by Leonard Euler in 1767 after imposing the condition of collinearity: the three bodies must remain at all times in a straight line.
6
37
292
@PeRossello
Pere Rosselló
6 months
This is a movie from 1960 of the first ever computer-made N-body simulation of a galaxy The galaxy was modeled with only N=116 bodies, they used RK4 for integration, and the whole thing took 15 hours of computing time.
6
42
271
@PeRossello
Pere Rosselló
6 months
Bach's Cancrizans Spectrogram in Python 🔊 A time-symmetric piece of music where the left hand (blue) is the right hand (red) played in reverse. The melody is identical when played backwards.
5
50
264
@PeRossello
Pere Rosselló
7 months
A few hundred gravitational lenses over an image of the Sun (left), and the resulting magnification map (right)
3
22
204
@PeRossello
Pere Rosselló
6 months
Magnetic Bottles: The Fundamental Principle behind Plasma Confinement in Fusion Reactors
3
30
195
@PeRossello
Pere Rosselló
9 months
Rayleigh-Bénard convection modes for a fluid cell heated from below.
2
20
198
@PeRossello
Pere Rosselló
7 months
Simulating the Universe: A Cosmic Web of Galaxy Clusters
7
32
198
@PeRossello
Pere Rosselló
5 months
N-body simulation made with Python, parallelized with numba, and animated with matplotlib. N=100.000. Computation time around 5h for 2.000 steps. Around 1s of compute time per step. Collisions are handled with a softening length. Code will be on my github, eventually
Tweet media one
10
9
181
@PeRossello
Pere Rosselló
7 months
Fractals arising from orbits and platonic solids
2
27
168
@PeRossello
Pere Rosselló
8 months
Nice periodic orbits in a fixed two-body gravitational potential
1
28
169
@PeRossello
Pere Rosselló
8 months
An spectrogram is a good pictorical representation of the harmony of a song. This is one I made with python-matplotlib for 'Besalú' (a song from my brother). It makes a good present when printed on an aluminium plate.
Tweet media one
Tweet media two
12
26
169
@PeRossello
Pere Rosselló
9 months
Just ramped up my toy Milky Way model to 100.000 stars.
6
11
134
@PeRossello
Pere Rosselló
4 months
A Milky Way-like Galaxy but the Dark Matter Halo Suddenly Disappears
8
12
132
@PeRossello
Pere Rosselló
4 months
Simulated with Python. Animated with Blender. The mass ratio between planets is 3 to 1 (blue is more massive) and the pass by occurs during the close encounter of a highly eccentric elliptic orbit. Each planet has a ring system of about 20.000 particles which are set to have
4
5
128
@PeRossello
Pere Rosselló
7 months
Basin boundary fractals for a figure eight orbit
3
20
125
@PeRossello
Pere Rosselló
8 months
@Rainmaker1973 Yes, that's me. I understand the source is not very clear. You can see the original is my pinned tweet :)
1
3
90
@PeRossello
Pere Rosselló
7 months
Code: I tried to make it easily customizable. Some examples here (one printed on aluminium plate):
Tweet media one
Tweet media two
Tweet media three
Tweet media four
1
3
85
@PeRossello
Pere Rosselló
9 months
A Toy Model of the Milky Way Orbital simulation of ~10.000 Milky Way stars using data from @ESAGaia . Red, blue and dim purple stars correspond roughly to the bulge, disk and halo. Integration of the orbits with gala python package ( @adrianprw ). Animated with @matplotlib .
3
15
79
@PeRossello
Pere Rosselló
8 months
These two solutions, Euler's and Lagrange's, remain the only two solutions of the three-body problem for which an analytical solution is known. Currently thousands of other solutions have been found, like this one from R. Brooke, but numerical methods are required to find them.
5
11
81
@PeRossello
Pere Rosselló
7 months
Galaxy mergers Dark matter in purple. Stars in blue.
2
6
70
@PeRossello
Pere Rosselló
1 year
@PabloIglesias Puede alguien dar una definición de fascismo aplicable en este contexto? Que no sea 'todo aquello que no se alinea con mis ideas' si puede ser.
5
2
70
@PeRossello
Pere Rosselló
8 months
And this is the second, by Joseph-Luis Lagrange (1772). He found it after imposing the condition that all three bodies must remain at he vertices of an equilateral triangle at all times.
2
6
70
@PeRossello
Pere Rosselló
8 months
@Rainmaker1973 Well Wikipedia makes you make a request for username change. I guess that proves it. It should appear under my current twitter handle in Wikipedia after the request is satisfied.
Tweet media one
2
3
64
@PeRossello
Pere Rosselló
1 year
@theAlbertChern Proof for a 2x2 matrix
Tweet media one
1
4
64
@PeRossello
Pere Rosselló
6 months
Slowly building an astro-ray tracer. Here is a K-type star (a bit colder than the Sun) with procedurally generated star-spots and showing the limb-darkening effect. Python only.
7
7
64
@PeRossello
Pere Rosselló
5 months
Genuine question: Why isn't there a dedicated platform to share, rate, and discuss introductory notes on STEM subjects? (Long post) What I am reffering to is like a digital ecosystem where students, self-learners, teachers, etc. can freely share and discuss their notes with
15
2
59
@PeRossello
Pere Rosselló
5 months
Here N=50.000. I relied on numba for parallelization. With 12 cores It took ~1h to integrate 1000 time-steps. No tree algorithm used yet, so complexity is O(N²). I see myself migrating to C++ in the long term for this stuff.
Tweet media one
11
2
51
@PeRossello
Pere Rosselló
4 months
N=20,000 in the simulation above (2D). The Barnes-Hut algorithm (1986) reduces complexity by approximating distant particle effects as single mass points by means of the quadtree spatial division. The darker side of the algorithm is that the force computation becomes
4
5
39
@PeRossello
Pere Rosselló
8 months
In about 4 billion years, the Sun will reach the peak of its Red Giant phase, expanding to ~250 times its current radius and engulfing the inner planets in the process.
2
12
37
@PeRossello
Pere Rosselló
6 months
Each particle is roughly representative of a small galaxy, with a mass of 5.1 billion solar masses. This is example simulation DM-L50-N128 from Gadget-4. Animated with Blender.
3
2
37
@PeRossello
Pere Rosselló
9 months
10 billion years for a Sun-like star. Everything stable till Hydrogen runs out in the core. Then the Helium core contracts and heats up. Radius and luminosity increase exponentially. The star turns into a Red Giant.
0
1
30
@PeRossello
Pere Rosselló
4 months
Gravitationally collapse yourself or whatever you want. When time-reversed (like above) it makes for good logos. It can also be used for non silly purposes. Examples with different softening lengths and circular velocities.
3
2
34
@PeRossello
Pere Rosselló
9 months
Synthetic Galaxies
1
4
30
@PeRossello
Pere Rosselló
4 months
Animation made with matplotlib, blender, and a bit of manim. Also, kind of my first fluid dynamics simulation. The simulation is of an inviscid perfect gas. The initial conditions are those of a Gresho vortex [1], which is a useful test case to check numerical schemes. Ideally,
5
0
29
@PeRossello
Pere Rosselló
1 year
@fermatslibrary However, we do know what was the last line of calculations that he wrote. Source: Einstein: His Life and Universe, by Walter Isaacson
Tweet media one
0
3
28
@PeRossello
Pere Rosselló
1 year
@fermatslibrary Solar mass ≈ 2*10³⁰ kg Proton mass ≈ 1.7*10⁻²⁷ sqrt((1.7*10⁻²⁷)*(2*10³⁰)) ≈ 58 kg
1
1
24
@PeRossello
Pere Rosselló
8 months
@RBehiel @memecrashes I had my 'aha' moment with this when I saw somewhere that this identity for the generator of rotations in 2D, J, is identical to Euler's identity for i.
Tweet media one
0
0
25
@PeRossello
Pere Rosselló
4 months
2
0
25
@PeRossello
Pere Rosselló
6 months
The idea is to only post my simulations in this account, but I felt this was cool and niche enough to be shared. I say 'computer-made' because, amazingly enough, the first one was actually performed mechanically with light bulbs as bodies to use their radiation flux as a proxy
3
2
24
@PeRossello
Pere Rosselló
6 months
Mixed and interpreted on guitar by my brother (Sebastià Gris on spotify). The left hand is played an octave lower, so the spectrograms don't exactly overlap. Made with python and matplotlib. Check the code at:
0
0
22
@PeRossello
Pere Rosselló
9 months
Why some seasons are longer than others?
3
5
22
@PeRossello
Pere Rosselló
3 months
@hardly_knower_ Use sympy package in python. Free and same functionality as mathematica for symbolic stuff
1
0
22
@PeRossello
Pere Rosselló
7 months
For those wondering where the pattern comes from, each frame is generated by color-coding which body is hit when releasing test particles at rest in a grid. It’s basically a 2D map of which ‘planet’ would an ‘asteroid’ hit if released from (X, Y).
1
0
22
@PeRossello
Pere Rosselló
6 months
*Technically, it's blueshift when photons are moving towards the Black Hole and redshift when they're heading away from it. First time doing numerical GR so I just hope I didn't mess it up. Made with python (numpy and matplotlib)
2
3
19
@PeRossello
Pere Rosselló
7 months
Broucke R4
1
3
20
@PeRossello
Pere Rosselló
9 months
Evolution of a 7 solar-mass Star
1
2
19
@PeRossello
Pere Rosselló
6 months
Finally: made with Python and animated with Blender. Code will be published as a response to this post whenever I clean the original mess that got it working.
2
0
17
@PeRossello
Pere Rosselló
8 months
I may publish the code in the future, but now is way too messy. Also, so far it works properly only for solo-instrument songs. Also, the song:
0
1
19
@PeRossello
Pere Rosselló
1 year
@memecrashes unaccurate
0
0
18
@PeRossello
Pere Rosselló
8 months
The study of fractal basin boundaries, [pioneered by James A. Yorke], is the study of systems that could reach one of several nonchaotic final states, raising the question of how to predict which (Chaos, James Cleick). Inspired by:
1
4
18
@PeRossello
Pere Rosselló
6 months
This one was a bit of a challenge. To generate the image on must first integrate three coupled differential equations *for each pixel* to get the goedesics of the photons. This is very computationally expensive. The approach is just like in this previous simulation.
2
1
17
@PeRossello
Pere Rosselló
1 year
@DerickZill @Rainmaker1973 Three bodies interacting gravitationally usually leads to chaos and unpredictability. However for very precise initial conditions and mass ratios, researchers have found special periodic solutions. Most of these are unstable, meaning that little perturbations mess up the order.
2
0
18
@PeRossello
Pere Rosselló
4 months
Regarding the specifics of the code: Code is pure python. numba is used for parallelization. Animations with matplotlib. Data storage as .hdf5 files. The N-body simulator is brute-force and straightforward, with O(N²) force computations per time step. It is not too bad. In my
2
0
17
@PeRossello
Pere Rosselló
1 year
Ocean Circulation on Azimuthal Equidistant Projection
1
3
16
@PeRossello
Pere Rosselló
6 months
The other tricky thing I did not know was going to be a challenge was redshifting RGB colors. After many blunders what I did was to assume each pixel is like a LED display, with three lightbulbs (red, green and blue) shinning at different intensities to get all the colors. Then
Tweet media one
2
1
15
@PeRossello
Pere Rosselló
7 months
At high z, the expansion of the universe was much faster. This, explains why the original sphere does not collapse like the one we simulated a few days ago. Dark energy prevents it! And filaments and galaxy clusters can form.
@PeRossello
Pere Rosselló
7 months
Gravitational Collapse of a Dark Matter Sphere
20
88
637
0
1
15
@PeRossello
Pere Rosselló
4 months
The galaxy is modeled with 50k baryonic matter particles following a 5 kpc exponential disk distribution with a total mass of 5e10 M☉. The dark matter halo is not implemented as particles but as a continuous spherical density field following a Navarro-Frenk-White profile, with
4
1
17
@PeRossello
Pere Rosselló
1 year
Deterministic non periodic flow. Next video will be on the original physics behind the Lorenz attractor.
0
2
15
@PeRossello
Pere Rosselló
8 months
@nik_greenwall The gravitational potential defines the dynamical evolution of the system, setting the force felt by each particle, which only depends on their position. Time evolution is found by integrating Newton's second law, which here takes the following form:
Tweet media one
0
1
17
@PeRossello
Pere Rosselló
5 months
@pronounced_kyle Thanks for the shoutout!
0
0
14
@PeRossello
Pere Rosselló
7 months
Little repository for doing this animation. It's a fragment of code I've quickly split from an ongoing N-body package I am trying to build, so it may not be very readable. @pawjast @AddySmith4
1
2
15
@PeRossello
Pere Rosselló
6 months
Also, the idea is to dub it in Spanish as well.
0
0
14
@PeRossello
Pere Rosselló
7 months
By Dark Matter we mean that particles are collisionless, i.e., no clumping into things and forming stars and stuff like the matter we know.
1
1
15
@PeRossello
Pere Rosselló
8 months
@drg137 Thanks :) I posted it as a short a while ago in my YT channel (link in bio). Hope that works!
1
1
15
@PeRossello
Pere Rosselló
7 months
Here is the code if you want to generate yours. Improvement involving efficiency are most welcome!
0
0
13
@PeRossello
Pere Rosselló
7 months
The only force at play is newtonian gravity, which we modify by adding a softening length, ε. This way we avoid numerical instabilities due to divergent forces when two particles get to close together. Figure: Newtonian force in solid-black, modified force in dashed-black.
Tweet media one
2
1
14
@PeRossello
Pere Rosselló
4 months
It is appearing to you in HQ or low quality compressed? To me in latpop it loads in HQ, but looks crap on twitter phone.
6
0
12
@PeRossello
Pere Rosselló
6 months
This is a demo: a first approach. It was made from scratch, and I guess there are tools to get it done faster and better out there. However, I will probably refine it and have a bit more fun with it. I feel this may be even worth an in depth youtube video. Also, it would be
2
0
11
@PeRossello
Pere Rosselló
8 months
@eigenbros Python. Libraries: matplotlib for animation, and gala for dynamics.
0
1
13
@PeRossello
Pere Rosselló
6 months
0
0
14
@PeRossello
Pere Rosselló
8 months
@Andercot Oh thanks! This really motivates me to find time to do more of this stuff ✨
2
0
12
@PeRossello
Pere Rosselló
6 months
Finally, the confinement methods used in actual fusion reactors are obviously way more complex. A Tokamak configuration, a most popular choice, confines plasma (ionized particles) in a toroidal ring. But the fundamental principle remains the same: that of a magnetic mirror.
Tweet media one
1
0
11
@PeRossello
Pere Rosselló
6 months
Simulated with Python. Animated with Blender. Code repository at: And I would like to credit this little jupyter notebook, which really helped for the initial set up:
0
1
12
@PeRossello
Pere Rosselló
4 months
@JavierDiaz_02 Pero las gallinas que entran por las que salen sería ∇J = 0, y ∇J + ∂ₜρ =0 algo como las gallinas que salen son las que pierdo
1
0
12
@PeRossello
Pere Rosselló
7 months
Here is how they come up: - Each vertex has a mass and a color - Circumscribe a sphere and place there test particles - Let the particles orbit the vertices - Color-code original position with the color of the vertex they hit An animated explanation here:
1
1
10
@PeRossello
Pere Rosselló
1 year
A colorful mess of orbits in a tetrahedron configuration
0
4
8