Пример #1
0
def get_surface_tooth(self):
    """Returns the surface delimiting the tooth (including yoke part)

    Parameters
    ----------
    self : Slot
        A Slot object

    Returns
    -------
    surface: SurfLine
        A SurfLine object representing the slot

    """

    if self.parent is not None:
        Ryoke = self.parent.get_Ryoke()
    else:
        raise ParentMissingError("Error: The slot is not inside a Lamination")

    curve_list = list()
    # tooth lines
    top_list = self.build_geometry_half_tooth(is_top=True)
    bot_list = self.build_geometry_half_tooth(is_top=False)
    # Yoke lines
    Z1 = Ryoke * exp(1j * pi / self.Zs)
    Z2 = Ryoke * exp(-1j * pi / self.Zs)
    curve_list.append(
        Segment(top_list[-1].get_end(), Z1, label="Tooth_Yoke_Side"))
    if Ryoke > 0:
        curve_list.append(
            Arc1(
                begin=Z1,
                end=Z2,
                radius=-Ryoke,
                is_trigo_direction=False,
                label="Tooth_Yoke_Arc",
            ))
    curve_list.append(
        Segment(Z2, bot_list[0].get_begin(), label="Tooth_Yoke_Side"))
    # Second half of the tooth
    curve_list.extend(bot_list)
    curve_list.extend(top_list)

    return SurfLine(line_list=curve_list, label="Tooth")
Пример #2
0
def is_outwards(self):
    """Return if the slot is outwards (on an external lamination) or inwards
    (on an internal lamination)

    Parameters
    ----------
    self : Slot
        A Slot object

    Returns
    -------
    is_outwards: bool
        True if the Lamination is not internal and false if not
    """
    if self.parent is not None:
        return not self.parent.is_internal
    else:
        raise ParentMissingError("Error: The slot is not inside a Lamination")
Пример #3
0
def get_is_stator(self):
    """Return True if the parent lamination is stator and False if is a rotor

    Parameters
    ----------
    self : Hole
        A Hole object

    Returns
    -------
    is_stator: bool
        True if the Lamination is a stator and False if not
    """

    if self.parent is not None:
        return self.parent.is_stator
    else:
        raise ParentMissingError("Error: The hole is not inside a Lamination")
Пример #4
0
def _comp_point_coordinate(self):
    """Compute the point coordinates needed to plot the Slot.

    Parameters
    ----------
    self : MagnetType11
        A MagnetType11 object

    Returns
    -------
    point_list: list
        A list of 6 complex coordinates

    """
    if self.parent is not None:
        (Z1, Z2) = self.parent.get_point_bottom()
        H0 = self.parent.H0
        W0 = self.parent.W0
    else:
        raise ParentMissingError("Error: The magnet object is not inside a " +
                                 "slot object")

    # comp point coordinate (in complex)
    if W0 > self.Wmag:  # The magnet is smaller than the slot => center the mag
        Z1 = Z1 * exp(1j * (W0 - self.Wmag) / 2)
        Z2 = Z2 * exp(-1j * (W0 - self.Wmag) / 2)

    Rbot = abs(Z1)
    if self.is_outwards():
        Rtop = Rbot - self.Hmag
        Rslot = Rbot - H0
        Zref = Rbot - self.Hmag / 2
    else:
        Rtop = Rbot + self.Hmag
        Rslot = Rbot + H0
        Zref = Rbot + self.Hmag / 2

    Z3 = Rtop * exp(1j * angle(Z1))
    Zs3 = Rslot * exp(1j * angle(Z1))
    Z4 = Rtop * exp(1j * angle(Z2))
    Zs4 = Rslot * exp(1j * angle(Z2))

    return [Z1, Z2, Z3, Zs3, Zs4, Z4, Zref]
Пример #5
0
def get_Rbo(self):
    """Return the parent lamination bore radius

    Parameters
    ----------
    self : Notch
        A Notch object

    Returns
    -------
    Rbo: float
        The parent lamination bore radius [m]

    """

    if self.parent is not None:
        return self.parent.get_Rbo()
    else:
        raise ParentMissingError("Error: The notch is not inside a Lamination")
