Machine (class)

Warning : this file has been generated, you shouldn’t edit it

class Machine(rotor=-1, stator=-1, frame=-1, shaft=-1, name='default_machine', desc='', init_dict=None)[source]

Bases: pyleecan.Classes.frozen.FrozenClass

VERSION = 1
build_geometry(sym=1, alpha=0, delta=0)

Build the geometry of the machine

Parameters:
  • self (Machine) – Machine object
  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)
  • alpha (float) – Angle for rotation [rad]
  • delta (complex) – Complex value for translation
  • is_simplified (bool) – True to avoid line superposition
Returns:

surf_list – list of surfaces needed to draw the lamination

Return type:

list

check()

Check that the Machine object is correct

Parameters:

self – A Machine object

Returns:

Return type:

None

Raises:
  • MC_AbstractError – Machine is an abstract class
  • MC_StatorNotStator – self.stator.is_stator must be True
  • MC_RotorIsStator – self.rotor.is_stator must be False
  • MC_BothInternal – self.rotor.is_internal and self.rotor.is_internal can’t be both True
  • MC_BothExternal – self.rotor.is_internal and self.rotor.is_internal can’t be both False
  • MC_RotorDontFit – The Rotor is too big to fit in the Stator
  • MC_ShaftTooBig – The Shaft is too big to fit in the Rotor
  • MC_ShaftTooSmall – The Shaft is too small to fit in the Rotor
  • MC_MecAirgapError – The Stator and the rotor don’t fit because of magnet or short circuit ring
comp_masses()

Compute the masses of the machine - Mmach : Mass total [kg] - Mfra : Mass of the Frame [kg] - Msha : Mass of the Shaft [kg] - Mrot : Mass dictionnary of the rotor masses - Msta : Mass dictionnary of the stator masses

Parameters:self (Machine) – A Machine object
Returns:M_dict – A dictionnary of the Machine’s masses (Mmach, Msha, Mfra, Mrot, Msta) [kg]
Return type:dict
comp_width_airgap_mag()

Compute the magnetic airgap (distance beetween the two Lamination)

Parameters:self (Machine) – A Machine object
Returns:mag_gap – The magnetic airgap [m]
Return type:float
comp_width_airgap_mec()

Compute the mechanical airgap (mag_airgap - magnet or ring)

Parameters:self (Machine) – Machine object
Returns:mec_gap – The mechanical airgap [m]
Return type:float
get_lamination(is_internal)

Returns internal Lamination of the machine

Parameters:
  • self (Machine) – Machine object
  • is_internal (bool) – true if The lamination returned is internal
Returns:

lam – the internal Lamination

Return type:

Lamination

get_Rgap_mec()

Returns the radius of the center of the mecanical airgap

Parameters:self (Machine) – Machine object
Returns:Rgap_mec – Radius of the center of the mecanical airgap [m]
Return type:float
plot(sym=1, alpha=0, delta=0)

Plot the Machine in a matplotlib fig

Parameters:
  • self (Machine) – A Machine object
  • sym (int) – Symmetry factor (1= full machine, 2= half of the machine…)
  • alpha (float) – Angle for rotation [rad]
  • delta (complex) – Complex value for translation
Returns:

Return type:

None

as_dict()[source]

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

rotor

Machine’s Rotor

stator

Machine’s Stator

frame

Machine’s Frame

shaft

Machine’s Shaft

name

Name of the machine

desc

Machine description