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.
-
Run the script in MATLAB:
Point_Charge
-
The simulation window will open.
-
Click and drag the positive or negative charge on the right into the window.
-
Escape key to end simulation
Click the button below to open the file in MATLAB Online.
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.
- 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.
-
Run the script in MATLAB:
Point_Charge_Lienard_Wiechert
-
The simulation window will open.
-
Click and drag the positive or negative charge on the right into the window.
-
Escape key to end simulation
PCS_LW_GitHub.mp4
---2024/06/22---
Simulation processing speed has been improved.
---2024/06/23---
Added Point_Charge_Lienard_Wiechert.m