Open Physics Sims, a shared library for teaching

Simulations you can read.

Interactive physics for the classroom, each one a single file with the model written out in plain code. Nothing to install, no accounts, no cookies, and each file works offline. Open it, hand it to students, or download it and keep it.

44 simulations

Forces & momentum

The bouncing ball stack

Drop a tennis ball sitting on a basketball and it flies three times as high as it started. Swap in real balls, stack a tower whose top ball can leave at many times the speed it fell, slow the bounce down to a thousandth of a second, and turn the stack upside down.

Introductory. collisions, momentum, coefficient of restitution, basketball and tennis ball
Fluids

Pressure in fluids

Fill four very differently shaped vessels to the same depth and find the same pressure at every bottom. Suck on a 14 m straw and see why the air can push water no higher than 10 m, then watch the pressure on a block's faces add up to the buoyant force that floats it.

Introductory. pressure, hydrostatic pressure, hydrostatic paradox, Pascal's vases
Astronomy

Blackbody radiation and the colors of stars

Heat a body from skin temperature to a blue-white star and watch its glow slide across the spectrum and change color. Measure stars' temperatures through blue and yellow filters as astronomers do, then see how Betelgeuse, cooler than the Sun, outshines it by sheer size.

Introductory. blackbody radiation, Planck, Wien's law, Stefan-Boltzmann law
Thermodynamics

Entropy and microstates

Pull the partition out of a box of colliding molecules and see why they never gather back by themselves. Watch two solids trade packets of energy one at a time until their temperatures match, then reverse every molecule's velocity and see a nudge of a billionth undo the return.

Introductory. entropy, microstates, second law of thermodynamics, Boltzmann
Oscillations & waves

Fourier: building waves

Add sine waves one harmonic at a time and watch them build a square, triangle or sawtooth wave, overshoot at every jump included, and hear the tone change. Draw any shape and see which harmonics it takes, then shorten a beep until its pitch dissolves into a spread of frequencies.

Introductory. Fourier series, harmonics, square wave, Gibbs phenomenon
Astronomy

Gravitational lensing

Watch light bend around the Sun, a black hole, a galaxy and a galaxy cluster, with real masses and distances. Drag a background galaxy behind the lens and see it stretch into arcs, an Einstein ring or an Einstein cross; then watch a star brighten for a few weeks as another passes in front, with a spike if the lens star has a planet.

Introductory. gravitational lensing, Einstein ring, Einstein cross, general relativity
Oscillations & waves

The Doppler effect

Hear an ambulance's pitch drop as it drives past, and see why in the crowded and stretched wave crests. Push a jet past the speed of sound to make a shock cone and a sonic boom, compare a moving listener with a moving source, then watch hydrogen's lines in a star's or galaxy's light shift toward the red.

Introductory. Doppler effect, sound, pitch, frequency
Optics

The Michelson interferometer

Slide a mirror a fraction of a micrometer and watch rings stream out of the center, one for every half wavelength. Let air into a cell in one arm and count the rings as the light slows, then see LIGO's 4 km version catch the 2015 gravitational wave from two merging black holes.

Introductory. Michelson interferometer, interference, fringes, wavelength
Rotation

Gyroscope precession

A spinning wheel on the end of an axle, held up at only one end, swings slowly around instead of falling. Let it go and watch it dip and bob before it settles, then follow the angular momentum and torque arrows to see why a spinning wheel turns sideways when gravity pulls it down.

Introductory. gyroscope, precession, nutation, angular momentum
Electricity & magnetism

Radio waves

Jolt, wiggle or drag a charge and watch a kink in its field lines race outward at the speed of light: that kink is the wave. Then watch field loops pinch off an antenna and push the electrons in a receiver a few meters away, which only responds if it points the right way.

Introductory. radio waves, electromagnetic waves, radiation, accelerating charge
Modern physics

Stern–Gerlach: spin

