# CircularWire

class plasmapy.formulary.magnetostatics.CircularWire(normal, center: Quantity, radius: Quantity, current: Quantity, n=300)[source]

Bases: Wire

Circular wire (coil) class.

Parameters:

Methods Summary

 Calculate magnetic field generated by this wire at position p. Convert this Wire into a GeneralWire.

Methods Documentation

magnetic_field(p) [source]

Calculate magnetic field generated by this wire at position p.

Parameters:

p (Quantity) – Three-dimensional position vector.

Returns:

B – Magnetic field at the specified position.

Return type:

Quantity

Notes

The magnetic field generated by a circular wire with constant electric current is found at a point in 3D space using the Biot–Savart law. The integral in the Biot–Savart law is approximated using the Gauss–Legendre quadrature.

Let the point where the magnetic field will be calculated be represented by the point $$p$$ and the wire be represented by the parametric vector equation

$\vec{l}(\theta) = R\cos\theta \hat{x} + R\sin\theta \hat{y},\quad -\pi \leq \theta \leq \pi$

where $$R$$ is the radius of the circular wire. Further, let the displacement vector from a point on the wire to the point $$p$$ be written as $$\vec{r}(\theta) = \vec{p} - \vec{l}(\theta)$$.

The magnetic field $$B$$ due to a current $$I$$ is then found at the point $$p$$ using the Biot–Savart law, which takes the form

$\vec{B} = \frac{\mu_0 I}{4\pi} \int_C \frac{d\vec{l} \times \vec{r}}{|\vec{r}|^3}.$

This line integral is approximated using the Gauss–Legendre quadrature with $$n$$ sample points:

$\hat{B} \approx \frac{\mu_0 I}{4\pi} \sum_{i=1}^n w_i \frac{\Delta\vec{l}(\pi x_i) \times \vec{r}(\pi x_i)} {|\vec{r}(\pi x_i)|^3}$

where $$w_i$$ is the $$i\text{th}$$ quadrature weight and $$x_i$$ is the $$i\text{th}$$ root of the $$n\text{th}$$ Legendre polynomial.

to_GeneralWire()[source]

Convert this Wire into a GeneralWire.