What This Model Shows#
The Gravitational Collapse model is a two-dimensional simulation of many particles moving under their own gravity. Depending on the initial setup, particles can clump, form a dense core, eject matter outward, and behave very differently when you change initial velocities, sticking, or damping.
This is an interactive learning model. It does not aim to reproduce a specific real astrophysical object exactly, but it is great for understanding:
- why a self-gravitating cloud can contract;
- how initial velocities slow down or reshape collapse;
- how rotation changes the global structure;
- why some particles can be ejected;
- how star-cluster encounters differ from gas-like clouds and "sticky" aggregates;
- why a numerical model may lose or drift energy in some modes.
The simulation is 2D, while real systems are 3D. Treat the model as an intuitive visual tool rather than a precise physical calculator.
How To Use It#
- Choose the number of particles.
- Choose an initial distribution.
- Choose initial velocities.
- Choose a matter mode.
- Press Start.
- Watch how the shape, density, energy, and the fraction inside the start area evolve.
The Start/Pause button is in the top-right of the simulation. The Restart button is next to it. Restart resets the system to the initial state, resets time, and stops the simulation.
Particle Count#
Particle count controls how large the system is.
Small N is good for tracking individual trajectories and close encounters. Large N is better for "cloud-like" behavior: core formation, ejections, tidal tails, and smoother large-scale structure.
What particle count affects:
- the total mass of the system (more particles, more total mass);
- the strength of collective gravity;
- visual smoothness of the cloud;
- computation cost;
- the gravity solver used (exact pairwise vs. accelerated approximation).
When N is small, gravity is computed directly for all pairs. When N is large, an accelerated approximate solver is used. You can see which method is active in the Solver field.
Seed#
The seed controls the random initial configuration.
With the same settings and the same seed, you get the same initial system again. This is useful for repeating an interesting scenario.
The Random button picks a new seed and regenerates the system.
What seed affects:
- initial particle placement;
- random components of velocities;
- small differences in how the system evolves over time.
Seed does not change the physics. It only changes the random "instance" of the initial conditions.
Initial Distribution#
Initial distribution sets where particles start.
Uniform Disk#
Particles start roughly uniformly inside a circular area.
This is a good default for learning collapse: with low velocities the cloud contracts, forms a denser center, and may eject some particles outward.
Dense Core#
Particles start more concentrated near the center.
This typically forms a dense core faster. Motion can become more intense: speeds rise sooner and energy drift may be more noticeable.
Use it to see how high initial density accelerates collapse.
Square Cloud#
Particles start inside a square region.
This is less symmetric than a disk, so it is useful to watch gravity "reshape" an unnatural geometry over time.
Ring#
Particles start in a ring-like region.
Depending on velocities, the ring may contract, fragment, and develop dense patches.
Two Star Clusters#
The system starts as two separate clusters: one in the lower-left part of the start circle, the other in the upper-right. The clusters move toward each other.
For this distribution the Velocities selector changes to cluster-encounter scenarios (instead of the usual presets).
Tip: for star clusters, No sticking is usually the most appropriate matter mode. Physical star-star collisions are rare, so sticky merging is not a realistic default for cluster encounters.
Initial Velocities#
Velocities define how particles move at the start.
For most distributions, four presets are available.
Cold Start#
Particles start with almost no motion.
Gravity quickly pulls the system inward. This is the cleanest "pure collapse" scenario.
Warm Noise#
Particles get small random velocities.
This acts like "temperature" and prevents an instant collapse. The motion is more chaotic and the cloud can remain more diffuse.
Rotation#
Velocities are tangent-like around the center.
This gives the system angular momentum. Collapse becomes less direct and more rotationally supported.
Expansion#
Velocities point outward from the center.
The cloud initially expands. Gravity may slow and recapture some particles; if expansion is strong enough, some matter escapes far outward.
Velocities For Two Star Clusters#
When Two Star Clusters is selected, the Velocities menu becomes a set of encounter scenarios.
These scenarios change:
- the approach speed of the clusters;
- the internal "dispersion" (random motion inside each cluster);
- the internal rotation strength.
Slow Merger#
Clusters approach more slowly.
This gives more time for tidal deformation and gradual capture/merging.
Stable Clusters#
Clusters have internal motion that helps them avoid collapsing instantly into themselves.
This is a balanced default for observing a cluster encounter.
Rotating Clusters#
Internal rotation is stronger.
This can produce more twisted structure, asymmetric tails, and clearer angular-momentum effects.
Fast Flyby#
Approach is faster.
Clusters may not fully merge. A close pass can scatter particles strongly, especially with non-zero side offset.
Side Offset#
Side offset appears only for the Two Star Clusters distribution.
It controls how "head-on" the encounter is.
- Near
0: almost head-on. - Higher values: more tangential, more total angular momentum, more likely to produce tails or a flyby-like interaction.
Side offset affects:
- encounter geometry (head-on vs. grazing);
- total angular momentum;
- likelihood and shape of tidal tails;
- whether clusters merge or pass through/around each other.
This parameter is locked while the simulation is running because it changes the initial conditions.
Matter Mode#
Matter mode defines what happens during close approaches.
No Sticking#
Particles interact only via gravity. They do not merge and do not directly lose speed.
This is the best mode for star systems and star clusters. It is also ideal for studying pure N-body dynamics: collapse, ejections, core formation, and energy exchange.
Gravitational Sticking#
Particles can merge when they are close enough and their relative speed is low enough.
When merging happens:
- mass adds up;
- velocity is computed to conserve momentum;
- the number of particles decreases;
- some mechanical energy is lost.
This is not a realistic model of star collisions. Think of it as a crude model of "sticky" aggregates (dust clumps, planetesimals, etc.).
Cloud Damping#
Nearby particles gradually reduce their relative velocities while conserving overall momentum.
This imitates cooling/viscosity in a gas-like or dusty cloud. It is not full fluid dynamics, but it helps visualize how random motion can be damped and how matter can settle into denser structures.
Sticking Settings#
These appear when Gravitational Sticking is selected.
Collision Radius#
Controls how close particles must be to be considered "colliding".
- Smaller value: merges are rarer and require closer approach.
- Larger value: merges happen earlier and aggregates grow faster.
Capture Threshold#
Controls how fast an encounter can be while still allowing a merge.
- Smaller value: only slow encounters merge.
- Larger value: faster encounters can merge too.
These physics controls are locked while the simulation is running.
Damping Settings#
These appear when Cloud Damping is selected.
Damping Strength#
How quickly relative velocities are reduced.
- Lower value: motion stays chaotic longer; cooling is weaker.
- Higher value: chaos dies faster; cooling is stronger.
Damping Radius#
How far to look for neighbors for damping.
- Lower value: damping is very local.
- Higher value: a wider neighborhood exchanges momentum.
Dense Regions Only#
When enabled, damping is weak in sparse regions and stronger where many particles are nearby. This is useful if you want damping to behave more like cooling of dense cloud regions rather than uniform "braking".
These physics controls are locked while the simulation is running.
Simulation Speed#
Simulation speed controls how fast model time advances.
Use lower speed to study close encounters, early collapse, and the first moments of a cluster collision. Use higher speed to reach the big-picture outcome faster.
If the system becomes very dense, lowering speed helps readability.
Particle Size#
Particle size changes only how large particles look on screen.
It does not change gravity or mass. Increase it for small N if particles are hard to see; decrease it for large N to avoid visual clutter.
Color By Energy#
When enabled, particle color depends on energy in a qualitative way:
- more tightly bound / lower-energy particles shift toward red;
- more energetic particles shift toward blue.
This makes it easier to see which particles become bound in the core and which gain enough energy to escape.
Color-Energy Gain#
This slider changes how sensitive the color mapping is. Higher values make more particles appear "blue" for the same energy distribution; lower values make the gradient more subtle.
When color-by-energy is disabled, all particles use a single base color.
Background, Grid, and Start Circle#
Invert Background and Grid#
Switches between dark and light styling. This does not affect physics.
Grid Contrast#
Controls visibility of:
- the grid;
- the start circle;
- the background gradient.
At zero contrast these elements disappear.
Hide Grid#
Hides the grid lines completely. Grid can be helpful for scale and motion; hide it if it distracts.
Start Circle#
The dashed circle marks the initial start area. It helps you see:
- how much the system contracted;
- how much mass stayed near the start area;
- how much matter escaped outward.
Zoom and Pan#
There is an auto-scaling camera and a manual camera mode.
When auto-scaling is enabled, the view follows the system and adapts to its size. When disabled, you can control view manually:
- the scale slider changes zoom;
- Ctrl + mouse wheel zooms around the cursor;
- drag with the left mouse button to pan.
Manual zoom/pan disables auto-follow so the view does not "snap back".
Metrics Under The Simulation#
The HUD under the simulation shows key system indicators.
Solver#
Shows the gravity calculation method:
- direct (more exact) for smaller systems;
- accelerated approximation for larger systems.
Total Mass#
Shows the total mass of the system.
In sticking mode, the visible particle count can decrease while total mass stays the same.
Energy Loss#
Shows how total mechanical energy changed relative to the start.
In ideal gravity without numerical effects, energy should be constant. In practice, energy can drift because of finite time steps, approximations, and intense close encounters. In sticking and damping modes, energy loss is also part of the chosen physical behavior.
Mean Radius#
Represents the typical distance of mass from the center.
If it decreases, the system contracts. If it increases, the system expands or ejects a lot of matter outward.
Max Speed#
Speed of the fastest particle. Sharp spikes often indicate close encounters or ejections.
Inside Start Circle#
The fraction of mass that remains inside the initial start circle. If it drops, more mass has moved outside the initial region.
Recommended Scenarios#
Basic collapse#
- Distribution: Uniform disk
- Velocities: Cold start
- Matter mode: No sticking
Initial temperature comparison#
Run the same distribution and seed with Cold start and Warm noise to see how random motion changes collapse.
Role of rotation#
- Distribution: Uniform disk or Ring
- Velocities: Rotation
- Matter mode: No sticking
Gas-like cooling#
- Distribution: Dense core or Uniform disk
- Velocities: Warm noise
- Matter mode: Cloud damping
Aggregate growth#
- Distribution: Uniform disk
- Velocities: Cold start or Warm noise
- Matter mode: Gravitational sticking
Star cluster encounter#
- Distribution: Two star clusters
- Velocities: Stable clusters, Rotating clusters, or Fast flyby
- Matter mode: No sticking
- Side offset: low (head-on) to higher (grazing / flyby)
Keep In Mind#
This model is designed for intuition and exploration, not exact astrophysical prediction.
Key limitations:
- the simulation is 2D;
- units are not real-world calibrated;
- close encounters are smoothed;
- large
Nuses an approximate solver; - sticking is for aggregates, not stars;
- damping imitates cooling but is not full hydrodynamics.
The best way to learn is to change one parameter at a time and compare outcomes.