Silver atoms fly one at a time through a magnet and land in two spots, not the smear tiny compass needles would make. Then chain magnets at any angles, block beams, and watch measuring along x erase what was learned along z, with the split following cos²(θ/2).

Intermediate. spin, Stern-Gerlach, quantum measurement, magnetic moment
Forces & momentum

Atwood machine

Hang two masses over a pulley and let go: the heavier side falls with a steady acceleration, set by the difference in weight over the total mass. Then give the pulley some mass and watch the acceleration drop and the tensions on the two sides pull apart.

Introductory. Atwood machine, pulley, tension, acceleration
Forces & momentum

Ballistic pendulum

Fire a projectile into a hanging block and watch the pair swing up. Momentum carries through the collision and energy carries through the swing, so the height of the swing gives back the projectile's speed, just as the device was first used in 1742 to measure the speed of musket balls.

Introductory. ballistic pendulum, momentum, inelastic collision, conservation of energy
Modern physics

Quantum tunneling

An electron meets a barrier taller than its energy, and part of its wave gets through. See the wave decay inside the barrier, watch a wave packet split in two, and see why a tunneling microscope can image single atoms and why alpha-decay half-lives range from a microsecond to billions of years.

Intermediate. tunneling, wave function, Schrodinger equation, barrier
Forces & momentum

Colliding carts

Two lab carts collide with magnetic, spring, rubber or Velcro bumpers. Watch the bumpers squeeze in slow motion, with equal and opposite forces, while the momentum bars trade off and the kinetic energy drains into the bumpers and back, or into heat. A second view rides along with the center of mass, where every collision looks the same.

Introductory. momentum, collisions, elastic, inelastic
Rotation

Turning frames: the Coriolis effect

A puck slid across a spinning merry-go-round, seen at once from above and from the platform: straight over the ground, curved on the platform. Play catch with a friend across the platform and miss until you aim off, then watch the centrifugal and Coriolis forces a rider needs to explain the curve.

Introductory. Coriolis, centrifugal, rotating frame, fictitious forces
Electricity & magnetism

Electromagnetic induction

Move a magnet through a coil and watch the flux and the emf graphed in real units, then measure how the peak emf depends on speed and turns. Pull a rod along rails in a magnetic field to find its terminal speed. Then predict which way the current in a loop will flow as you move a magnet or the loop, and check your reasoning against Lenz's law, step by step.

Introductory. Faraday's law, Lenz's law, induction, flux
Optics

Polarized light

Watch the electric field of a light wave as it passes through polarizers, reflects off water as glare, and goes through quarter- and half-wave plates. Record a light meter to find Malus's law, the three-polarizer surprise, Brewster's angle, and why many small turns pass almost all the light.

Introductory. polarization, Malus's law, polarizer, Brewster's angle
Forces & momentum

The fastest slide

Bend a wire and race a bead down it against the straight line and your own best try: the shortest path is not the fastest. Then drag the end point and watch the cycloid, traced by a rolling circle, fit between the two points and beat every rival, Galileo's circular arc included.

Introductory. brachistochrone, cycloid, energy conservation, calculus of variations
Rotation

Torque and rotational inertia

A cross with four sliding masses, spun by a hanging weight on a step pulley, like the classic lab apparatus. Change the pulley to change the torque, slide the masses to change the rotational inertia, race two wheels with the same mass in different places, and measure I from the slope of angular acceleration against torque.

Introductory. torque, rotational inertia, moment of inertia, angular acceleration
Oscillations & waves

Damped, driven oscillator

A mass on a spring, slowed by a paddle in liquid and shaken by a motor. Watch swings die away and find critical damping, see the mass move with the motor, lag it by a quarter cycle, then oppose it, and build the resonance curve point by point as the motion settles.

Introductory. damping, critical damping, driven oscillator, resonance
Astronomy

Finding exoplanets

Watch a star dim as a planet crosses it and wobble as the planet tugs on it, with data as noisy as the real thing. Find out why Earth-size planets are so hard to see, then measure a mystery planet's orbit, size and mass from its light curve and Doppler shifts, and decide whether it is rocky or gas-rich.

