pleiades.CurrentFilamentSet

class pleiades.CurrentFilamentSet(current=1.0, weights=None, patch_kw=None, **kwargs)[source]

Set of locations that have the same current value.

A CurrentFilamentSet represents a set of axisymmetric current centroids with associated current weights to describe the current ratios between all the centroids. In addition, a CurrentFilamentSet implements the Green’s function functionality for computing magnetic fields and flux on an R-Z mesh. A CurrentFilamentSet is not intended to be instatiated directly, but serves as the base class for all concrete current set classes and defines the minimum functional interface and protocols of a current set. Lastly a matplotlib.patches.PathPatch object is associated with each CurrentFilamentSet for ease in plotting and verifying device geometry.

Parameters:
  • current (float, optional) – The current to be used for calculating fields from the Green’s functions. Defaults to 1 amp.
  • weights (iterable, optional) – The weights for all the current locations. The current weight is effectively a current multiplier for a given position that is incorporated into the Green’s function. This enables having both positive and negative currents in an object at the same time as well as current profile shaping in the case of permanent magnets. Defaults to 1 for every location.
  • patch_kw (dict) – Dictionary of any matplotlib.patches.Patch keyword arguments. No type checking is performed on these inputs they are simply assigned to the patch_kw attribute.
  • **kwargs – Any keyword arguments intended to be passed to FieldsOperator object using cooperative inheritance.
Variables:
  • current (float) – The current to be used for calculating fields from the Green’s functions. Defaults to 1 amp.
  • weights (iterable) – The weights for all the current locations. The current weight is effectively a current multiplier for a given position that is incorporated into the Green’s function. This enables having both positive and negative currents in an object at the same time as well as current profile shaping in the case of permanent magnets. Defaults to 1 for every location.
  • npts (int) – Integer for the number of current filaments in this CurrentFilamentSet (read-only).
  • rz_pts (ndarray) – An Nx2 array representing (R, Z) coordinates for current centroids. Units are meters and the coordinate system is cylindrical (read-only)
  • rzw (np.ndarray) – An Nx3 array whos columns describe the current centroid radial coordinate (R), vertical coordinate (Z), and current weight (W) for each filament in the CurrentFilamentSet (read-only).
  • total_current (float) – The total current being carried in the filament set. This is equal to the current times the sum of the weights.
  • patch_kw (dict) – A dictionary of valid matplotlib.patches.Patch keyword arguments
clone()[source]

Create and return a copy of this coil

plot(ax, plot_patch=True, **kwargs)[source]

Plot the current locations for the CurrentGroup

Parameters:
  • ax (matplotlib.Axes object) – The axes object for plotting the current locations
  • plot_patch (bool) – Whether to add the patch for this CurrentFilament to the axes.
  • **kwargs (dict, optional) – Keyword arguments to pass to Current.plot method
rotate(angle, pivot=(0.0, 0.0))[source]

Rotate the current group by a given angle around a specified pivot

Parameters:
  • angle (float) – The angle of the rotation in degrees as measured from the z axis
  • pivot (iterable of float, optional) – The (R, Z) location of the pivot. Defaults to (0., 0.).
simplify()[source]

Create a single coil object from weighted sum of current centroids.

translate(vector)[source]

Translate the current group by the vector (dr, dz)

Parameters:vector (iterable of float) – The displacement vector for the translation