Prevent Particle Jamming in Matter.js Funnels

Simulating thousands of small circular bodies passing through a narrow funnel in Matter.js often leads to particle jamming, clustering, and performance bottlenecks. This issue occurs due to physical arch formation, friction, uniform particle sizing, and solver constraints within the physics engine. You can eliminate jamming and maintain smooth particle flow by introducing polydispersity, minimizing friction coefficients, optimizing funnel geometry, applying external agitation, and tuning the engine's solver parameters.

Introduce Particle Polydispersity

Monodisperse particles—where every circle has the exact same radius—naturally self-assemble into rigid, crystalline lattices. When approaching a bottleneck, these uniform structures form mechanical arches over the opening that block subsequent particles.

To prevent this:

Reduce Friction Parameters

Matter.js assigns default friction values that encourage sticking. When thousands of bodies exert pressure downward, standard friction values allow stable bridges to hold the weight of the particles above them.

Adjust the particle and funnel bodies with the following properties:

Optimize Funnel Geometry

The physical design of the constriction strongly influences whether particles funnel smoothly or form bottlenecks.

Implement Dynamic Agitation

Industrial hoppers rely on vibration to disrupt jams, and the same principle applies in Matter.js:

Tune Matter.js Engine Iterations

Simulating thousands of dynamic bodies pushes 2D physics engines to their limits, occasionally causing overlapping bodies or incorrect contact resolution that mimics jamming.