Пример #6
0
def is_outwards(self):
    """Return if the magnet is outwards (on an external lamination) or inwards
    (on an internal lamination)

    Parameters
    ----------
    self : Magnet
        A Magnet object

    Returns
    -------
    is_outwards: bool
        Direction of the magnet
    Raises
    _______
    ParentMissingError
        Error: The magnet is not inside a Slot
    """
    if self.parent is not None:
        return self.parent.is_outwards()
    else:
        raise ParentMissingError("Error: The magnet is not inside a Slot")
Пример #7
0
def get_bore_line(self, label=""):
    """Return the bore line description

    Parameters
    ----------
    self : BoreFlower
        A BoreFlower object

    Returns
    -------
    bore_list : list
        List of bore lines
    """

    if self.parent is not None:
        Rbo = self.parent.get_Rbo()
    else:
        raise ParentMissingError("Error: The slot is not inside a Lamination")

    # Compute the shape
    (alpha_lim, z_top_left,
     z_top_right) = comp_flower_arc(2 * pi / self.N, self.Rarc, Rbo)

    # Create the lines
    bore_list = list()
    for ii in range(self.N):
        bore_list.append(
            Arc1(
                begin=z_top_right * exp(1j * (2 * pi / self.N *
                                              (ii - 1) + self.alpha)),
                end=z_top_left * exp(1j * (2 * pi / self.N *
                                           (ii - 1) + self.alpha)),
                radius=self.Rarc,
                is_trigo_direction=True,
                label=label,
            ))
    return bore_list
Пример #8
0
def comp_angle_opening(self):
    """Compute the opening angle of the magnet at the lamination bore radius

    Parameters
    ----------
    self : Magnet
        A Magnet object

    Returns
    -------
    alpha_mag: float
        Magnet opening angle [rad]

    """

    if self.IS_FLAT_BOT:
        if self.parent is not None:
            (Z1, Z2) = self.parent.get_point_bottom()
            return 2 * arcsin(self.Wmag / (2 * abs(Z1)))
        else:
            raise ParentMissingError(
                "Error: The magnet object is not inside a " + "slot object")
    else:
        return self.Wmag
Пример #9
0
def build_geometry(self, alpha=0, delta=0, is_simplified=False):
    """Compute the curve (Segment, Arc1) needed to plot the Magnet.
    The list represents a closed surface.
    The ending point of a curve is always the starting point of the next
    curve in the list

    Parameters
    ----------
    self : MagnetType14
        A MagnetType14 object
    alpha : float
        Angle for rotation [rad]
    delta : complex
        Complex value for translation
    is_simplified: bool
        True to avoid line superposition

    Returns
    -------
    surf_list : list
        list of surfaces needed to draw the lamination

    """

    # defining label for type_magnetization
    if self.type_magnetization == 0:
        t_p = "Radial"
    else:
        t_p = "Parallel"

    if self.parent is not None:
        (Z1, Z2) = self.parent.get_point_bottom()
        H0 = self.parent.H0
        W0 = self.parent.W0
    else:
        raise ParentMissingError(
            "Error: The magnet object is not inside a " + "slot object"
        )

    # comp point coordinate (in complex)
    if W0 > self.Wmag:  # The magnet is smaller than the slot => center the mag
        Z1 = Z1 * exp(1j * (W0 - self.Wmag) / 2)
        Z2 = Z2 * exp(-1j * (W0 - self.Wmag) / 2)

    if self.is_outwards():
        (alpha_lim, Z4, Z3) = comp_flower_arc(
            abs(angle(Z1) - angle(Z2)), self.Rtop, abs(Z1) - self.Hmag
        )
        Zs3 = (abs(Z1) - H0) * exp(1j * angle(Z1))
        Zs4 = (abs(Z2) - H0) * exp(1j * angle(Z2))
        Zref = abs(Z1) - self.Hmag / 2
    else:
        (alpha_lim, Z4, Z3) = comp_flower_arc(
            abs(angle(Z1) - angle(Z2)), self.Rtop, abs(Z1) + self.Hmag
        )
        Zs3 = (abs(Z1) + H0) * exp(1j * angle(Z1))
        Zs4 = (abs(Z2) + H0) * exp(1j * angle(Z2))
        Zref = abs(Z1) + self.Hmag / 2

    # Creation of curve
    curve_list = list()
    if is_simplified and W0 > self.Wmag:
        curve_list.append(Segment(Z1, Z3))
    elif is_simplified and H0 < self.Hmag:
        curve_list.append(Segment(Zs3, Z3))
    elif not is_simplified:
        curve_list.append(Segment(Z1, Z3))

    curve_list.append(Arc1(Z3, Z4, self.Rtop))

    if is_simplified and W0 > self.Wmag:
        curve_list.append(Segment(Z4, Z2))
    elif is_simplified and H0 < self.Hmag:
        curve_list.append(Segment(Z4, Zs4))
    elif not is_simplified:
        curve_list.append(Segment(Z4, Z2))

    if not is_simplified:
        curve_list.append(Arc1(Z2, Z1, -abs(Z2), is_trigo_direction=False))

    surf_list = list()
    surf_list.append(
        SurfLine(
            line_list=curve_list,
            label="MagnetRotor" + t_p + "_N_R0_T0_S0",
            point_ref=Zref,
        )
    )

    # Apply transformation
    for surf in surf_list:
        surf.rotate(alpha)
        surf.translate(delta)

    return surf_list
