AtomSim
Particle Count

For large particle counts, the simulation can be calculated first and only the final frame will be displayed.

Particle Count Guide

1 - 1,000 -- RUNS SMOOTHLY
1,000 - 3,000 -- A BIT LAGGY
3,000 - 10,000 -- GOTTA HAVE A GOOD COMPUTER
10,000+ -- HELL NAH, NASA COMPUTING TYPE SHIT

Orbit Controls Guide

Left Click + Drag -- Rotate
Scroll Wheel -- Zoom

AtomSim is a particle-based simulation designed to demonstrate how atoms can arrange themselves into different molecular geometries.

The Magic Numbers

If you take a look at the code, you'll find a few variables that are just set at a fixed value, or change overtime in a specific manner. I would like to state that, this is a very simplified version of simulation. That means we are not factoring in the little details about atoms, all the calculations and stuff that make things way more complex. So we solve this problem by setting some values ourselves, making sure its visually appealing and understandable. These values are what I call the "Magic Numbers".

Particles

Each red sphere represents a particle. The particles start at random positions around the central atom.

Repulsion

Every particle exerts a repulsive force on the other particles. Every frame, for each particle, force from every other particle exerted is calculated and added, giving the resulting force on that particle.

Movement

The forces change the velocity of each particle, which changes its position over time. The particles therefore move until the forces acting on the system become relatively small.

Connections

AtomSim detects if the particles have reached a stable configuration by checking distance travlleled for each particle. If any particle moves less than 0.01 units in a frame, it is considered stable and cylinders(connection lines) are drawn between the particle and the closest surrounding particles.

Normalisation

To simulate attraction between nucleus and particles so that particles don't fly away, the forces are normalised.

NOTE: This is not real life physics, as we cannot factor in multiple things and go very complex with the calculations, we use a simplified version of the physics to make it work in a way that is visually appealing and understandable.

Imagine a ball being rotated with a string. 100% normalisation means the string can never stretch, a 10% normalisation means a strecthy string . Normalisation is done by first calculating the distance of each particle from centre and depending if the particle is farther or closer than the radius set , a force is applied in opposite direction, which here is set to 10% of the force. If it is set at 100%, the particles will be constrained to a perfect sphere. The force being referenced here is the one being applied on the particle by other particles, in the direction parallel to its direction from centre.

Dampening

In real life, energy is lost as time passes. To simulate that, we multiply the velocity of each particle by a factor less than 1, which reduces the velocity of each particle over time. This is called dampening.

Calculating Simulation
Please wait...
0%