Output (class)

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

class Output(simu=-1, path_result='', geo=-1, elec=-1, mag=-1, struct=-1, post=-1, logger_name='Pyleecan.Output', force=-1, loss=-1, init_dict=None, init_str=None)[source]

Bases: pyleecan.Classes._frozen.FrozenClass

Main Output object: gather all the outputs of all the modules

VERSION = 1
get_angle_offset_initial()

Return the difference between the d axis angle of the stator and the rotor

Parameters

self (Output) – an Output object

Returns

angle_offset_initial – difference between the d axis angle of the stator and the rotor [rad]

Return type

float

get_angle_rotor()

Return the angular position of the rotor as a function of time and set the Output.elec.angle_rotor attribute if it is None

Parameters

self (Output) – an Output object

Returns

alpha_rotor – angular position of the rotor as a function of time (vector) [rad]

Return type

numpy.ndarray

get_BH_rotor()

Return the B(H) curve of the rotor material

Parameters

self (Output) – an Output object

Returns

BH – B(H) values (two colums matrix: H and B(H))

Return type

numpy.ndarray

get_BH_stator()

Return the B(H) curve of the stator material

Parameters

self (Output) – an Output object

Returns

BH – B(H) values (two colums matrix: H and B(H))

Return type

numpy.ndarray

get_path_result()

Return the path to the result folder. If there is a name for the simulation, the path leads to a sub-folder of ‘Results’ folder which has the same name. If this sub-folder does not exist, it creates it.

Parameters

self (Output) – an Output object

Returns

res_path – path to the result folder

Return type

str

get_machine_periodicity()

Return / Compute the (anti)-periodicities of the machine in time and space domain

Parameters

self (Output) – An Output object

Returns

  • per_a (int) – Number of space periodicities of the machine

  • is_antisym_a (bool) – True if an anti-periodicity is possible after the space periodicities

  • per_t (int) – Number of time periodicities of the machine

  • is_antisym_t (bool) – True if an anti-periodicity is possible after the time periodicities

get_rot_dir()

Return the rotation direction of the magnetic field fundamental WARNING: rot_dir = -1 to have positive rotor rotating direction, i.e. rotor position moves towards positive angle

Parameters

self (Output) – an Output object

Returns

rot_dir – Rotation direction of magnetic field fundamental

Return type

int

get_fund_harm(data)

Return the fundamental harmonic of the physical quantity in the data object

Parameters
  • self (Output) – an Output object

  • data (Data) – a Data object

Returns

fund_harm – Dict containing axis name as key and frequency/order/wavenumber of fundamental harmonic as value

Return type

dict

get_data_from_str(data_str)

Return the data object corresponding to the data str

Parameters
  • self (Output) – an Output object

  • data_str (string) – a string corresponding to a data object

Returns

data – a Data object

Return type

Data

print_memory(tab_level=0, detail_level=1, is_print=True)

Print an estimation of the memory usage for each property of the object

Parameters
  • self (Output) – An Output object

  • tab_level (int) – Number of tab (” “) to add before each line

  • detail_level (int) – Select how many data to display (0: only object size, 1: object + properties, 2:object + detailed properties)

  • is_print (bool) – True print, else return str

Returns

mem_str – if is_print == False, return the string that descibe the memory usage of the object

Return type

str

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(**kwargs)

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

compare(other, name='self')[source]

Compare two objects and return list of differences

as_dict(**kwargs)[source]

Convert this object in a json serializable dict (can be use in __init__). Optional keyword input parameter is for internal use only and may prevent json serializability.

property simu

Simulation object that generated the Output

Type

Simulation

property path_result

Path to the folder to same the results

Type

str

property geo

Geometry output

Type

OutGeo

property elec

Electrical module output

Type

OutElec

property mag

Magnetic module output

Type

OutMag

property struct

Structural module output

Type

OutStruct

property post

Post-Processing settings

Type

OutPost

property logger_name

Name of the logger to use

Type

str

property force

Force module output

Type

OutForce

property loss

Loss module output

Type

OutLoss