Skip to main content

Current loop magnetic field calculator

Project description

loopfield: compute vector magnetic fields induced by filamentary current loops

loopfile.plot: plot simple 2D visualizations of fields with field lines and thresholded regions

Simple example: calculate field due to single current loop:

#!/usr/bin/env python3

import loopfield as lf

# create empty field with specified units
field = lf.Field(length_units = lf.cm,
current_units = lf.A,
field_units = lf.uT)

# single-turn 10 cm x-oriented coil at origin
position = [0., 0., 0.]
normal = [1., 0., 0.]
radius = 10.
current = 1.
c = lf.Loop(position, normal, radius, current)

# add loop to field
field.addLoop(c);

# evaluate vector field at origin
B = field.evaluate([0., 0., 0.])
print('B = ', B)


See examples for more usage details.

Uses the formulas presented in:

Simpson J., Lane J., Immer C., Youngquist R., Steinrock, T., Simple
Analytic Expressions for the Magnetic Field of a Circular Current
Loop. NASA Technical Report. 2001. Retrieved from
http://ntrs.nasa.gov/search.jsp?R=20010038494

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loopfield-1.0.2.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file loopfield-1.0.2.tar.gz.

File metadata

  • Download URL: loopfield-1.0.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for loopfield-1.0.2.tar.gz
Algorithm Hash digest
SHA256 93dedebcdc862ca1b5ed2f1240057df2c5447dca20455cada79c2e3eddba3570
MD5 fb8bb51d8f84d352ebe0fc4f07194d70
BLAKE2b-256 7a231aebb14974b1f8be530a8443e88a3bdb17a1ba5ac41d4be00cedc206e0da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page