Skip to content

Simulation of electric field around point charges

Notifications You must be signed in to change notification settings

Flederossi/e-field-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e-field-sim

The program simulates the normalized electric vector field given an input of a variable number of point charges. It uses Coulumb's law in vector form to calculate a three dimensional direction vector at each point of a specific grid resolution. This resolution can be varied in code.

Alt Text

For better overview, the alpha channel can be manipulated based on the standardized magnitude calculation before the normalization. The following plot can be enabled in the code (mag_plot = True).

Alt Text

Calculations

For every point charge in the simulation the force vector at a specific point on the grid acting on a standardized test charge is calculated using:

$$\vec{E}(\vec{r}) = q \cdot \frac{\vec{r}}{|\vec{r}|^{3}}$$

Where $$\vec{r}$$ is the vector from the current point charge to the grid point and $$q$$ is the electric charge of the point charge. (In the case of the simulation: $q = -1~C \equiv "-"$ and $q = 1~C \equiv "+" \rightarrow$ magnitude can be ignored because of normalization)

The force vectors to every point charge from one point on the grid are added together resulting in the final vector for this point in space. This vector then gets normalized.

About

Simulation of electric field around point charges

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages