pyleecan.Classes.OPMatrix module

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Simulation/OPMatrix

class OPMatrix(N0=None, Id_ref=None, Iq_ref=None, Ud_ref=None, Uq_ref=None, Tem_av_ref=None, Pem_av_ref=None, slip_ref=None, is_output_power=True, If_ref=None, col_names=None, init_dict=None, init_str=None)[source]

Bases: FrozenClass

Define the Operating Point of a variable speed simulation

VERSION = 1
get_N_OP()

return the number of Operating point in the matrix

Parameters:

self (OPMatrix) – An OPMatrix object

Returns:

N_OP – Number of operating point in the OP_matrix

Return type:

int

get_OP(index)

Return the OP at the corresponding index

Parameters:
  • self (OPMatrix) – OPMatrix object to extrat the OP from

  • index (int) – Index of the OP to extract

Returns:

OP – OP object

Return type:

OP

get_OP_list()

Return the list of Operating Point defined by the matrix

Parameters:

self (OPMatrix) – An OPMatrix object

Returns:

OP_list – List of OP objects

Return type:

[OP]

get_OP_array(*arg_list)

get the OP_matrix by identifying the columns Ex: get_OP_array(“N0”, “Iq”, “Iq”, “Tem”) get_OP_array() calls get_OP_array(“N0”, “Id”, “Iq”, “Tem”, “Pem”)

Parameters:
  • self (OPMatrix) – OPMatrix object to update

  • *arg_list (list of str) – arguments to select the OP_matrix columns name

Returns:

OP_matrix – Operating point matrix with the selected columns (Array (N_OP, len(arg_list)))

Return type:

ndarray

set_OP_array(OP_matrix, *arg_list)

Set the OP_matrix by identifying the columns Ex: set_OP_array(OP_matrix, “N0”, “Iq”, “Iq”, “Tem”) set_OP_array(OP_matrix) calls set_OP_array(OP_matrix, “N0”, “Id”, “Iq”, “Tem”, “Pem”) I0/Phi0 are converted to Id, Iq, U0/UPhi0 are converted to Ud, Uq

Parameters:
  • self (OPMatrix) – OPMatrix object to update

  • OP_matrix (ndarray) – OP_matrix to set in the object

  • *arg_list (list of str) – arguments to specify the OP_matrix columns name

has_Pem()

Check if the Power column is set

Parameters:

self (OPMatrix) – OPMatrix object

Returns:

has_Pem – True if the Power column is set

Return type:

bool

has_Tem()

Check if the Torque column is set

Parameters:

self (OPMatrix) – OPMatrix object

Returns:

has_Tem – True if the Torque column is set

Return type:

bool

has_slip()

Check if the slip column is set

Parameters:

self (OPMatrix) – OPMatrix object

Returns:

has_slip – True if the slip_ref column is set

Return type:

bool

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 N0

Rotor speed

Type:

ndarray

property Id_ref

d-axis current rms value

Type:

ndarray

property Iq_ref

q-axis current rms value

Type:

ndarray

property Ud_ref

d-axis voltage rms value

Type:

ndarray

property Uq_ref

q-axis voltage rms value

Type:

ndarray

property Tem_av_ref

Output average electromagnetic torque

Type:

ndarray

property Pem_av_ref

Output/Input average Electromagnetic Power

Type:

ndarray

property slip_ref

Rotor mechanical slip

Type:

ndarray

property is_output_power

True if power given in OP_matrix is the output power, False if it is the input power

Type:

bool

property If_ref

DC rotor current

Type:

ndarray

property col_names

Name of the columns from set_OP_matrix

Type:

list