Point Charge Field Simulator

JJ Ben-Joseph headshot JJ Ben-Joseph

Adjust parameters and press Play.
Simulation summary will appear here.

1. From Static Formula to Moving Charge

Classroom presentations of Coulomb's law often stop at the algebra: a single equation tells us the electric field magnitude a distance r from a point charge. Yet the field is more than a number; it shapes the trajectory of any other charge placed nearby. The simulator above preserves the core purpose of the original calculator—finding the field from a lone source—but elevates it into an experiment. Field lines radiate from the source charge at the canvas center while a test charge responds to the force in real time. As you tweak charge, mass, or starting position, the dot accelerates and curves, and energy bars quantify kinetic and potential contributions. What was once a static homework problem becomes a miniature laboratory where you can freeze, reset, and export data to analyze the dynamics of electrostatic interaction.

2. Variables, Units, and Assumptions

The scenario assumes a single fixed source charge Q located at the origin and a test charge q with mass m. The position of the test charge is (x,y), giving a separation r=x2+y2. All calculations occur in vacuum with permittivity ε0, folded into Coulomb's constant k=8.9875517923×109 N·m²/C². Inputs use SI units exclusively: coulombs for charge, kilograms for mass, meters for position, seconds for time. The code rejects non‑finite values and clamps the timestep Δt to the range 10‑5–0.05 s to avoid instability. Radiation reaction, magnetic forces, and relativistic effects are neglected; the test charge is assumed small enough not to disturb the source.

3. Governing Equations

The electric field from the source charge follows Coulomb's law:

\vec{E}(r)=kQr2\hat{r}

A test charge experiences force \vec{F}=q\vec{E}, giving accelerations \vec{a}=\vec{F}m. In component form, the derivatives are

dv_xdt=kQqxr3,\quaddv_ydt=kQqyr3

Positions advance according to dxdt=v_x and dydt=v_y. The potential and kinetic energies are

PE=kQqr,\qquadKE=12m(v_x^2+v_y^2)

Their sum provides a simple check on numerical accuracy; the script reports the fractional drift from the initial total energy.

4. Numerical Scheme

The simulator uses a classical fourth‑order Runge–Kutta (RK4) integrator, which evaluates the derivatives at four sub‑steps within each timestep. RK4 offers a good balance between accuracy and computational cost for smooth forces like Coulomb's. The local truncation error scales with Δt4, so halving Δt reduces drift by roughly a factor of sixteen. The input box lets you explore this tradeoff; tiny steps preserve energy but slow the animation, while large steps run fast but may overshoot near the origin where forces are strongest. If the particle approaches within one millimeter of the source, the code automatically pauses and warns that the point‑charge model and numerical method become unreliable at such small separations.

5. Worked Example

Try a source charge of 1 microcoulomb and a test charge of the same magnitude but opposite sign, mass 1 gram, starting 0.1 m to the right of the origin. With a timestep of 0.0005 s, pressing Play reveals the particle accelerating toward the origin, passing through, and decelerating as it moves away on the opposite side. The energy bars show potential energy converting to kinetic near the center. The output panel reports a maximum speed of about 42 m/s. Downloading the CSV yields columns of time, position, velocity, and energies that you can import into a spreadsheet. Plotting total energy confirms that the RK4 integrator keeps the relative error below 0.1% over the 0.05 s run.

6. Comparison Table

The table highlights how changing one parameter influences the motion. All cases start at (0.1, 0) m with timestep 0.0005 s.

Scenario Q (μC) m (g) Peak Speed (m/s) Energy Drift (%)
Baseline 1 1 42 0.08
Heavier mass 1 5 19 0.05
Stronger charge 2 1 59 0.12

7. How to Read the Animation

Blue radial lines indicate the electric field pointing away from a positive source (inward if Q is negative). The orange dot marks the test charge; its trail fades over time to show trajectory without relying on color alone. Energy bars beneath the canvas depict kinetic energy in orange stripes and potential energy in blue stripes, each scaled to the initial total. The caption beneath the canvas narrates the motion—for example, “t = 0.020 s, r = 0.055 m, KE 60%, PE 40%”—ensuring screen‑reader users receive equivalent information.

8. Limitations and Extensions

The model treats charges as mathematical points and ignores radiation emitted by accelerating charges, an effect relevant only at relativistic speeds or extreme accelerations. Magnetic forces are omitted, so trajectories remain planar. Near r=0 the inverse‑square law diverges; the code halts rather than allow unphysical energies. Future extensions could include multiple source charges to form dipoles, overlays of equipotential lines, or relativistic corrections when velocities approach the speed of light. For more complex geometries, see the line charge field calculator or the charged ring field calculator.

9. References

Standard treatments of electrostatics can be found in D. J. Griffiths, Introduction to Electrodynamics, and M. A. Heald & J. B. Marion, Classical Electromagnetic Radiation. Numerical integration techniques follow the exposition in W. Press et al., Numerical Recipes. Field line visualization methods draw on M. Agrawala et al., “Visualizing Vector Fields Using Line Integral Convolution,” IEEE Computer Graphics and Applications (1993).

Embed this calculator

Copy and paste the HTML below to add the Interactive Point Charge Electric Field Simulator to your website.