Skip to main content
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

Release files for loopfield 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loopfield 1.0.4
File Size Uploaded
loopfield-1.0.4.tar.gz 5.4 kB Details

Release files / loopfield-1.0.4.tar.gz

Download URL loopfield-1.0.4.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
08b515bc9512f71f499a2d95ef925351f7a9be81129a485ba4315ab37e6e226e
BLAKE2b-256 checksum
How to use checksums
00d02998681a4847ded33293a0fbf5e19770ea22cb6c69ea27d5e39f3b1071b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page