pyleecan.Classes.Input module

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

class Input(time=None, angle=None, Nt_tot=2048, Nrev=None, Na_tot=2048, OP=None, t_final=None, init_dict=None, init_str=None)[source]

Bases: FrozenClass

Starting data of the simulation

VERSION = 1
comp_axes(axes_list, machine=None, axes_dict_in=None, is_periodicity_a=None, is_periodicity_t=None, per_a=None, is_antiper_a=None, per_t=None, is_antiper_t=None, is_periodicity_rotor=False)

Compute simulation axes such as time / angle / phase axes, with or without periodicities and including normalizations

Parameters:
  • self (Input) – an Input object

  • machine (Machine) – a Machine object

  • axes_list (list) – List of axes name to return in axes dict

  • axes_dict ({Data}) – dict of axes containing time and angle axes (with or without (anti-)periodicity)

  • is_periodicity_a (bool) – True if spatial periodicity is requested

  • is_periodicity_t (bool) – True if time periodicity is requested

  • per_a (int) – angle periodicity

  • is_antiper_a (bool) – if the angle axis is antiperiodic

  • per_t (int) – time periodicity

  • is_antiper_t (bool) – if the time axis is antiperiodic

  • is_periodicity_rotor (bool) – True to consider rotor periodicity over time instead of stator

Returns:

axes_dict – dict of axes containing requested axes

Return type:

{Data}

comp_axis_time(p, per_t=None, is_antiper_t=None, Time_in=None)

Compute time axis, with or without periodicities and including normalizations

Parameters:
  • self (Input) – an Input object

  • p (int) – Number of pole pairs

  • per_t (int) – time periodicity

  • is_antiper_t (bool) – if the time axis is antiperiodic

  • Time_in (Data) – Input time axis

Returns:

Time – Requested Time axis

Return type:

Data

comp_axis_angle(p, Rag, per_a=None, is_antiper_a=None, Angle_in=None)

Compute angle axis with or without periodicities and including normalizations

Parameters:
  • self (Input) – an Input object

  • p (int) – Machine pole pair number

  • Rag (float) – Airgap mean radius [m]

  • per_a (int) – angle periodicity

  • is_antiper_a (bool) – if the angle axis is antiperiodic

  • Angle_in (Data) – Input axis angle

Returns:

Timee_in – Requested axis angle

Return type:

Data

comp_axis_phase(lamination, per_a=None, is_apera=None, Phase_in=None)

Compute phase axes for given lamination

Parameters:
  • self (Input) – an Input object

  • lamination (Lamination) – a Lamination object

  • per_a (int) – time periodicity

  • Phase_in (Data) – Input phase axis

Returns:

Phase – Requested phase axis

Return type:

Data

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 time

Electrical time vector (no symmetry) to import

Type:

ImportMatrix

property angle

Electrical position vector (no symmetry) to import

Type:

ImportMatrix

property Nt_tot

Time discretization

Type:

int

Min:

1

property Nrev

Number of rotor revolution (to compute the final time)

Type:

float

Min:

0

property Na_tot

Angular discretization

Type:

int

Min:

1

property OP

Operating Point

Type:

OP

property t_final

To enforce final time

Type:

float