jax_sbgeom.coils.discrete_coil module

class DiscreteCoil(positions: Array, _centre_i: Array)[source]

Bases: Coil

Class representing a coil defined by discrete positions and a centre. This centre is precomputed from the given positions. It does not feature in the computation of the coil positions; only the centre.

positions: Array
classmethod from_positions(positions: Array)[source]

Create a DiscreteCoil from discrete positions

Positions are assumed to be non-periodic (in other words, the first and last point are not equal).

Parameters:

positions (Array) – Cartesian positions of discrete coil points […, 3]

Returns:

DiscreteCoil object

Return type:

DiscreteCoil

position(s)[source]

Position along the coil as a function of arc length

Parameters:

s (jnp.ndarray) – Arc length(s) along the coil

Returns:

Cartesian position(s) along the coil

Return type:

jnp.ndarray

tangent(s)[source]

Tangent vector along the coil as a function of arc length

Parameters:

s (jnp.ndarray) – Arc length(s) along the coil

Returns:

Tangent vector(s) along the coil

Return type:

jnp.ndarray

centre()[source]

Centre of the coil

Returns:

Centre of the coil

Return type:

jnp.ndarray

normal(s)[source]

Normal vector along the coil as a function of arc length Not defined for DiscreteCoil

Parameters:

s (jnp.ndarray) – Arc length(s) along the coil

Returns:

Normal vector(s) along the coil (jnp.nan)

Return type:

jnp.ndarray

reverse_parametrisation()[source]

Reverse the parametrisation of the discrete coil. Reverses all points except the first (s=0 remains s=0).