Git Product home page Git Product logo

electrostatics's Introduction

electrostatics 0.2.0

electrostatics.py is a python module for electrostatics field and potential calculations, and field line and equipotential contour plots.

Installation

Install into python by executing

# pip install git+https://github.com/tomduck/electrostatics.git --user

Examples

Textbook examples are given below along with a selection of cases from the excellent paper "Electric field lines don't work" by Wolf, Van Hook and Weeks (Am. J. Phys., 64, 1996). Solid lines are the field lines, dotted lines are equipotential contours, and colours give the field strength.

In each case field lines are initialized symmetrically close to one (or more) charges. Paths are determined numerically from the streamline equation using an ODE solver. The integration parameters were adapted from Heiko Bauke's page on "Visualizing Streamlines".

The colours in each image give the logarithm of the field magnitude. Each colour step represents a 0.2 change in log-10 space (5 steps represents a decade). The field in close proximity to a charge is clipped to a maximum value.

Dipole

The left charge is +1 and the right charge is -1. In textbook examples like this the lines are symmetrically distributed around each charge no matter which charge they are initialized around.

Dipole.

Below is the corresponding electric field vector plot. The length of the vectors is the fifth root of the electric field magnitude. The field line diagrams make visualizing the field much easier.

Dipole vectors.

Source.

Biased Dipole

The left charge is +2 and the right charge -1. Field lines are initialized symmetrically around the -1 charge, and again symmetrically in the far field. Notice that the +2 charge exhibits "equatorial clumping" of the field lines, and that there is divergence from the zero-field point (in black). Equatorial clumping and 2D divergence are artefacts that arise from taking a 2D slice of a 3D field.

Biased dipole.

Source.

Biased Dipole in Flatland

This example is for a theoretical electric field that is non-divergent in 2D (i.e., Flatland). There is no clumping and the zero-field point has the same number of lines entering and leaving it, as expected.

Biased dipole in Flatland.

Source.

Two Positive Charges

This is another textbook example. Note the equatorial clumping in the far field and the point of 2D convergence in the middle.

Two positive charges.

Source.

Line - Point

Both the line and point have the same amount of charge. Lines are initialized symmetrically around the point charge. That they do not connect to the line symmetrically is a 2D slice artefact.

Line - point.

Source.

Line - Line

The lines are initialized symmetrically close to one line and connect to the other symmetrically, as expected.

Line - line.

Source.

Cup - Point

The cup and point have equal and opposite charges. Note that few field lines enter the cup.

Cup - point.

Source.

Quadrupole

Another textbook example with perfect symmetry.

Quadrupole.

Source.

Linear Quadrupole

The middle charge is -4 and the outer charges are +2. Lines are initialized symmetrically around the positive charges. Note the equatorial clumping around the negative charge.

Linear quadrupole.

Source.

Linear Quadrupole with Central Cluster

This is similar to the previous example but with the negative charge divided into a cluster of four -1 charges. Notice that there is an unequal distribution of lines between the negative charges. The number of lines is not proportional to the amount of charge in a 2D slice of a 3D field. The lines are also not distributed uniformly around the negative charges.

Linear quadrupole with central cluster.

Source.

False Monopole

Here we have a -4 central charge surrounded by four +1 charges. 25% of the lines diverge to infinity, which incorrectly suggests a net +1 charge.

False monopole.

Source.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.