Introductory. exoplanets, transit method, radial velocity, Doppler shift
Forces & momentum

Pulling a crate

Pull a crate with a rope at an angle and watch the pull split into components: one drags it forward, the other lifts on it and lightens the load on the floor. Find the angle that starts it moving with the least force, then add a second rope and combine the pulls as vectors.

Introductory. vector components, normal force, friction, free-body diagram
Forces & momentum

A crate on a ramp

Push a crate up or down a ramp, or let it go and see whether it slides. A free-body diagram shows static friction holding until it can't, energy bars show your work turning into motion, height and heat with the books always balancing, and a mystery crate challenges you to measure both friction coefficients.

Introductory. inclined plane, friction, static friction, kinetic friction
Modern physics

The photoelectric effect

Shine light on a metal in a vacuum tube and watch for electrons. Find the color below which no brightness will do, stop the fastest electrons with a battery, measure Planck's constant from your own stopping voltages, and identify a mystery metal by its work function.

Introductory. photoelectric effect, photons, work function, stopping voltage
Optics

Thin-film interference

A draining soap film, an oil slick, a coated lens and an air wedge, each colored by the daylight it actually reflects. A probe shows the two reflected waves falling into and out of step, and the half-wave flips that decide why the top of a soap film turns black just before it bursts.

Introductory. interference, thin films, soap film, phase change on reflection
Oscillations & waves

Standing waves

Shake one end of a string, or play a tone into a pipe, and hunt for the frequencies where it suddenly comes alive. Nothing is marked in advance: each settled measurement goes on a graph, so the harmonics at nv/2L, and the missing even harmonics of a closed pipe, turn up as you find them.

Introductory. standing waves, resonance, harmonics, normal modes
Modern physics

Moving clocks and the twin paradox

Light clocks on a platform and a passing train, with a switch to ride either one: each observer finds the other's clocks slow and short. A toggle shows why length contraction is forced. Then the twin paradox, told with birthday flashes, from Earth's frame and then the traveler's: when he turns round, his 'now' on Earth jumps forward 12.8 years.

Introductory. special relativity, time dilation, length contraction, simultaneity
Thermodynamics

Heat engines on a PV diagram

Run Carnot, Otto, Stirling and Brayton cycles beside a piston, with the work of each leg shaded as the area under it and the net work as the area the loop encloses. Or build your own cycle leg by leg, and find that the internal energy always returns to where it started while the work and heat depend on the route.

Introductory. PV diagram, first law, heat engine, efficiency
Electricity & magnetism

Magnet falling through a copper tube

Race one magnet down copper, aluminum, brass and slotted copper tubes, then ride along inside the wall to see the induced currents circling above and below it. The drag model has no fitted constants and reproduces a published measurement: two stacked discs fall more slowly than one or three.

Introductory. Lenz's law, eddy currents, induction, terminal velocity
Rotation

Angular and linear velocity

Drag a ladybug anywhere on a spinning turntable. Every point shares one angular velocity, but the speed each point travels at grows with the radius. Velocity and centripetal acceleration arrows on fixed scales, with both plotted against radius so the slopes are omega and omega squared.

Introductory. angular velocity, tangential speed, centripetal acceleration, period
Astronomy

Newton's cannonball

Fire a cannon horizontally from a mountain above the air, harder and harder, and leave the shots on the screen to build Newton's family of curves. The path is the exact conic throughout, so you can watch the impact point race away, the perigee rise above the ground before circular speed is reached, and the ellipse finally refuse to close at escape speed.

Introductory. orbits, gravitation, escape speed, Kepler
Electricity & magnetism

Charged particle in electric and magnetic fields

Four screens on one idea: a magnetic field turns a charge without doing work. Circular orbits whose period ignores speed, a crossed-field speed filter, isotope separation on a detector, and a cyclotron that falls out of step when you detune it.

