Physics Simulations

Physics Simulations

This page contains interactive physics simulations built with HTML5 Canvas and JavaScript.

Particle in a Box (2D)

This simulation demonstrates a quantum mechanical particle confined to a 2D box. The particle bounces elastically off the walls, maintaining constant kinetic energy.

Particles: 1 | Speed: 2.0 px/frame

Simulation Features

  • Elastic Collisions: Particles bounce off walls with perfect energy conservation
  • Particle Trails: Visual trails show the path history of each particle
  • Velocity Vectors: Lines extending from particles show their velocity direction
  • Interactive Controls: Reset, pause/resume, and add particles
  • Click to Add: Click anywhere on the canvas to add a new particle (max 10)

Physics Concepts

This simulation demonstrates several key physics principles:

Conservation of Energy

The total kinetic energy of the system remains constant as particles bounce elastically off the walls.

Quantum Mechanics Analogy

While this is a classical simulation, it represents the concept of a “particle in a box” - a fundamental quantum mechanical system where a particle is confined to a region of space.

Wave-Particle Behavior

The trail visualization helps illustrate how particle motion can create wave-like patterns over time, especially with multiple particles interacting with the boundaries.


Try clicking on the simulation canvas to add more particles and observe how they interact with the boundaries and each other!