Point_Charge_Simulator

This MATLAB code simulates the electric force lines generated by point charges in a 2D space. Users can interactively add positive and negative charges to observe the resulting field dynamics.

Running the Simulation

  1. Run the script in MATLAB:

    Point_Charge
  2. The simulation window will open.

  3. Click and drag the positive or negative charge on the right into the window.

  4. Escape key to end simulation

Click the button below to open the file in MATLAB Online.

Open in MATLAB Online

Example Output

Point_Charge_sample

Point Charge Simulator with Retarded Fields

This branch introduces an enhanced version of the point charge simulator that accounts for the retarded (delayed) electric fields using Liénard–Wiechert potentials. This allows for a more realistic simulation of moving charges and their effects on the electric field.

Features

  • Retarded Electric Fields: The electric fields are calculated using Liénard–Wiechert potentials, considering the finite speed of light.
  • Dynamic Visualization: Visualize the movement of charges and the corresponding electric field lines in real-time.
  • Interactive Charge Placement: Add and move charges interactively with mouse input.
  • Speed Indicator: Displays the velocity of the moving charge relative to the speed of light.

Running the Simulation

  1. Run the script in MATLAB:

    Point_Charge_Lienard_Wiechert
  2. The simulation window will open.

  3. Click and drag the positive or negative charge on the right into the window.

  4. Escape key to end simulation

Example Output

PCS_LW_GitHub.mp4

Update Information

---2024/06/22---

Simulation processing speed has been improved.

---2024/06/23---

Added Point_Charge_Lienard_Wiechert.m