Пример #10
0
def build_geometry(self, alpha=0, delta=0, is_simplified=False):
    """Compute the curve (Segment, Arc1) needed to plot the Magnet.
    The list represents a closed surface.
    The ending point of a curve is always the starting point of the next curve
    in the list

    Parameters
    ----------
    self : MagnetType13
        A MagnetType13 object
    alpha : float
        Angle for rotation [rad]
    delta : complex
        Complex value for translation
    is_simplified: bool
        True to avoid line superposition

    Returns
    -------
    surf_list : list
        list of surfaces needed to draw the magnet

    """
    # defining label for type_magnetization
    if self.type_magnetization == 0:
        t_p = "Radial"
    else:
        t_p = "Parallel"

    if self.parent is not None:
        (Z1, Z2) = self.parent.get_point_bottom()
        H0 = self.parent.H0
        W0 = self.parent.comp_W0m()
    else:
        raise ParentMissingError(
            "Error: The magnet object is not inside a " + "slot object"
        )

    alpha_lim = 2 * arcsin(self.Wmag * 0.5 / self.Rtop)  # Angle of the top arc
    H_top_arc = self.Rtop * (1 - cos(alpha_lim / 2))  # Heiht of the top arc

    # comp point coordinate (in complex)
    if W0 > self.Wmag:  # The magnet is smaller than the slot => center the mag
        Z1 = Z1 + 1j * (W0 - self.Wmag) / 2
        Z2 = Z2 - 1j * (W0 - self.Wmag) / 2

    if self.is_outwards():
        Z3 = Z1 - (self.Hmag - H_top_arc)
        Zs3 = Z1 - H0
        Z4 = Z2 - (self.Hmag - H_top_arc)
        Zs4 = Z2 - H0
    else:
        Z3 = Z1 + (self.Hmag - H_top_arc)
        Zs3 = Z1 + H0
        Z4 = Z2 + (self.Hmag - H_top_arc)
        Zs4 = Z2 + H0

    # Creation of curve
    curve_list = list()
    if is_simplified and W0 > self.Wmag:
        curve_list.append(Segment(Z1, Z3))
    elif is_simplified and H0 < (self.Hmag - H_top_arc):
        curve_list.append(Segment(Zs3, Z3))
    elif not is_simplified:
        curve_list.append(Segment(Z1, Z3))

    if self.is_outwards():
        curve_list.append(Arc1(Z3, Z4, -self.Rtop, is_trigo_direction=False))
    else:
        curve_list.append(Arc1(Z3, Z4, self.Rtop))

    if is_simplified and W0 > self.Wmag:
        curve_list.append(Segment(Z4, Z2))
    elif is_simplified and H0 < (self.Hmag - H_top_arc):
        curve_list.append(Segment(Z4, Zs4))
    elif not is_simplified:
        curve_list.append(Segment(Z4, Z2))

    if not is_simplified:
        curve_list.append(Segment(Z2, Z1))

    surf_list = list()
    surf_list.append(
        SurfLine(
            line_list=curve_list,
            label="MagnetRotor" + t_p + "_N_R0_T0_S0",
            point_ref=(Z1 + Z2 + Z3 + Z4) / 4,
        )
    )

    for surf in surf_list:
        surf.rotate(alpha)
        surf.translate(delta)

    return surf_list