Simulation

Coulomb's Law · SimulatorForce Between Two Charges

ElectromagnetismElectric charge and field

Two point charges with adjustable signs and magnitudes: the electrostatic force vector follows F = kq₁q₂/r² and flips direction when charge signs differ.

Published: May 28, 2026

Objective

Verify that the electrostatic force between two point charges obeys Coulomb's inverse-square law: F = k·|q₁|·|q₂|/r². Set the charge magnitudes, signs, and separation, and read the static Force F before launching. Then press Start to release the charges and watch them accelerate under their mutual force (opposite signs draw together until their edges touch, like signs fly apart to the frame edge), while a marker rides the force-versus-separation curve at the current r and the velocity-versus-separation r graph fills in below. The simulation treats both charges as ideal point charges in vacuum with no dielectric medium.

Setup

  1. Set q₁ to +5 μC and q₂ to −5 μC (defaults) and separation r to 2.0 m. Read the static Force F before launching: it should sit near 0.0562 N. Press Start: the opposite-sign charges accelerate toward each other and stop when their edges touch (attractive configuration).
  2. Press Reset. Change q₂ to +5 μC so both charges are positive. Note the static Force F is unchanged because |q₁|·|q₂| is the same. Press Start: the like-sign pair now accelerates apart and the charges stop at the frame edge (repulsive configuration).
  3. Press Reset. Keep q₁ = +5 μC and q₂ = +5 μC and set r to 1.0 m. Read the static Force F: it should be near 0.225 N, roughly four times the r = 2.0 m value, confirming the inverse-square law before any motion begins.
  4. Press Reset. Set r back to 2.0 m and change q₁ to +10 μC. The static Force F should read about 0.112 N, roughly double the q₁ = +5 μC value, confirming F ∝ |q₁|. Press Start to watch the heavier-force pair separate faster on the velocity graph.
The Coulomb's Law simulator at the start of a run.

Analytical Prediction

Coulomb's law gives F = k·|q₁|·|q₂|/r² with k = 8.99 × 10⁹ N·m²/C². With |q₁| = |q₂| = 5 × 10⁻⁶ C and r = 2.0 m:

F=k · |q₁| · |q₂| / r²
=8.99 × 10⁹ × (5 × 10⁻⁶)² / (2.0)²
=8.99 × 10⁹ × 25 × 10⁻¹² / 4
0.0562 N

At r = 1.0 m the inverse-square law predicts:

F(1.0)=F(2.0) × (2.0 / 1.0)²
=0.0562 × 4
0.225 N

Doubling q₁ to 10 μC at r = 2.0 m:

F=8.99 × 10⁹ × (10 × 10⁻⁶) × (5 × 10⁻⁶) / 4
0.112 N

Sign of q₁·q₂ determines direction only; magnitude is the same for opposite-sign and same-sign pairs of equal absolute value.

Results Analysis

With defaults (q₁ = +5 μC, q₂ = −5 μC, r = 2.0 m) the static Force F reads near 0.056 N and the arrows point inward (attractive). Switching both charges to +5 μC keeps F ≈ 0.056 N but flips the arrows outward. Setting r = 1.0 m with equal charges raises the static F to ≈ 0.225 N, a factor of 4 rise consistent with (2.0/1.0)² = 4. Pressing Start releases the charges along the reference axis: the attractive pair accelerates inward and halts when its edges touch, while a like-sign pair accelerates outward and halts at the frame edge. The right panel stacks two graphs with separation r on the x-axis. The top graph is the analytical force-versus-separation curve with a marker that rides the curve at the current separation r, climbing toward smaller r as the gap closes (or sliding outward as the charges separate). The bottom graph plots each particle's velocity versus separation r as two mirrored lines, one per charge, showing the equal-and-opposite accelerations demanded by Newton's third law.

The Coulomb's Law simulator after a completed run.

Source of Error

Both charges are modelled as ideal point charges: no finite size, no charge distribution, no self-energy, and no relativistic corrections. The medium is assumed to be vacuum (permittivity ε₀ only); any real dielectric would reduce the force by a factor of εᵣ. No gravitational, magnetic, or inductive effects are included. The analytical prediction in the Prediction section shares all of these idealizations, so they cancel in the comparison. The r slider minimum of 0.5 m avoids the unphysical divergence that would occur for macroscopic objects at separations below their own radii. The residual gap between the predicted 0.056 N and the Force F readout is therefore purely numerical.

Further Exploration