Multi Converters

The Multi Converters allow to include an arbitrary number of (discrete or continuous) subconverters for the use in e.g. the Externally Excited Dc Motor. Subconverters must be ‘elementary’ and can not be Multi Converters.

Discrete Multi Converter

class gym_electric_motor.physical_systems.converters.FiniteMultiConverter(subconverters, **kwargs)[source]

Converter that allows to include an arbitrary number of independent finite subconverters. Subconverters must be ‘elementary’ and can not be MultiConverters.

Key:

‘Finite-Multi’

Actions:

Concatenation of the subconverters’ action spaces

Action Space:

MultiDiscrete([subconverter[0].action_space.n , subconverter[1].action_space.n, …])

Output Voltage Space:
Box([subconverter[0].voltages.low, subconverter[1].voltages.low, …],

[subconverter[0].voltages.high, subconverter[1].voltages.high, …])

Parameters:
  • subconverters (list(str/class/object) – Subconverters to instantiate .

  • kwargs (dict) – Parameters to pass to the Subconverters and the superclass

action_space = None

gymnasium.Space that defines the set of all possible actions for the converter

convert(i_out, t)[source]

The conversion function that converts the previously set action to an input voltage for the motor. This function has to be called at least at every previously defined switching time, because the input voltage for the motor might change at these times.

Parameters:
  • i_out (list(float)) – All currents that flow out of the converter into the motor.

  • t (float) – Current time of the system.

Returns:

List of all input voltages at the motor.

Return type:

list(float)

currents = None

gymnasium.Space that defines Minimum, Maximum and Dimension of possible output current of the converter

i_sup(i_out)[source]

Calculate the current, the converter takes from the supply for the given output currents and the current switching state.

Parameters:

i_out (list(float)) – All currents flowing out of the converter and into the motor.

Returns:

The current drawn from the supply.

Return type:

float

reset()[source]

Reset all converter states to a default.

Returns:

A default output voltage after reset(=0V).

Return type:

list(float)

set_action(action, t)[source]

Set the next action of the converter at the beginning of a simulation step in the system.

Parameters:
  • action (element of action_space) – The control action on the converter.

  • t (float) – Time at the beginning of the simulation step in seconds.

Returns:

Times when a switching action occurs and the conversion function must be called by the system.

Return type:

list(float)

property tau

Time of one simulation step in seconds.

Type:

Float

voltages = None

gymnasium.Space that defines Minimum, Maximum and Dimension of possible output voltage of the converter

Continuous Multi Converter

class gym_electric_motor.physical_systems.converters.ContMultiConverter(subconverters, **kwargs)[source]

Converter that allows to include an arbitrary number of independent continuous sub-converters. Sub-converters must be ‘elementary’ and can not be MultiConverters.

Key:

‘Cont-Multi’

Actions:

Concatenation of the subconverters’ action spaces

Action Space:
Box([subconverter[0].action_space.low, subconverter[1].action_space.low, …],

[subconverter[0].action_space.high, subconverter[1].action_space.high, …])

Output Voltage Space:
Box([subconverter[0].voltages.low, subconverter[1].voltages.low, …],

[subconverter[0].voltages.high, subconverter[1].voltages.high, …])

Parameters:
  • subconverters (list(str/class/object) – Subconverters to instantiate .

  • kwargs (dict) – Parameters to pass to the Subconverters

action_space = None

gymnasium.Space that defines the set of all possible actions for the converter

convert(i_out, t)[source]

The conversion function that converts the previously set action to an input voltage for the motor. This function has to be called at least at every previously defined switching time, because the input voltage for the motor might change at these times.

Parameters:
  • i_out (list(float)) – All currents that flow out of the converter into the motor.

  • t (float) – Current time of the system.

Returns:

List of all input voltages at the motor.

Return type:

list(float)

currents = None

gymnasium.Space that defines Minimum, Maximum and Dimension of possible output current of the converter

i_sup(i_out)[source]

Calculate the current, the converter takes from the supply for the given output currents and the current switching state.

Parameters:

i_out (list(float)) – All currents flowing out of the converter and into the motor.

Returns:

The current drawn from the supply.

Return type:

float

reset()[source]

Reset all converter states to a default.

Returns:

A default output voltage after reset(=0V).

Return type:

list(float)

set_action(action, t)[source]

Set the next action of the converter at the beginning of a simulation step in the system.

Parameters:
  • action (element of action_space) – The control action on the converter.

  • t (float) – Time at the beginning of the simulation step in seconds.

Returns:

Times when a switching action occurs and the conversion function must be called by the system.

Return type:

list(float)

property tau

Time of one simulation step in seconds.

Type:

Float

voltages = None

gymnasium.Space that defines Minimum, Maximum and Dimension of possible output voltage of the converter