pyleecan.Classes.OutElec module

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Output/OutElec

class OutElec(axes_dict=None, Is=None, Ir=None, logger_name='pyleecan.Electrical', Pj_losses=None, Us=None, internal=None, OP=None, Pem_av=None, Tem_av=None, phase_dir=None, current_dir=None, PWM=None, eec=None, P_out=None, Jrms=None, P_in=None, Arms=None, Erms=None, init_dict=None, init_str=None)[source]

Bases: FrozenClass

Gather the electric module outputs

VERSION = 1
get_Nr(Time=None)

Create speed in function of time vector Nr

Parameters:
  • self (OutElec) – An OutElec object

  • Time (Data) – a time axis (SciDataTool Data object)

Returns:

Nr – speed in function of time

Return type:

ndarray

get_Is(Time=None, is_dqh=False, is_fund_only=False, is_harm_only=False, is_freq=None)

Return the stator current DataND object

Parameters:
  • self (OutElec) – an OutElec object

  • Time (Data) – Time axis

  • is_dqh (bool) – True to rotate in DQH frame

  • is_fund_only (bool) – True to return only fundamental component

  • is_harm_only (bool) – True to return only components at higher frequencies than fundamental component

  • is_freq (bool) – True to calculate dqh transformation in frequency domain

Returns:

Is – stator current

Return type:

DataND

get_Us(Time=None, is_dqh=False, is_fund_only=False, is_harm_only=False, is_freq=None)

Return the fundamental stator voltage as DataND object

Parameters:
  • self (OutElec) – an OutElec object

  • Time (Data) – Time axis

  • is_dqh (bool) – True to rotate in DQH frame

  • is_fund_only (bool) – True to return only fundamental component

  • is_harm_only (bool) – True to return only components at higher frequencies than fundamental component

  • is_freq (bool) – True to calculate dqh transformation in frequency domain

Returns:

Us – stator voltage

Return type:

DataND

store(out_dict)

Store the standard outputs of Electrical that are temporarily in out_dict as arrays into OutElec as Data object

Parameters:
  • self (OutElec) – the OutElec object to update

  • out_dict (dict) – Dict containing all electrical quantities that have been calculated in EEC

get_electrical(data_dict, Time=None, is_dqh=False, is_fund_only=False, is_harm_only=False, is_freq=None)

Generic getter to return voltage/current as DataND object

Parameters:
  • self (OutElec) – an OutElec object

  • data_dict (str) – Requested quantity (‘U_s’: stator voltage, ‘I_s’: stator current)

  • Time (Data) – Time axis

  • is_dqh (bool) – True to rotate in DQH frame

  • is_fund_only (bool) – True to return only fundamental component

  • is_harm_only (bool) – True to return only components at higher frequencies than fundamental component

  • is_freq (bool) – True to calculate dqh transformation in frequency domain

Returns:

obj – Requested quantity

Return type:

DataND

get_Jrms()

Return the stator current density rms value

Parameters:

self (OutElec) – an OutElec object

Returns:

Jrms – stator current density rms value [A/m^2]

Return type:

float

save(save_path='', is_folder=False, type_handle_old=2, type_compression=0)

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 (json only)

  • type_handle_old (int) – How to handle old file in folder mode (0:Nothing, 1:Delete, 2:Move to “Backup” folder)

  • type_compression (int) – Available only for json, 0: no compression, 1: gzip

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

compare(other, name='self', ignore_list=None, is_add_value=False)[source]

Compare two objects and return list of differences

as_dict(type_handle_ndarray=0, keep_function=False, **kwargs)[source]

Convert this object in a json serializable dict (can be use in __init__). type_handle_ndarray: int

How to handle ndarray (0: tolist, 1: copy, 2: nothing)

keep_functionbool

True to keep the function object, else return str

Optional keyword input parameter is for internal use only and may prevent json serializability.

copy()[source]

Creates a deepcopy of the object

property axes_dict

Dict containing axes data used for Electrical

Type:

{SciDataTool.Classes.DataND.Data}

property Is

Stator currents DataTime object

Type:

SciDataTool.Classes.DataND.DataND

property Ir

Rotor currents as a function of time (each column correspond to one phase)

Type:

SciDataTool.Classes.DataND.DataND

property logger_name

Name of the logger to use

Type:

str

property Pj_losses

Electrical Joule losses

Type:

float

property Us

Stator voltage as a function of time (each column correspond to one phase)

Type:

SciDataTool.Classes.DataND.DataND

property internal

OutInternal object containg outputs related to a specific model

Type:

OutInternal

property OP

Operating Point

Type:

OP

property Pem_av

Average Electromagnetic power

Type:

float

property Tem_av

Average Electromagnetic torque

Type:

float

property phase_dir

Rotation direction of the stator phases (phase_dir*(n-1)*pi/qs, default value given by PHASE_DIR_REF)

Type:

int

Min:

-1

Max:

1

property current_dir

Rotation direction of the stator currents (current_dir*2*pi*felec*time, default value given by CURRENT_DIR_REF)

Type:

int

Min:

-1

Max:

1

property PWM

Object to generate PWM signal

Type:

ImportGenPWM

property eec

Electric Equivalent Circuit used for OP resolution

Type:

EEC

property P_out

Output power

Type:

float

property Jrms

RMS current density in slots

Type:

float

Min:

0

property P_in

Input power

Type:

float

property Arms

RMS linear current density along airgap

Type:

float

property Erms

RMS back-emf

Type:

float