Elsevier Science Home
Computer Physics Communications Program Library
Full text online from Science Direct
Programs in Physics & Physical Chemistry
CPC Home

[Licence| Download | New Version Template] aarp_v1_0.gz(7 Kbytes)
Manuscript Title: Magnetic field, vector potential and their derivatives due to currents in closed polygons of wire.
Authors: D.K. Lee
Program title: BWIRE
Catalogue identifier: AARP_v1_0
Distribution format: gz
Journal reference: Comput. Phys. Commun. 25(1982)181
Programming language: Fortran.
Computer: CDC-7600.
Operating system: LTSS.
RAM: 11K words
Word size: 60
Keywords: Plasma physics, Magnetic confinement, Magnetic vector Potential, Partial derivatives, Orthogonal Transformation, Scale factor, Transition matrix, Magnetic field.
Classification: 19.9.

Nature of problem:
The program evaluates the magnetic field, the magnetic vector potential, and their partial derivatives for two types of magnetic sources: (1) current-carrying straight wire of finite length and (2) current-carrying closed polygon (not necessarily plane) consisting of three or more straight wires of finite length.

Solution method:
Explicit expressions for the magnetic field, the magnetic vector potential, their partial derivatives and many other related quantities are derived analytically in the Cartesian coordinate system for a current-carrying straight wire of finite length. Orthogonal transformation is employed to obtain the results in other orthogonal coordinates.

Restrictions:
The observation point (where the magnetic field and other quantities are to be evaluated) is singular if it is collinear with the straight wire, and hence such a point should be avoided. The present program gives the results in four different orthogonal coordinate systems: Cartesian, cylindrical, spherical and local toroidal. For other orthogonal systems, one needs only a minor modification which involves evaluation of scale factors and transition matrix elements. More general coordinates require more extensive modification of the formulation.

Unusual features:
The program is fairly fast and accurate, since all quantities are derived analytically and precisely in simple closed forms and exact indentities are utilized to the greatest possible extent to make the numerical procedure as efficient as possible.

Running time:
The program for the test case includes seven subroutines, but only one or two will be necessary in almost all applications. This test case used 13.85 s to compile, load and execute. For a current loop consisting of four straight wires, a single execution time for calculation of the magnetic quantities ranges from 0.55*10**-4 s to 2.66*10**-4 s, depending on which subroutine is used.