bluemira.magnetostatics.trapezoidal_prism ========================================= .. py:module:: bluemira.magnetostatics.trapezoidal_prism .. autoapi-nested-parse:: Analytical expressions for the field inside an arbitrarily shaped winding pack of rectangular cross-section, following equations as described in: .. doi:: 10.1002/jnm.594 including corrections from: .. doi:: 10.1002/jnm.675 Classes ------- .. autoapisummary:: bluemira.magnetostatics.trapezoidal_prism.TrapezoidalPrismCurrentSource Module Contents --------------- .. py:class:: TrapezoidalPrismCurrentSource(origin: numpy.typing.NDArray[numpy.float64], ds: numpy.typing.NDArray[numpy.float64], normal: numpy.typing.NDArray[numpy.float64], t_vec: numpy.typing.NDArray[numpy.float64], breadth: float, depth: float, alpha: float, beta: float, current: float) Bases: :py:obj:`bluemira.magnetostatics.baseclass.PrismEndCapMixin`, :py:obj:`bluemira.magnetostatics.baseclass.CrossSectionCurrentSource` .. autoapi-inheritance-diagram:: bluemira.magnetostatics.trapezoidal_prism.TrapezoidalPrismCurrentSource :parts: 1 :private-bases: 3-D trapezoidal prism current source with a rectangular cross-section and uniform current distribution. The current direction is along the local y coordinate. :param origin: The origin of the current source in global coordinates [m] :param ds: The direction vector of the current source in global coordinates [m] :param normal: The normalised normal vector of the current source in global coordinates [m] :param t_vec: The normalised tangent vector of the current source in global coordinates [m] :param breadth: The breadth of the current source (half-width) [m] :param depth: The depth of the current source (half-height) [m] :param alpha: The first angle of the trapezoidal prism [°] [0, 180) :param beta: The second angle of the trapezoidal prism [°] [0, 180) :param current: The current flowing through the source [A] .. rubric:: Notes Negative angles are allowed, but both angles must be either 0 or negative. .. py:attribute:: _origin .. py:attribute:: _halflength .. py:attribute:: _dcm .. py:attribute:: _length .. py:attribute:: _breadth .. py:attribute:: _depth .. py:attribute:: _alpha .. py:attribute:: _beta .. py:attribute:: _area .. py:attribute:: _points .. py:method:: _xyzlocal_to_rql(x_local: float, y_local: float, z_local: float) -> tuple[float, float, float, float, float, float] Convert local x, y, z coordinates to working coordinates. :returns: Working coordinates .. py:method:: _BxByBz(point: numpy.typing.NDArray[numpy.float64]) -> numpy.typing.NDArray[numpy.float64] Calculate the field at a point in local coordinates. :returns: (Bx, By, Bz) at a point .. note:: By set to 0. .. py:method:: field(x: float | numpy.typing.NDArray[numpy.float64], y: float | numpy.typing.NDArray[numpy.float64], z: float | numpy.typing.NDArray[numpy.float64]) -> float | numpy.typing.NDArray[numpy.float64] Calculate the magnetic field at a point due to the current source. :param x: The x coordinate(s) of the points at which to calculate the field :param y: The y coordinate(s) of the points at which to calculate the field :param z: The z coordinate(s) of the points at which to calculate the field :returns: The magnetic field vector {Bx, By, Bz} in [T] .. py:method:: _calculate_points() -> numpy.typing.NDArray[numpy.float64] Calculate extrema points of the current source for plotting and debugging. :returns: extrema points