GeneralWire

class plasmapy.formulary.GeneralWire(parametric_eq, t1, t2, current: Unit(‘A’))

Bases: plasmapy.formulary.magnetostatics.Wire

General wire class described by its parametric vector equation

Parameters
  • parametric_eq (Callable) – A vector-valued (with units of position) function of a single real parameter.

  • t1 (float) – Lower bound of the parameter, smaller than t2.

  • t2 (float) – Upper bound of the parameter, larger than t1.

  • current (Quantity) – Electric current.

Methods Summary

magnetic_field(p[, n])

Calculate magnetic field generated by this wire at position p

Methods Documentation

magnetic_field(p: Unit(‘m’), n: numbers.Integral = 1000)

Calculate magnetic field generated by this wire at position p

Parameters
  • p (Quantity) – Three-dimensional position vector.

  • n (int, optional) – Number of segments for Wire calculation (defaults to 1000).

Returns

B – Magnetic field at the specified position.

Return type

astropy.units.Quantity

Notes

For simplicity, we segment the wire into n equal pieces, and assume each segment is straight. Default n is 1000.

\[\vec B \approx \frac{μ_0 I}{4π} \sum_{i=1}^{n} \frac{[\vec l(t_{i}) - \vec l(t_{i-1})] \times \left[\vec p - \frac{\vec l(t_{i}) + \vec l(t_{i-1})}{2}\right]} {\left|\vec p - \frac{\vec l(t_{i}) + \vec l(t_{i-1})}{2}\right|^3}, \quad \text{where}\, t_i = t_{\min}+i/n*(t_{\max}-t_{\min})\]