# GeneralWire¶

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

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 (astropy.units.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
Returns

B – magnetic field at the specified positon

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{\mu_0 I}{4\pi} \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})$