Intermediate. magnetic force, velocity selector, mass spectrometer, cyclotron
Forces & momentum

Forces in one dimension

Push a crate while the graphs build up underneath, and watch the force trace look nothing like the velocity trace. A second screen plots friction against your push, showing the diagonal static region, the break-free point, and the flat sliding value that explains the lurch.

Introductory. Newton's laws, friction, free-body diagram, acceleration
Electricity & magnetism

Gauss's law

Drag charges and drag a closed surface while the flux is measured piece by piece around the boundary and compared with the charge enclosed over epsilon-zero. Move a charge outside and the total falls to zero while the field does not.

Intermediate. electric flux, field lines, symmetry, line charge
Modern physics

How a laser works

One atom first: absorption, spontaneous emission, and stimulated emission making a copy of the photon that caused it. Then a tube of atoms between mirrors, where a two-level scheme can never lase, three levels need a hard push, and four levels light up easily.

Intermediate. stimulated emission, population inversion, threshold, optical cavity
Kinematics & frames

River crossing

A boat crosses a flowing river. Set its heading and watch the two velocities add: fastest crossing, landing straight across, or least drift when the current wins. A water-frame view straightens the path.

Introductory. relative velocity, vector addition, reference frames, optimization
Forces & momentum

Rocket staging

Build the same 500 metric ton rocket as one stage or two and see why one cannot reach orbit. Mass diagram, per-stage delta-v, and a speed trace with staging marked, with gravity losses on or off.

Intermediate. rocket equation, variable mass, momentum, orbital velocity
Rotation

Rolling race

A hoop, disc, sphere, hollow sphere and sliding block race down the same ramp. Energy bars show how much each one has to put into spinning, which is exactly the order they finish in. Mass and radius change nothing.

Introductory. moment of inertia, rotational energy, rolling without slipping, inclined plane
Rotation

Static equilibrium

A plank on two supports, a ladder against a smooth wall, and a boom held by a cable. Forces are solved and drawn, torque bars show the balance about any point you choose, and the force polygon closes.

Introductory. torque, free-body diagram, ladder problem, reaction forces
Kinematics & frames

Ballistics cart

A cart fires a ball straight up while rolling at constant speed, while accelerating, and while rolling down a ramp. Switch to the cart's frame and watch the parabola straighten out.

Introductory. projectiles, reference frames, relative motion, inclined plane
Astronomy

Orbital resonance

Three screens: where conjunctions land for a given period ratio, how repeated kicks pump a circular orbit into an ellipse, and how gaps carve themselves out of a belt of test bodies.

Intermediate. orbits, Kepler, Kirkwood gaps, Pluto
Solids & semiconductors

p-n junction diode

Dope each half of a bar, connect a battery, and watch electrons and holes drift, cross the junction and recombine. A band diagram and an I-V curve track the same carriers in energy.

Intermediate. semiconductors, band diagram, doping, depletion region
Forces & momentum

Walking on a boat

A person walks the length of a floating boat. Without drag the boat slides back and stays; with linear drag it drifts home while the center of mass moves. Both cases side by side with x(t) plots.

Introductory. center of mass, momentum, drag, impulse

What this is

A library of interactive simulations for introductory and intermediate physics, built for teaching. Several replace the Java simulations that no longer run in a browser; others cover topics that never had a good simulation.

Each simulation is one self-contained HTML file. The physics is in a few clearly named functions near the top of the script, so you can check the model, change a constant, or turn it into a different problem.

Use it, share it, improve it

Use any of these in a lesson, a course site, or a learning management system. Link to a simulation directly, or download the file and host it yourself; it keeps working without this site.

To report a problem or contribute a simulation, go to the repository on GitHub. A new simulation is one file in sims/ and one entry in sims.js.

Good simulations elsewhere

Some topics are already done well by others: Ray Optics Simulation for geometric optics, myPhysicsLab for mechanics with the equations shown, EMANIM for polarization and electromagnetic waves, and of course PhET. This library aims to fill the gaps around them, not to redo them.