Magnet (class)

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Machine/Magnet

class Magnet(mat_type=-1, type_magnetization=0, Lmag=0.95, init_dict=None, init_str=None)[source]

Bases: pyleecan.Classes._frozen.FrozenClass

abstract class of magnets

VERSION = 1
comp_angle_opening()

Compute the opening angle of the magnet at the lamination bore radius

Parameters

self (Magnet) – A Magnet object

Returns

alpha_mag – Magnet opening angle [rad]

Return type

float

comp_height()

Compute the height of the Magnet. Caution, the bottom of the Magnet is an Arc

Parameters

self (Magnet) – A Magnet object

Returns

Htot – Height of the Magnet [m]

Return type

float

comp_mass()

Compute the Magnet mass (by analytical computation)

Parameters

self (Magnet) – A Magnet object

Returns

M – Magnet mass [kg]

Return type

float

comp_ratio_opening(p)

Compute the magnet pole arc width to pole width ratio

Parameters
  • self (Magnet) – A Magnet object

  • p (int) – Pole pair number

Returns

taum – Ratio magnet pole arc width to pole width []

Return type

float

comp_surface()

Compute the Magnet total surface (by numerical computation).

Parameters

self (Magnet) – A Magnet object

Returns

S – Magnet total surface [m**2]

Return type

float

comp_volume()

Compute the Magnet volume (by analytical computation)

Parameters

self (Magnet) – A Magnet object

Returns

V – Magnet volume [m**3]

Return type

float

is_outwards()

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 – Direction of the magnet

Return type

bool

Raises

ParentMissingError – Error: The magnet is not inside a Slot

plot(fig=None, display_field=False)

Plot the Magnet in a matplotlib fig

Parameters
  • self (Magnet) – A Magnet object

  • fig – if None, open a new fig and plot, else add to the current one (Default value = None)

  • display_field (bool) – if true, will display magnetization field arrow (Default value = False)

Returns

Return type

None

save(save_path='', is_folder=False)

Save the object to the save_path

Parameters
  • self – A pyleecan object

  • save_path (str) – path to the folder to save the object

  • is_folder (bool) – to split the object in different files: separate simulation machine and materials

copy()

Return a copy of the class

get_logger()

Get the object logger or its parent’s one

Parameters

obj – A pyleecan object

Returns

logger – Pyleecan object dedicated logger

Return type

logging.Logger

as_dict()[source]

Convert this object in a json seriable dict (can be use in __init__)

property mat_type

The Magnet material

Type

Material

property type_magnetization

0 for radial, 1 for parallel, 2 for Hallbach

Type

int

Min

0

Max

5

Type

Permanent magnet magnetization type

property Lmag

Magnet axial length

Type

float

Min

0