Skip to main content
100%

Not an Ideal Gas

✓ Published0🌍 Public
PPhilippe Rivière
Last edited Nov 20, 2016
Created on Nov 19, 2016

A simulation of 800 particles in a box with a central gap shows how the mean squared velocity evolves over time, plotted as a line chart below. The gap’s aperture shrinks as the simulation cools, and clicking the canvas restarts the process. The code uses `d3.forceSimulation` with a custom `forceCollide` and `velocityDecay`, plus custom bounce and barrier forces. Rendering combines Canvas for the particles and a d3 `area` path on SVG for the speed trace.

AI-generated description

Trying to make sense of the energy parameters of a simple simulation. forceCollide tends to inject energy into the system, while velocityDecay() removes some.

So, when the density of dots is low, energy tends to decrease; if it's high, energy diverges.

forked from <a href='http://bl.ocks.org/Fil/'>Fil</a>'s block: <a href='http://bl.ocks.org/Fil/9264bfa00929b7ec762e21232baf7558'>Brownian Motion Constrained in Rectangle</a>

gpl-3.0 Licensed

Similar vizzes