diff --git a/_modules/gym_electric_motor/callbacks.html b/_modules/gym_electric_motor/callbacks.html index 7acbdeb4..66a440df 100644 --- a/_modules/gym_electric_motor/callbacks.html +++ b/_modules/gym_electric_motor/callbacks.html @@ -3,17 +3,18 @@ - gym_electric_motor.callbacks — gym-electric-motor 2021 documentation - + gym_electric_motor.callbacks — gym-electric-motor 2021 documentation + + - + - + + - - + @@ -38,11 +39,11 @@ diff --git a/_modules/gym_electric_motor/physical_systems/physical_systems.html b/_modules/gym_electric_motor/physical_systems/physical_systems.html index 06a4eda2..d32102e7 100644 --- a/_modules/gym_electric_motor/physical_systems/physical_systems.html +++ b/_modules/gym_electric_motor/physical_systems/physical_systems.html @@ -3,17 +3,18 @@ - gym_electric_motor.physical_systems.physical_systems — gym-electric-motor 2021 documentation - + gym_electric_motor.physical_systems.physical_systems — gym-electric-motor 2021 documentation + + - + - + + - - + @@ -38,11 +39,11 @@ + system_state = np.concatenate( + ( + mechanical_state, + [torque], + i_abc, + i_dq, + u_abc, + u_dq, + [eps], + u_sup, + ) + ) + return system_state / self._limits -class ExternallyExcitedSynchronousMotorSystem(SynchronousMotorSystem): - """SCML-System that can be used with the externally excited synchronous motor (EESM)""" +class ExternallyExcitedSynchronousMotorSystem(SynchronousMotorSystem): + """SCML-System that can be used with the externally excited synchronous motor (EESM)""" def _build_state_space(self, state_names): # Docstring of superclass @@ -647,21 +657,34 @@

Source code for gym_electric_motor.physical_systems.physical_systems

def _build_state_names(self): # Docstring of superclass - return self._mechanical_load.state_names \ - + [ - 'torque', 'i_a', 'i_b', 'i_c', 'i_sd', 'i_sq', 'i_e', - 'u_a', 'u_b', 'u_c', 'u_sd', 'u_sq', 'u_e', - 'epsilon', 'u_sup' + return self._mechanical_load.state_names + [ + "torque", + "i_a", + "i_b", + "i_c", + "i_sd", + "i_sq", + "i_e", + "u_a", + "u_b", + "u_c", + "u_sd", + "u_sq", + "u_e", + "epsilon", + "u_sup", ] - def _set_indices(self): # Docstring of superclass self._omega_ode_idx = self._mechanical_load.OMEGA_IDX self._load_ode_idx = list(range(len(self._mechanical_load.state_names))) - self._ode_currents_idx = list(range( - self._load_ode_idx[-1] + 1, self._load_ode_idx[-1] + 1 + len(self._electrical_motor.CURRENTS) - )) + self._ode_currents_idx = list( + range( + self._load_ode_idx[-1] + 1, + self._load_ode_idx[-1] + 1 + len(self._electrical_motor.CURRENTS), + ) + ) self._motor_ode_idx = self._ode_currents_idx self._motor_ode_idx += [self._motor_ode_idx[-1] + 1] self._ode_currents_idx = self._motor_ode_idx[:-1] @@ -696,7 +719,7 @@

Source code for gym_electric_motor.physical_systems.physical_systems

eps = ode_state[self._ode_epsilon_idx] i_in_dq_e = self._electrical_motor.i_in(ode_state[self._ode_currents_idx]) i_in_abc_e = list(self.dq_to_abc_space(i_in_dq_e[:2], eps)) + i_in_dq_e[2:] - + i_sup = self._converter.i_sup(i_in_abc_e) u_sup = self._supply.get_voltage(self._t, i_sup) u_in = self._converter.convert(i_in_abc_e, self._ode_solver.t) @@ -709,32 +732,22 @@

Source code for gym_electric_motor.physical_systems.physical_systems

torque = self._electrical_motor.torque(ode_state[self._motor_ode_idx]) mechanical_state = ode_state[self._load_ode_idx] i_dq_e = ode_state[self._ode_currents_idx] - i_abc = list( - self.dq_to_abc_space(i_dq_e[:2], eps) - ) + i_abc = list(self.dq_to_abc_space(i_dq_e[:2], eps)) eps = ode_state[self._ode_epsilon_idx] % (2 * np.pi) if eps > np.pi: eps -= 2 * np.pi - system_state = np.concatenate(( - mechanical_state, - [torque], - i_abc, i_dq_e, - u_in[:3], u_dq_e, - [eps], - u_sup - )) + system_state = np.concatenate((mechanical_state, [torque], i_abc, i_dq_e, u_in[:3], u_dq_e, [eps], u_sup)) return system_state / self._limits def reset(self, *_): # Docstring of superclass - motor_state = self._electrical_motor.reset( - state_space=self.state_space, - state_positions=self.state_positions) + motor_state = self._electrical_motor.reset(state_space=self.state_space, state_positions=self.state_positions) mechanical_state = self._mechanical_load.reset( state_positions=self.state_positions, state_space=self.state_space, - nominal_state=self.nominal_state) + nominal_state=self.nominal_state, + ) ode_state = np.concatenate((mechanical_state, motor_state)) u_sup = self.supply.reset() eps = ode_state[self._ode_epsilon_idx] @@ -749,29 +762,35 @@

Source code for gym_electric_motor.physical_systems.physical_systems

self._t = 0 self._k = 0 self._ode_solver.set_initial_value(ode_state, self._t) - system_state = np.concatenate(( - mechanical_state, - [torque], - i_abc, i_dq, - u_abc, u_dq, - [eps], - u_sup, - )) + system_state = np.concatenate( + ( + mechanical_state, + [torque], + i_abc, + i_dq, + u_abc, + u_dq, + [eps], + u_sup, + ) + ) return system_state / self._limits +
[docs]class SquirrelCageInductionMotorSystem(ThreePhaseMotorSystem): - """ + """ SCML-System for the Squirrel Cage Induction Motor """ - def __init__(self, control_space='abc', ode_solver='scipy.ode', **kwargs): - """ + + def __init__(self, control_space="abc", ode_solver="scipy.ode", **kwargs): + """ Args: control_space(str):('abc' or 'dq') Choose, if actions the actions space is in dq or abc space kwargs: Further arguments to pass tp SCMLSystem """ super().__init__(ode_solver=ode_solver, **kwargs) self.control_space = control_space - if control_space == 'dq': + if control_space == "dq": self._action_space = Box(-1, 1, shape=(2,), dtype=np.float64) def _build_state_space(self, state_names): @@ -783,22 +802,37 @@

Source code for gym_electric_motor.physical_systems.physical_systems

def _build_state_names(self): # Docstring of superclass - return ( - self._mechanical_load.state_names + ['torque', - 'i_sa', 'i_sb', 'i_sc', 'i_sd', 'i_sq', - 'u_sa', 'u_sb', 'u_sc', 'u_sd', 'u_sq', - 'epsilon', 'u_sup', - ] - ) + return self._mechanical_load.state_names + [ + "torque", + "i_sa", + "i_sb", + "i_sc", + "i_sd", + "i_sq", + "u_sa", + "u_sb", + "u_sc", + "u_sd", + "u_sq", + "epsilon", + "u_sup", + ] def _set_indices(self): # Docstring of superclass super()._set_indices() - self._motor_ode_idx += range(self._motor_ode_idx[-1] + 1, self._motor_ode_idx[-1] + 1 + len(self._electrical_motor.FLUXES)) + self._motor_ode_idx += range( + self._motor_ode_idx[-1] + 1, + self._motor_ode_idx[-1] + 1 + len(self._electrical_motor.FLUXES), + ) self._motor_ode_idx += [self._motor_ode_idx[-1] + 1] - self._ode_currents_idx = self._motor_ode_idx[self._electrical_motor.I_SALPHA_IDX:self._electrical_motor.I_SBETA_IDX + 1] - self._ode_flux_idx = self._motor_ode_idx[self._electrical_motor.PSI_RALPHA_IDX:self._electrical_motor.PSI_RBETA_IDX + 1] + self._ode_currents_idx = self._motor_ode_idx[ + self._electrical_motor.I_SALPHA_IDX : self._electrical_motor.I_SBETA_IDX + 1 + ] + self._ode_flux_idx = self._motor_ode_idx[ + self._electrical_motor.PSI_RALPHA_IDX : self._electrical_motor.PSI_RBETA_IDX + 1 + ] self.OMEGA_IDX = self.mechanical_load.OMEGA_IDX self.TORQUE_IDX = len(self.mechanical_load.state_names) @@ -824,7 +858,7 @@

Source code for gym_electric_motor.physical_systems.physical_systems

eps_fs = self.calculate_field_angle(ode_state) - if self.control_space == 'dq': + if self.control_space == "dq": action = self.dq_to_abc_space(action, eps_fs) i_in = self.alphabeta_to_abc_space(self._electrical_motor.i_in(ode_state[self._ode_currents_idx])) @@ -860,13 +894,7 @@

Source code for gym_electric_motor.physical_systems.physical_systems

if eps > np.pi: eps -= 2 * np.pi - system_state = np.concatenate(( - mechanical_state, [torque], - i_abc, i_dq, - u_in, u_dq, - [eps], - u_sup - )) + system_state = np.concatenate((mechanical_state, [torque], i_abc, i_dq, u_in, u_dq, [eps], u_sup)) return system_state / self._limits
[docs] def reset(self, *_): @@ -874,11 +902,13 @@

Source code for gym_electric_motor.physical_systems.physical_systems

mechanical_state = self._mechanical_load.reset( state_positions=self.state_positions, state_space=self.state_space, - nominal_state=self.nominal_state) + nominal_state=self.nominal_state, + ) motor_state = self._electrical_motor.reset( state_space=self.state_space, state_positions=self.state_positions, - omega=mechanical_state) + omega=mechanical_state, + ) ode_state = np.concatenate((mechanical_state, motor_state)) u_sup = self.supply.reset() @@ -897,22 +927,17 @@

Source code for gym_electric_motor.physical_systems.physical_systems

self._t = 0 self._k = 0 self._ode_solver.set_initial_value(ode_state, self._t) - system_state = np.concatenate([ - mechanical_state, [torque], - i_abc, i_dq, - u_abc, u_dq, - [eps], - u_sup - ]) + system_state = np.concatenate([mechanical_state, [torque], i_abc, i_dq, u_abc, u_dq, [eps], u_sup]) return system_state / self._limits
[docs]class DoublyFedInductionMotorSystem(ThreePhaseMotorSystem): - """ + """ SCML-System for the Doubly Fed Induction Motor """ - def __init__(self, ode_solver='scipy.ode', **kwargs): - """ + + def __init__(self, ode_solver="scipy.ode", **kwargs): + """ Args: kwargs: Further arguments to pass tp SCMLSystem """ @@ -920,23 +945,23 @@

Source code for gym_electric_motor.physical_systems.physical_systems

self.stator_voltage_space_idx = 0 self.stator_voltage_low_idx = 0 - self.stator_voltage_high_idx = \ - self.stator_voltage_low_idx \ - + self._converter.subsignal_voltage_space_dims[self.stator_voltage_space_idx] + self.stator_voltage_high_idx = ( + self.stator_voltage_low_idx + self._converter.subsignal_voltage_space_dims[self.stator_voltage_space_idx] + ) self.rotor_voltage_space_idx = 1 self.rotor_voltage_low_idx = self.stator_voltage_high_idx - self.rotor_voltage_high_idx = \ - self.rotor_voltage_low_idx \ - + self._converter.subsignal_voltage_space_dims[self.rotor_voltage_space_idx] + self.rotor_voltage_high_idx = ( + self.rotor_voltage_low_idx + self._converter.subsignal_voltage_space_dims[self.rotor_voltage_space_idx] + ) def _set_limits(self): - """Method to set the physical limits from the modules.""" + """Method to set the physical limits from the modules.""" for ind, state in enumerate(self._state_names): motor_lim = self._electrical_motor.limits.get(state, np.inf) mechanical_lim = self._mechanical_load.limits.get(state, np.inf) self._limits[ind] = min(motor_lim, mechanical_lim) - self._limits[self._state_positions['u_sup']] = self.supply.u_nominal + self._limits[self._state_positions["u_sup"]] = self.supply.u_nominal def _build_state_space(self, state_names): # Docstring of superclass @@ -947,26 +972,48 @@

Source code for gym_electric_motor.physical_systems.physical_systems

def _build_state_names(self): # Docstring of superclass - names_l = \ - self._mechanical_load.state_names \ - + [ - 'torque', - 'i_sa', 'i_sb', 'i_sc', 'i_sd', 'i_sq', - 'i_ra', 'i_rb', 'i_rc', 'i_rd', 'i_rq', - 'u_sa', 'u_sb', 'u_sc', 'u_sd', 'u_sq', - 'u_ra', 'u_rb', 'u_rc', 'u_rd', 'u_rq', - 'epsilon', 'u_sup', - ] + names_l = self._mechanical_load.state_names + [ + "torque", + "i_sa", + "i_sb", + "i_sc", + "i_sd", + "i_sq", + "i_ra", + "i_rb", + "i_rc", + "i_rd", + "i_rq", + "u_sa", + "u_sb", + "u_sc", + "u_sd", + "u_sq", + "u_ra", + "u_rb", + "u_rc", + "u_rd", + "u_rq", + "epsilon", + "u_sup", + ] return names_l def _set_indices(self): # Docstring of superclass super()._set_indices() - self._motor_ode_idx += range(self._motor_ode_idx[-1] + 1, self._motor_ode_idx[-1] + 1 + len(self._electrical_motor.FLUXES)) + self._motor_ode_idx += range( + self._motor_ode_idx[-1] + 1, + self._motor_ode_idx[-1] + 1 + len(self._electrical_motor.FLUXES), + ) self._motor_ode_idx += [self._motor_ode_idx[-1] + 1] - self._ode_currents_idx = self._motor_ode_idx[self._electrical_motor.I_SALPHA_IDX:self._electrical_motor.I_SBETA_IDX + 1] - self._ode_flux_idx = self._motor_ode_idx[self._electrical_motor.PSI_RALPHA_IDX:self._electrical_motor.PSI_RBETA_IDX + 1] + self._ode_currents_idx = self._motor_ode_idx[ + self._electrical_motor.I_SALPHA_IDX : self._electrical_motor.I_SBETA_IDX + 1 + ] + self._ode_flux_idx = self._motor_ode_idx[ + self._electrical_motor.PSI_RALPHA_IDX : self._electrical_motor.PSI_RBETA_IDX + 1 + ] self.OMEGA_IDX = self.mechanical_load.OMEGA_IDX self.TORQUE_IDX = len(self.mechanical_load.state_names) @@ -991,15 +1038,15 @@

Source code for gym_electric_motor.physical_systems.physical_systems

def calculate_rotor_current(self, state): # rotor current is calculated from states mp = self._electrical_motor.motor_parameter - l_r = mp['l_m'] + mp['l_sigr'] + l_r = mp["l_m"] + mp["l_sigr"] i_salpha = state[self._motor_ode_idx[self._electrical_motor.I_SALPHA_IDX]] i_sbeta = state[self._motor_ode_idx[self._electrical_motor.I_SBETA_IDX]] psi_ralpha = state[self._motor_ode_idx[self._electrical_motor.PSI_RALPHA_IDX]] psi_rbeta = state[self._motor_ode_idx[self._electrical_motor.PSI_RBETA_IDX]] - i_ralpha = 1 / l_r * psi_ralpha - mp['l_m'] / l_r * i_salpha - i_rbeta = 1 / l_r * psi_rbeta - mp['l_m'] / l_r * i_sbeta + i_ralpha = 1 / l_r * psi_ralpha - mp["l_m"] / l_r * i_salpha + i_rbeta = 1 / l_r * psi_rbeta - mp["l_m"] / l_r * i_sbeta return [i_ralpha, i_rbeta]
[docs] def simulate(self, action, *_, **__): @@ -1028,9 +1075,9 @@

Source code for gym_electric_motor.physical_systems.physical_systems

u_sup = self._supply.get_voltage(self._t, i_sup) u_in = self._converter.convert(np.concatenate([i_sabc, i_rdef]).tolist(), self._ode_solver.t) u_in = [u * u_s for u in u_in for u_s in u_sup] - u_sabc = u_in[self.stator_voltage_low_idx:self.stator_voltage_high_idx] - u_rdef = u_in[self.rotor_voltage_low_idx:self.rotor_voltage_high_idx] - u_rdq = self.abc_to_dq_space(u_rdef, eps_field-eps_el) + u_sabc = u_in[self.stator_voltage_low_idx : self.stator_voltage_high_idx] + u_rdef = u_in[self.rotor_voltage_low_idx : self.rotor_voltage_high_idx] + u_rdq = self.abc_to_dq_space(u_rdef, eps_field - eps_el) u_salphabeta = self.abc_to_alphabeta_space(u_sabc) u_ralphabeta = self.dq_to_alphabeta_space(u_rdq, eps_field) @@ -1042,15 +1089,15 @@

Source code for gym_electric_motor.physical_systems.physical_systems

eps_el = ode_state[self._ode_epsilon_idx] i_sabc = self.alphabeta_to_abc_space(self._electrical_motor.i_in(ode_state[self._ode_currents_idx])) i_rdef = self.alphabeta_to_abc_space(self.calculate_rotor_current(ode_state)) - + i_sup = self._converter.i_sup(np.concatenate((i_sabc, i_rdef))) u_sup = self._supply.get_voltage(self._t, i_sup) u_in = self._converter.convert(np.concatenate([i_sabc, i_rdef]).tolist(), self._ode_solver.t) u_in = [u * u_s for u in u_in for u_s in u_sup] - u_sabc = u_in[self.stator_voltage_low_idx:self.stator_voltage_high_idx] - u_rdef = u_in[self.rotor_voltage_low_idx:self.rotor_voltage_high_idx] + u_sabc = u_in[self.stator_voltage_low_idx : self.stator_voltage_high_idx] + u_rdef = u_in[self.rotor_voltage_low_idx : self.rotor_voltage_high_idx] u_sdq = self.abc_to_dq_space(u_sabc, eps_field) - u_rdq = self.abc_to_dq_space(u_rdef, eps_field-eps_el) + u_rdq = self.abc_to_dq_space(u_rdef, eps_field - eps_el) u_salphabeta = self.abc_to_alphabeta_space(u_sabc) u_ralphabeta = self.dq_to_alphabeta_space(u_rdq, eps_field) @@ -1066,22 +1113,28 @@

Source code for gym_electric_motor.physical_systems.physical_systems

i_sabc = list(self.dq_to_abc_space(i_sdq, eps_field)) i_rdq = self.alphabeta_to_dq_space(self.calculate_rotor_current(ode_state), eps_field) - i_rdef = list(self.dq_to_abc_space(i_rdq, eps_field-eps_el)) + i_rdef = list(self.dq_to_abc_space(i_rdq, eps_field - eps_el)) eps_el = ode_state[self._ode_epsilon_idx] % (2 * np.pi) if eps_el > np.pi: eps_el -= 2 * np.pi - system_state = np.concatenate(( - mechanical_state, - [torque], - i_sabc, i_sdq, - i_rdef, i_rdq, - u_sabc, u_sdq, - u_rdef, u_rdq, - [eps_el], - u_sup, - )) + system_state = np.concatenate( + ( + mechanical_state, + [torque], + i_sabc, + i_sdq, + i_rdef, + i_rdq, + u_sabc, + u_sdq, + u_rdef, + u_rdq, + [eps_el], + u_sup, + ) + ) return system_state / self._limits
[docs] def reset(self, *_): @@ -1089,11 +1142,13 @@

Source code for gym_electric_motor.physical_systems.physical_systems

mechanical_state = self._mechanical_load.reset( state_positions=self.state_positions, state_space=self.state_space, - nominal_state=self.nominal_state) + nominal_state=self.nominal_state, + ) motor_state = self._electrical_motor.reset( state_space=self.state_space, state_positions=self.state_positions, - omega=mechanical_state) + omega=mechanical_state, + ) ode_state = np.concatenate((mechanical_state, motor_state)) u_sup = self.supply.reset() @@ -1108,30 +1163,37 @@

Source code for gym_electric_motor.physical_systems.physical_systems

u_sr_abcdef = self.converter.reset() u_sr_abcdef = [u * u_s for u in u_sr_abcdef for u_s in u_sup] - u_sabc = u_sr_abcdef[self.stator_voltage_low_idx:self.stator_voltage_high_idx] - u_rdef = u_sr_abcdef[self.rotor_voltage_low_idx:self.rotor_voltage_high_idx] + u_sabc = u_sr_abcdef[self.stator_voltage_low_idx : self.stator_voltage_high_idx] + u_rdef = u_sr_abcdef[self.rotor_voltage_low_idx : self.rotor_voltage_high_idx] u_sdq = self.abc_to_dq_space(u_sabc, eps_field) - u_rdq = self.abc_to_dq_space(u_rdef, eps_field-eps_el) + u_rdq = self.abc_to_dq_space(u_rdef, eps_field - eps_el) i_sdq = self.alphabeta_to_dq_space(ode_state[self._ode_currents_idx], eps_field) i_sabc = self.dq_to_abc_space(i_sdq, eps_field) - i_rdq = self.alphabeta_to_dq_space(self.calculate_rotor_current(ode_state), eps_field-eps_el) - i_rdef = self.dq_to_abc_space(i_rdq, eps_field-eps_el) + i_rdq = self.alphabeta_to_dq_space(self.calculate_rotor_current(ode_state), eps_field - eps_el) + i_rdef = self.dq_to_abc_space(i_rdq, eps_field - eps_el) torque = self.electrical_motor.torque(motor_state) self._t = 0 self._k = 0 self._ode_solver.set_initial_value(ode_state, self._t) - system_state = np.concatenate([ - mechanical_state, [torque], - i_sabc, i_sdq, - i_rdef, i_rdq, - u_sabc, u_sdq, - u_rdef, u_rdq, - [eps_el], - u_sup - ]) + system_state = np.concatenate( + [ + mechanical_state, + [torque], + i_sabc, + i_sdq, + i_rdef, + i_rdq, + u_sabc, + u_sdq, + u_rdef, + u_rdq, + [eps_el], + u_sup, + ] + ) return system_state / self._limits
diff --git a/_modules/gym_electric_motor/physical_systems/solvers.html b/_modules/gym_electric_motor/physical_systems/solvers.html index e6eef029..cd1004ec 100644 --- a/_modules/gym_electric_motor/physical_systems/solvers.html +++ b/_modules/gym_electric_motor/physical_systems/solvers.html @@ -3,17 +3,18 @@ - gym_electric_motor.physical_systems.solvers — gym-electric-motor 2021 documentation - + gym_electric_motor.physical_systems.solvers — gym-electric-motor 2021 documentation + + - + - + + - - + @@ -38,11 +39,11 @@ -
-

Electric Motor Base Environment

+
+

Electric Motor Base Environment

+

On the core level the electric motor environment and the interface to its submodules are defined. By using these +interfaces further reference generators, reward functions, visualizations or physical models can be implemented.

+

Each ElectricMotorEnvironment contains the five following modules:

+
    +
  • +
    PhysicalSystem
      +
    • Specification and simulation of the physical model. Furthermore, specifies limits and nominal values for all of its state_variables.

    • +
    +
    +
    +
  • +
  • +
    ReferenceGenerator
      +
    • Calculation of reference trajectories for one or more states of the physical systems state_variables.

    • +
    +
    +
    +
  • +
  • +
    ConstraintMonitor
      +
    • Observation of the PhysicalSystems state to comply to a set of user defined constraints.

    • +
    +
    +
    +
  • +
  • +
    RewardFunction
      +
    • Calculation of the reward based on the physical systems state and the reference.* ElectricMotorVisualization

    • +
    • Visualization of the PhysicalSystems state, reference and reward for the user.

    • +
    +
    +
    +
  • +
../../_images/TopLevelStructure.svg
+
+
+class gym_electric_motor.core.ElectricMotorEnvironment(physical_system, reference_generator, reward_function, visualization=(), state_filter=None, callbacks=(), constraints=(), physical_system_wrappers=(), scale_plots=False, **kwargs)[source]
+
+
Description:

The main class connecting all modules of the gym-electric-motor environments.

+
+
+

Modules:

+
+
+
Physical System:

Containing the physical structure and simulation of the drive system as well as information about the +technical limits and nominal values. Needs to be a subclass of PhysicalSystem

+
+
Reference Generator:

Generation of the reference for the motor to follow. Needs to be a subclass of ReferenceGenerator

+
+
Reward Function:

Calculation of the reward based on the state of the physical system and the generated reference +and observation if the motor state is within the limits. Needs to be a subclass of RewardFunction.

+
+
Visualization:

Visualization of the motors states. Needs to be a subclass of ElectricMotorVisualization

+
+
Limits:

Returns a list of limits of all states in the observation (called in state_filter) in the same order.

+
+
+
+
+
State Variables:

Each environment has got a list of state variables that are defined by the physical system. +These define the names and order for all further state arrays in the modules. These states are announced to the +other modules by announcing the physical system to them, which contains the property state_names.

+
+
Example:

['omega', 'torque','i', 'u', 'u_sup']

+
+
+
+
Observation:
+
Type: Tuple(State_Space, Reference_Space)

The observation is always a tuple of the State Space of the Physical System and the Reference Space of the +Reference Generator. In all current Physical Systems and Reference Generators these Spaces are normalized, +continuous, multidimensional boxes in [-1, 1] or [0, 1].

+
+
+
+
Actions:
+
Type: Discrete() / Box()

The action space of the environments are the action spaces of the physical systems. In all current physical +systems the action spaces are specified by its PowerElectronicConverter and either a continuous, +multidimensional box or discrete.

+
+
+
+
Reward:

The reward and the reward range are specified by the RewardFunction. In general the reward is higher the closer +the motor state follows the reference trajectories.

+
+
Starting State:

The physical system and the reference generator define the starting state.

+
+
Episode Termination:

Episode terminations can be initiated by the reference generator, or the reward function. +A reference generator might terminate an episode, if the reference has ended. +The reward function can terminate an episode, if a physical limit of the motor has been violated.

+
+
+

Setting and initialization of all environments’ modules.

+
+
Parameters:
+
    +
  • physical_system (PhysicalSystem) – The physical system of this environment.

  • +
  • reference_generator (ReferenceGenerator) – The reference generator of this environment.

  • +
  • reward_function (RewardFunction) – The reward function of this environment.

  • +
  • visualization (iterable(ElectricMotorVisualization)/None) – The visualization of this environment.

  • +
  • constraints (list(Constraint/str/callable) / ConstraintMonitor) –

    A list of constraints +or an already initialized ConstraintMonitor object can be passed here.

    +
    +
      +
    • list(Constraint/str/callable): Pass a list with initialized Constraints and/or state names. Then,

    • +
    +

    a ConstraintMonitor object with the Constraints and additional LimitConstraints on the passed names +is created. Furthermore, the string ‘all’ inside the list will create a ConstraintMonitor that +observes the limit on each state. +- ConstraintMonitor: Pass an initialized ConstraintMonitor object that will be used directly as

    +
    +

    ConstraintMonitor in the environment.

    +
    +
    +

  • +
  • visualization – The visualizations of this environment.

  • +
  • state_filter (list(str)) – Selection of states that are shown in the observation.

  • +
  • physical_system_wrappers (iterable(PhysicalSystemWrapper)) – PhysicalSystemWrapper instances to be wrapped around +the physical system.

  • +
  • callbacks (list(Callback)) – Callbacks being called in the environment

  • +
  • **kwargs – Arguments to be passed to the modules.

  • +
+
+
+
+
+close()[source]
+

Called when the environment is deleted. Closes all its modules.

+
+ +
+
+property constraint_monitor
+

The ConstraintMonitor of the environment.

+
+
Type:
+

Returns(ConstraintMonitor)

+
+
+
+ +
+
+property limits
+

Returns a list of limits of all states in the observation (called in state_filter) in the same order

+
+ +
+
+property nominal_state
+

Returns a list of nominal values of all states in the observation (called in state_filter) in that order

+
+ +
+
+property physical_system
+

Returns: +PhysicalSystem: The Physical System of the Environment

+
+ +
+
+property reference_generator
+

Returns: +ReferenceGenerator: The ReferenceGenerator of the Environment

+
+ +
+
+property reference_names
+

Returns a list of state names of all states in the observation (called in state_filter) in the same order

+
+ +
+
+render(*_, **__)[source]
+

Update the visualization of the motor.

+
+ +
+
+reset(seed=None, options=None, *_, **__)[source]
+

Reset of the environment and all its modules to an initial state.

+
+
Returns:
+

The initial observation consisting of the initial state and initial reference. +info(dict): Auxiliary information (optional)

+
+
+
+ +
+
+property reward_function
+

Returns: +RewardFunction: The RewardFunction of the environment

+
+ +
+
+property state_names
+

Returns a list of state names of all states in the observation (called in state_filter) in the same order

+
+ +
+
+step(action)[source]
+

Perform one simulation step of the environment with an action of the action space.

+
+
Parameters:
+

action – Action to play on the environment.

+
+
Returns:
+

Tuple of the new state and the next reference. +reward(float): Amount of reward received for the last step. +terminated(bool): Flag, indicating if a reset is required before new steps can be taken. +info(dict): Auxiliary information (optional)

+
+
Return type:
+

observation(Tuple(ndarray(float),ndarray(float))

+
+
+
+ +
+
+property visualizations
+

Returns a list of all active motor visualizations.

+
+ +
+
diff --git a/parts/environments/extex_dc/cont_cc_extex.html b/parts/environments/extex_dc/cont_cc_extex.html index 3b058b72..b2819daf 100644 --- a/parts/environments/extex_dc/cont_cc_extex.html +++ b/parts/environments/extex_dc/cont_cc_extex.html @@ -107,6 +107,119 @@

Continuous Current Control DC Externally Excited Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlDcExternallyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set current controlled externally excited DC Motor

+
+
Key:

'Cont-CC-ExtExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u_a', 'u_e', 'u_sup']

+
+
Reference Variables:

['i_a', 'i_e']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-ExtExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/extex_dc/cont_sc_extex.html b/parts/environments/extex_dc/cont_sc_extex.html index ba24d460..13f61d8d 100644 --- a/parts/environments/extex_dc/cont_sc_extex.html +++ b/parts/environments/extex_dc/cont_sc_extex.html @@ -107,6 +107,119 @@

Continuous Speed Control DC Externally Excited Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlDcExternallyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set speed controlled externally excited DC Motor

+
+
Key:

'Cont-SC-ExtExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u_a', 'u_e', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-ExtExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/extex_dc/cont_tc_extex.html b/parts/environments/extex_dc/cont_tc_extex.html index f249da2f..a2f9818c 100644 --- a/parts/environments/extex_dc/cont_tc_extex.html +++ b/parts/environments/extex_dc/cont_tc_extex.html @@ -107,6 +107,119 @@

Continuous Torque Control DC Externally Excited Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlDcExternallyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set torque controlled externally excited DC Motor

+
+
Key:

'Cont-TC-ExtExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u_a', 'u_e', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-ExtExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/extex_dc/extex_dc_envs.html b/parts/environments/extex_dc/extex_dc_envs.html index e275095e..c3fa1925 100644 --- a/parts/environments/extex_dc/extex_dc_envs.html +++ b/parts/environments/extex_dc/extex_dc_envs.html @@ -109,12 +109,30 @@

Externally Excited DC Motor Environments

Environments:

diff --git a/parts/environments/extex_dc/finite_cc_extex.html b/parts/environments/extex_dc/finite_cc_extex.html index b128e389..c4858a45 100644 --- a/parts/environments/extex_dc/finite_cc_extex.html +++ b/parts/environments/extex_dc/finite_cc_extex.html @@ -107,6 +107,119 @@

Finite Control Set Current Control DC Externally Excited Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlDcExternallyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled externally excited DC Motor

+
+
Key:

'Finite-CC-ExtExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u_a', 'u_e', 'u_sup']

+
+
Reference Variables:

['i_a', 'i_e']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

MultiDiscrete((4,4))

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-ExtExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/extex_dc/finite_sc_extex.html b/parts/environments/extex_dc/finite_sc_extex.html index ed27582e..466bb7e1 100644 --- a/parts/environments/extex_dc/finite_sc_extex.html +++ b/parts/environments/extex_dc/finite_sc_extex.html @@ -107,6 +107,119 @@

Finite Control Set Speed Control DC Externally Excited Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlDcExternallyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled externally excited DC Motor

+
+
Key:

'Finite-SC-ExtExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u_a', 'u_e', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

MultiDiscrete((4,4))

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-ExtExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/extex_dc/finite_tc_extex.html b/parts/environments/extex_dc/finite_tc_extex.html index 72738fdf..74247585 100644 --- a/parts/environments/extex_dc/finite_tc_extex.html +++ b/parts/environments/extex_dc/finite_tc_extex.html @@ -107,6 +107,119 @@

Finite Control Set Torque Control DC Externally Excited Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlDcExternallyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled externally excited DC Motor

+
+
Key:

'Finite-TC-ExtExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u_a', 'u_e', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

MultiDiscrete((4,4))

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-ExtExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/cont_cc_permex.html b/parts/environments/permex_dc/cont_cc_permex.html index 9a37bf97..71c0e8b1 100644 --- a/parts/environments/permex_dc/cont_cc_permex.html +++ b/parts/environments/permex_dc/cont_cc_permex.html @@ -107,6 +107,119 @@

Continuous Current Control DC Permanently Excited Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlDcPermanentlyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set current controlled permanently excited DC Motor

+
+
Key:

'Cont-CC-PermExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Valiables:

['i']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1], high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Cont-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-PermExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/cont_sc_permex.html b/parts/environments/permex_dc/cont_sc_permex.html index 90f0a470..af891590 100644 --- a/parts/environments/permex_dc/cont_sc_permex.html +++ b/parts/environments/permex_dc/cont_sc_permex.html @@ -107,6 +107,119 @@

Continuous Speed Control DC Permanently Excited Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlDcPermanentlyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set speed controlled permanently excited DC Motor.

+
+
Key:

'Cont-SC-PermExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1], high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Cont-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-PermExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver dor the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/cont_tc_permex.html b/parts/environments/permex_dc/cont_tc_permex.html index d9494092..9391e6e7 100644 --- a/parts/environments/permex_dc/cont_tc_permex.html +++ b/parts/environments/permex_dc/cont_tc_permex.html @@ -107,6 +107,119 @@

Continuous Torque Control DC Permanently Excited Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlDcPermanentlyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set torque controlled permanently excited DC Motor

+
+
Key:

'Cont-TC-PermExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1], high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Cont-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-PermExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver dor the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/finite_cc_permex.html b/parts/environments/permex_dc/finite_cc_permex.html index c78bb84d..91a03ee0 100644 --- a/parts/environments/permex_dc/finite_cc_permex.html +++ b/parts/environments/permex_dc/finite_cc_permex.html @@ -107,6 +107,119 @@

Finite Control Set Current Control DC Permanently Excited Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlDcPermanentlyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled permanently excited DC Motor

+
+
Key:

'Finite-CC-PermExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Valiables:

['i']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1], high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Cont-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-PermExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver dor the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/finite_sc_permex.html b/parts/environments/permex_dc/finite_sc_permex.html index 51ad12ae..e8563c27 100644 --- a/parts/environments/permex_dc/finite_sc_permex.html +++ b/parts/environments/permex_dc/finite_sc_permex.html @@ -107,6 +107,119 @@

Finite Control Set Speed Control DC Permanently Excited Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlDcPermanentlyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled permanently excited DC Motor

+
+
Key:

'Finite-SC-PermExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1], high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-SC-PermExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver dor the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/finite_tc_permex.html b/parts/environments/permex_dc/finite_tc_permex.html index b30b3b49..6e2e8040 100644 --- a/parts/environments/permex_dc/finite_tc_permex.html +++ b/parts/environments/permex_dc/finite_tc_permex.html @@ -107,6 +107,119 @@

Finite Control Set Torque Control DC Permanently Excited Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlDcPermanentlyExcitedMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled permanently excited DC Motor

+
+
Key:

'Finite-TC-PermExDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1], high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-PermExDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/permex_dc/permex_dc_envs.html b/parts/environments/permex_dc/permex_dc_envs.html index 0019ef42..c4235614 100644 --- a/parts/environments/permex_dc/permex_dc_envs.html +++ b/parts/environments/permex_dc/permex_dc_envs.html @@ -109,12 +109,30 @@

Permanently Excited DC Motor Environments

Environments:

diff --git a/parts/environments/pmsm/cont_cc_pmsm.html b/parts/environments/pmsm/cont_cc_pmsm.html index f3ab2f3b..10871fbd 100644 --- a/parts/environments/pmsm/cont_cc_pmsm.html +++ b/parts/environments/pmsm/cont_cc_pmsm.html @@ -107,6 +107,119 @@

Current Control Permanent Magnet Synchronous Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlPermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate an abc-domain continuous control set current controlled permanent magnet synchr. motor.

+
+
Key:

'Cont-CC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['i_sd', 'i_sq']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy-solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/pmsm/cont_sc_pmsm.html b/parts/environments/pmsm/cont_sc_pmsm.html index 948c3715..1813ac6b 100644 --- a/parts/environments/pmsm/cont_sc_pmsm.html +++ b/parts/environments/pmsm/cont_sc_pmsm.html @@ -107,6 +107,119 @@

Speed Control Permanent Magnet Synchronous Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlPermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a abc-domain continuous control set speed controlled permanent magnet synchr. motor.

+
+
Key:

'Cont-SC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/pmsm/cont_tc_pmsm.html b/parts/environments/pmsm/cont_tc_pmsm.html index f1c37b1e..85d5ab42 100644 --- a/parts/environments/pmsm/cont_tc_pmsm.html +++ b/parts/environments/pmsm/cont_tc_pmsm.html @@ -107,6 +107,119 @@

Torque Control Permanent Magnet Synchronous Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlPermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a abc-domain continuous control set torque controlled permanent magnet synchr. motor.

+
+
Key:

'Cont-TC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/pmsm/finite_cc_pmsm.html b/parts/environments/pmsm/finite_cc_pmsm.html index 44dc6159..558a60bf 100644 --- a/parts/environments/pmsm/finite_cc_pmsm.html +++ b/parts/environments/pmsm/finite_cc_pmsm.html @@ -107,6 +107,119 @@

Finite Control Set Current Control Permanent Magnet Synchronous Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlPermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled permanent magnet synchr. motor.

+
+
Key:

'Finite-CC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['i_sd', 'i_sq']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/pmsm/finite_sc_pmsm.html b/parts/environments/pmsm/finite_sc_pmsm.html index 89960223..ca0bffbf 100644 --- a/parts/environments/pmsm/finite_sc_pmsm.html +++ b/parts/environments/pmsm/finite_sc_pmsm.html @@ -107,6 +107,119 @@

Finite Control Set Speed Control Permanent Magnet Synchronous Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlPermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled permanent magnet synchr. motor.

+
+
Key:

'Finite-SC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-SC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/pmsm/finite_tc_pmsm.html b/parts/environments/pmsm/finite_tc_pmsm.html index 0bba3836..6e2762ce 100644 --- a/parts/environments/pmsm/finite_tc_pmsm.html +++ b/parts/environments/pmsm/finite_tc_pmsm.html @@ -107,6 +107,119 @@

Finite Control Set Torque Control Permanent Magnet Synchronous Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlPermanentMagnetSynchronousMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled permanent magnet synchr. motor.

+
+
Key:

'Finite-TC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/pmsm/pmsm_envs.html b/parts/environments/pmsm/pmsm_envs.html index 1a472168..2a5c7969 100644 --- a/parts/environments/pmsm/pmsm_envs.html +++ b/parts/environments/pmsm/pmsm_envs.html @@ -109,12 +109,30 @@

Permanent Magnet Synchronous Motor Environments

Environments:

diff --git a/parts/environments/scim/abccont_cc_scim.html b/parts/environments/scim/abccont_cc_scim.html index 3aaa8d4c..00ed4a1e 100644 --- a/parts/environments/scim/abccont_cc_scim.html +++ b/parts/environments/scim/abccont_cc_scim.html @@ -110,6 +110,126 @@

Abc-Continuous Current Control Squirrel Cage Induction Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlSquirrelCageInductionMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate an abc-domain cont. control set current controlled squirrel cage induction motor.

+
+
Key:

'Cont-CC-SCIM-v0'

+
+
Default Components:
+
+
State Variables:
+
``[

‘omega’ , ‘torque’, +‘i_sa’, ‘i_sb’, ‘i_sc’, ‘i_sd’, ‘i_sq’, +‘u_sa’, ‘u_sb’, ‘u_sc’, ‘u_sd’, ‘u_sq’, +‘epsilon’, ‘u_sup’

+
+
+

]``

+
+
Reference Variables:

['i_sd', 'i_sq']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=14 * [-1], high=14 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-SCIM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/scim/abccont_sc_scim.html b/parts/environments/scim/abccont_sc_scim.html index a13462fa..f6657d24 100644 --- a/parts/environments/scim/abccont_sc_scim.html +++ b/parts/environments/scim/abccont_sc_scim.html @@ -110,6 +110,126 @@

Abc-Continuous Speed Control Squirrel Cage Induction Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlSquirrelCageInductionMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), physical_system_wrappers=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, **kwargs)[source]
+
+
Description:

Environment to simulate an abc-domain cont. control set speed controlled squirrel cage induction motor.

+
+
Key:

'Cont-SC-SCIM-v0'

+
+
Default Components:
+
+
State Variables:
+
``[

‘omega’ , ‘torque’, +‘i_sa’, ‘i_sb’, ‘i_sc’, ‘i_sd’, ‘i_sq’, +‘u_sa’, ‘u_sb’, ‘u_sc’, ‘u_sd’, ‘u_sq’, +‘epsilon’, ‘u_sup’

+
+
+

]``

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=14 * [-1], high=14 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-SCIM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/scim/abccont_tc_scim.html b/parts/environments/scim/abccont_tc_scim.html index c1d04daa..b39935b6 100644 --- a/parts/environments/scim/abccont_tc_scim.html +++ b/parts/environments/scim/abccont_tc_scim.html @@ -110,6 +110,126 @@

Abc-Continuous Torque Control Squirrel Cage Induction Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlSquirrelCageInductionMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate an abc-domain cont. control set torque controlled squirrel cage induction motor.

+
+
Key:

'Cont-TC-SCIM-v0'

+
+
Default Components:
+
+
State Variables:
+
``[

‘omega’ , ‘torque’, +‘i_sa’, ‘i_sb’, ‘i_sc’, ‘i_sd’, ‘i_sq’, +‘u_sa’, ‘u_sb’, ‘u_sc’, ‘u_sd’, ‘u_sq’, +‘epsilon’, ‘u_sup’

+
+
+

]``

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=14 * [-1], high=14 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-SCIM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/scim/finite_cc_scim.html b/parts/environments/scim/finite_cc_scim.html index a94e4668..77d24096 100644 --- a/parts/environments/scim/finite_cc_scim.html +++ b/parts/environments/scim/finite_cc_scim.html @@ -110,6 +110,126 @@

Finite Control Set Current Control Squirrel Cage Induction Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlSquirrelCageInductionMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled squirrel cage induction motor.

+
+
Key:

'Finite-CC-SCIM-v0'

+
+
Default Components:
+
+
State Variables:
+
``[

‘omega’ , ‘torque’, +‘i_sa’, ‘i_sb’, ‘i_sc’, ‘i_sd’, ‘i_sq’, +‘u_sa’, ‘u_sb’, ‘u_sc’, ‘u_sd’, ‘u_sq’, +‘epsilon’, ‘u_sup’

+
+
+

]``

+
+
Reference Variables:

['i_sd', 'i_sq']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=14 * [-1], high=14 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-SCIM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/scim/finite_sc_scim.html b/parts/environments/scim/finite_sc_scim.html index 00e9968d..c629205a 100644 --- a/parts/environments/scim/finite_sc_scim.html +++ b/parts/environments/scim/finite_sc_scim.html @@ -110,6 +110,126 @@

Finite Control Set Speed Control Squirrel Cage Induction Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlSquirrelCageInductionMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled squirrel cage induction motor.

+
+
Key:

'Finite-SC-SCIM-v0'

+
+
Default Components:
+
+
State Variables:
+
``[

‘omega’ , ‘torque’, +‘i_sa’, ‘i_sb’, ‘i_sc’, ‘i_sd’, ‘i_sq’, +‘u_sa’, ‘u_sb’, ‘u_sc’, ‘u_sd’, ‘u_sq’, +‘epsilon’, ‘u_sup’

+
+
+

]``

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=14 * [-1], high=14 * [1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-SCIM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/scim/finite_tc_scim.html b/parts/environments/scim/finite_tc_scim.html index 8a13301d..03bf81f9 100644 --- a/parts/environments/scim/finite_tc_scim.html +++ b/parts/environments/scim/finite_tc_scim.html @@ -110,6 +110,126 @@

Finite Control Set Torque Control Squirrel Cage Induction Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlSquirrelCageInductionMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled squirrel cage induction motor.

+
+
Key:

'Finite-TC-SCIM-v0'

+
+
Default Components:
+
+
State Variables:
+
``[

‘omega’ , ‘torque’, +‘i_sa’, ‘i_sb’, ‘i_sc’, ‘i_sd’, ‘i_sq’, +‘u_sa’, ‘u_sb’, ‘u_sc’, ‘u_sd’, ‘u_sq’, +‘epsilon’, ‘u_sup’

+
+
+

]``

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=14 * [-1], high=14 * [1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-SCIM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/scim/scim_envs.html b/parts/environments/scim/scim_envs.html index 3ba63f03..e09efbc1 100644 --- a/parts/environments/scim/scim_envs.html +++ b/parts/environments/scim/scim_envs.html @@ -112,15 +112,33 @@

Squirrel Cage Induction Motor Environments

Environments:

diff --git a/parts/environments/series_dc/cont_cc_series.html b/parts/environments/series_dc/cont_cc_series.html index cd4dc9ce..dc07e91f 100644 --- a/parts/environments/series_dc/cont_cc_series.html +++ b/parts/environments/series_dc/cont_cc_series.html @@ -107,6 +107,119 @@

Continuous Current Control Series DC Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlDcSeriesMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set current controlled series DC Motor

+
+
Key:

'Cont-CC-SeriesDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['i']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1],high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-SeriesDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/series_dc/cont_sc_series.html b/parts/environments/series_dc/cont_sc_series.html index a4c6f944..cc51edcb 100644 --- a/parts/environments/series_dc/cont_sc_series.html +++ b/parts/environments/series_dc/cont_sc_series.html @@ -107,6 +107,119 @@

Continuous Speed Control Series DC Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlDcSeriesMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set speed controlled series DC Motor

+
+
Key:

'Cont-SC-SeriesDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1],high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-SeriesDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/series_dc/cont_tc_series.html b/parts/environments/series_dc/cont_tc_series.html index 8022edab..82f58c04 100644 --- a/parts/environments/series_dc/cont_tc_series.html +++ b/parts/environments/series_dc/cont_tc_series.html @@ -107,6 +107,119 @@

Continuous Torque Control Series DC Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlDcSeriesMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set torque controlled series DC Motor

+
+
Key:

'Cont-TC-SeriesDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1],high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-SeriesDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/series_dc/finite_cc_series.html b/parts/environments/series_dc/finite_cc_series.html index 7696d6fd..c4b41dca 100644 --- a/parts/environments/series_dc/finite_cc_series.html +++ b/parts/environments/series_dc/finite_cc_series.html @@ -107,6 +107,119 @@

Finite Control Set Current Control Series DC Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlDcSeriesMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled series DC Motor

+
+
Key:

'Finite-CC-SeriesDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['i']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(4)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-SeriesDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/series_dc/finite_sc_series.html b/parts/environments/series_dc/finite_sc_series.html index ac94b5c2..d4ca9d3c 100644 --- a/parts/environments/series_dc/finite_sc_series.html +++ b/parts/environments/series_dc/finite_sc_series.html @@ -107,6 +107,119 @@

Finite Control Set Speed Control Series DC Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlDcSeriesMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled series DC Motor

+
+
Key:

'Finite-SC-SeriesDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(4)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-SC-SeriesDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/series_dc/finite_tc_series.html b/parts/environments/series_dc/finite_tc_series.html index 124c72ac..400b2e27 100644 --- a/parts/environments/series_dc/finite_tc_series.html +++ b/parts/environments/series_dc/finite_tc_series.html @@ -107,6 +107,119 @@

Finite Control Set Torque Control Series DC Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlDcSeriesMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i',), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled series DC Motor

+
+
Key:

'Finite-TC-SeriesDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(4)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-SeriesDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/series_dc/series_dc_envs.html b/parts/environments/series_dc/series_dc_envs.html index 432d3ac4..318d8faa 100644 --- a/parts/environments/series_dc/series_dc_envs.html +++ b/parts/environments/series_dc/series_dc_envs.html @@ -109,12 +109,30 @@

Series DC Motor Environments

Environments:

diff --git a/parts/environments/shunt_dc/cont_cc_shunt.html b/parts/environments/shunt_dc/cont_cc_shunt.html index 5a45922d..67e35d60 100644 --- a/parts/environments/shunt_dc/cont_cc_shunt.html +++ b/parts/environments/shunt_dc/cont_cc_shunt.html @@ -107,6 +107,119 @@

Continuous Current Control Shunt DC Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlDcShuntMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set current controlled shunt DC Motor

+
+
Key:

'Cont-CC-ShuntDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1],high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-ShuntDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/shunt_dc/cont_sc_shunt.html b/parts/environments/shunt_dc/cont_sc_shunt.html index 1f4c9a4a..436dca00 100644 --- a/parts/environments/shunt_dc/cont_sc_shunt.html +++ b/parts/environments/shunt_dc/cont_sc_shunt.html @@ -107,6 +107,119 @@

Continuous Speed Control Shunt DC Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlDcShuntMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set speed controlled shunt DC Motor

+
+
Key:

'Cont-SC-ShuntDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1],high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Cont-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-ShuntDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/shunt_dc/cont_tc_shunt.html b/parts/environments/shunt_dc/cont_tc_shunt.html index fef00b4a..d5b6d45a 100644 --- a/parts/environments/shunt_dc/cont_tc_shunt.html +++ b/parts/environments/shunt_dc/cont_tc_shunt.html @@ -107,6 +107,119 @@

Continuous Torque Control Shunt DC Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlDcShuntMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a continuous control set torque controlled shunt DC Motor

+
+
Key:

'Cont-TC-ShuntDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Box(low=[-1],high=[1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-ShuntDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/shunt_dc/finite_cc_shunt.html b/parts/environments/shunt_dc/finite_cc_shunt.html index a0187a29..ee7e1744 100644 --- a/parts/environments/shunt_dc/finite_cc_shunt.html +++ b/parts/environments/shunt_dc/finite_cc_shunt.html @@ -107,6 +107,119 @@

Finite Control Set Current Control Shunt DC Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlDcShuntMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled shunt DC Motor

+
+
Key:

'Finite-CC-ShuntDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u', 'u_sup']

+
+
Reference Variables:

['i_a']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(4)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_a',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-ShuntDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/shunt_dc/finite_sc_shunt.html b/parts/environments/shunt_dc/finite_sc_shunt.html index fc0e29fe..cc79c15a 100644 --- a/parts/environments/shunt_dc/finite_sc_shunt.html +++ b/parts/environments/shunt_dc/finite_sc_shunt.html @@ -107,6 +107,119 @@

Finite Control Set Speed Control Shunt DC Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlDcShuntMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled shunt DC Motor

+
+
Key:

'Finite-SC-ShuntDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(4)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-SC-ShuntDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/shunt_dc/finite_tc_shunt.html b/parts/environments/shunt_dc/finite_tc_shunt.html index 50eeb968..302a9b37 100644 --- a/parts/environments/shunt_dc/finite_tc_shunt.html +++ b/parts/environments/shunt_dc/finite_tc_shunt.html @@ -107,6 +107,119 @@

Finite Control Set Torque Control Shunt DC Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlDcShuntMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=('i_a', 'i_e'), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled shunt DC Motor

+
+
Key:

'Finite-TC-ShuntDc-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_a', 'i_e', 'u', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=[-1, -1, -1, -1, 0], high=[1, 1, 1, 1, 1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(4)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different converter with default parameters by passing a keystring
+>>> my_overridden_converter = 'Finite-2QC'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-ShuntDc-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     converter=my_overridden_converter,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-5.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/shunt_dc/shunt_dc_envs.html b/parts/environments/shunt_dc/shunt_dc_envs.html index a63b0b63..3e20f86b 100644 --- a/parts/environments/shunt_dc/shunt_dc_envs.html +++ b/parts/environments/shunt_dc/shunt_dc_envs.html @@ -109,12 +109,30 @@

Shunt DC Motor Environments

Environments:

diff --git a/parts/environments/synrm/abccont_cc_synrm.html b/parts/environments/synrm/abccont_cc_synrm.html index 98c32fa0..78c2097c 100644 --- a/parts/environments/synrm/abccont_cc_synrm.html +++ b/parts/environments/synrm/abccont_cc_synrm.html @@ -110,6 +110,119 @@

Abc-Continuous Current Control Synchronous Reluctance Motor Environment

+
+
+class gym_electric_motor.envs.ContCurrentControlSynchronousReluctanceMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a abc-domain continuous control set current controlled synchronous reluctance motor.

+
+
Key:

'Cont-CC-PMSM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['i_sd', 'i_sq']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy-solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-CC-SynRM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/synrm/abccont_sc_synrm.html b/parts/environments/synrm/abccont_sc_synrm.html index 4f45099b..56aebb92 100644 --- a/parts/environments/synrm/abccont_sc_synrm.html +++ b/parts/environments/synrm/abccont_sc_synrm.html @@ -110,6 +110,119 @@

Abc-Continuous Speed Control Synchronous Reluctance Motor Environment

+
+
+class gym_electric_motor.envs.ContSpeedControlSynchronousReluctanceMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a abc-domain continuous control set speed controlled synchronous reluctance motor.

+
+
Key:

'Cont-SC-SynRM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-SC-PMSM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/synrm/abccont_tc_synrm.html b/parts/environments/synrm/abccont_tc_synrm.html index 115ad947..32164eae 100644 --- a/parts/environments/synrm/abccont_tc_synrm.html +++ b/parts/environments/synrm/abccont_tc_synrm.html @@ -110,6 +110,119 @@

Abc-Continuous Torque Control Synchronous Reluctance Motor Environment

+
+
+class gym_electric_motor.envs.ContTorqueControlSynchronousReluctanceMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=0.0001, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a abc-domain continuous control set torque controlled synchronous reluctance motor.

+
+
Key:

'Cont-TC-SynRM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-4 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Box(low=[-1, -1, -1], high=[1, 1, 1])

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Cont-TC-SynRM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/synrm/finite_cc_synrm.html b/parts/environments/synrm/finite_cc_synrm.html index a4b2de98..b8130b07 100644 --- a/parts/environments/synrm/finite_cc_synrm.html +++ b/parts/environments/synrm/finite_cc_synrm.html @@ -110,6 +110,119 @@

Finite Control Set Current Control Synchronous Reluctance Motor Environment

+
+
+class gym_electric_motor.envs.FiniteCurrentControlSynchronousReluctanceMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set current controlled synchronous reluctance.

+
+
Key:

'Finite-CC-SynRM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['i_sd', 'i_sq']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1, -1], high=[1, 1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='i_sq',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-CC-SynRM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/synrm/finite_sc_synrm.html b/parts/environments/synrm/finite_sc_synrm.html index 4511a901..39e26391 100644 --- a/parts/environments/synrm/finite_sc_synrm.html +++ b/parts/environments/synrm/finite_sc_synrm.html @@ -110,6 +110,120 @@

Finite Control Set Speed Control Synchronous Reluctance Motor Environment

+
+
+class gym_electric_motor.envs.FiniteSpeedControlSynchronousReluctanceMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set speed controlled synchronous reluctance motor.

+
+
Key:

'Finite-SC-SynRM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['omega']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='omega',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-SC-SynRM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • noise_generator (env-arg) – Specification of the NoiseGenerator for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/synrm/finite_tc_synrm.html b/parts/environments/synrm/finite_tc_synrm.html index 781c7d79..cfeb4d76 100644 --- a/parts/environments/synrm/finite_tc_synrm.html +++ b/parts/environments/synrm/finite_tc_synrm.html @@ -110,6 +110,119 @@

Finite Control Set Torque Control Synchronous Reluctance Motor Environment

+
+
+class gym_electric_motor.envs.FiniteTorqueControlSynchronousReluctanceMotorEnv(supply=None, converter=None, motor=None, load=None, ode_solver=None, reward_function=None, reference_generator=None, visualization=None, state_filter=None, callbacks=(), constraints=(<gym_electric_motor.constraints.SquaredConstraint object>, ), calc_jacobian=True, tau=1e-05, physical_system_wrappers=(), **kwargs)[source]
+
+
Description:

Environment to simulate a finite control set torque controlled synchronous reluctance motor.

+
+
Key:

'Finite-TC-SynRM-v0'

+
+
Default Components:
+
+
State Variables:

['omega' , 'torque', 'i_sd', 'i_sq', 'i_a', 'i_b', 'i_c', 'u_sd', 'u_sq', 'u_a', 'u_b', 'u_c', 'u_sup']

+
+
Reference Variables:

['torque']

+
+
Control Cycle Time:

tau = 1e-5 seconds

+
+
Observation Space:

Type: Tuple(State_Space, Reference_Space)

+
+
State Space:

Box(low=13 * [-1], high=13 * [1])

+
+
Reference Space:

Box(low=[-1], high=[1])

+
+
Action Space:

Discrete(8)

+
+
Initial State:

Zeros on all state variables.

+
+
+

Example

+
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.reference_generators import LaplaceProcessReferenceGenerator
+>>>
+>>> # Select a different ode_solver with default parameters by passing a keystring
+>>> my_overridden_solver = 'scipy.solve_ivp'
+>>>
+>>> # Update the default arguments to the voltage supply by passing a parameter dict
+>>> my_changed_voltage_supply_args = {'u_nominal': 400.0}
+>>>
+>>> # Replace the reference generator by passing a new instance
+>>> my_new_ref_gen_instance = LaplaceProcessReferenceGenerator(
+...     reference_state='torque',
+...     sigma_range=(1e-3, 1e-2)
+... )
+>>> env = gem.make(
+...     'Finite-TC-SynRM-v0',
+...     voltage_supply=my_changed_voltage_supply_args,
+...     ode_solver=my_overridden_solver,
+...     reference_generator=my_new_ref_gen_instance
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
Parameters:
+
    +
  • supply (env-arg) – Specification of the VoltageSupply for the environment

  • +
  • converter (env-arg) – Specification of the PowerElectronicConverter for the environment

  • +
  • motor (env-arg) – Specification of the ElectricMotor for the environment

  • +
  • load (env-arg) – Specification of the MechanicalLoad for the environment

  • +
  • ode_solver (env-arg) – Specification of the OdeSolver for the environment

  • +
  • reward_function (env-arg) – Specification of the RewardFunction for the environment

  • +
  • reference_generator (env-arg) – Specification of the ReferenceGenerator for the environment

  • +
  • visualization (env-arg) – Specification of the ElectricMotorVisualization for the environment

  • +
  • constraints (iterable(str/Constraint)) –

    All Constraints of the environment.

    +
      +
    • str: A LimitConstraints for states (episode terminates, if the quantity exceeds the limit)

    • +
    +
    +

    can be directly specified by passing the state name here (e.g. ‘i’, ‘omega’)

    +
    +
      +
    • instance of Constraint: More complex constraints (e.g. the SquaredConstraint can be initialized and

    • +
    +
    +

    passed to the environment.

    +
    +

  • +
  • calc_jacobian (bool) – Flag, if the jacobian of the environment shall be taken into account during the +simulation. This may lead to speed improvements. Default: True

  • +
  • tau (float) – Duration of one control step in seconds. Default: 1e-4.

  • +
  • state_filter (list(str)) – List of states that shall be returned to the agent. Default: None (no filter)

  • +
  • callbacks (list(Callback)) – Callbacks for user interaction. Default: ()

  • +
  • physical_system_wrappers (list(PhysicalSystemWrapper)) – List of Physical System Wrappers to modify the

  • +
  • Default (actions to and states from the physical system before they are used in the environment.) – ()

  • +
+
+
+
+
Note on the env-arg type:

All parameters of type env-arg can be selected as one of the following types:

+

instance: Pass an already instantiated object derived from the corresponding base class +(e.g. reward_function=MyRewardFunction()). This is directly used in the environment.

+

dict: Pass a dict to update the default parameters of the default type. +(e.g. visualization=dict(state_plots=('omega', 'u')))

+

str: Pass a string out of the registered classes to select a different class for the component. +This class is then initialized with its default parameters. +The available strings can be looked up in the documentation. (e.g. converter='Finite-2QC')

+
+
+
+
diff --git a/parts/environments/synrm/synrm_envs.html b/parts/environments/synrm/synrm_envs.html index 1b5cd296..cb1cec2d 100644 --- a/parts/environments/synrm/synrm_envs.html +++ b/parts/environments/synrm/synrm_envs.html @@ -112,15 +112,33 @@

Synchronous Reluctance Motor Environments

Environments:

diff --git a/parts/physical_systems/converters/1QC.html b/parts/physical_systems/converters/1QC.html index 04ccd1b8..81bb164d 100644 --- a/parts/physical_systems/converters/1QC.html +++ b/parts/physical_systems/converters/1QC.html @@ -112,9 +112,270 @@

One Quadrant Converters

Discrete One Quadrant Converter

+
+
+class gym_electric_motor.physical_systems.converters.FiniteOneQuadrantConverter(tau=1e-05, **kwargs)[source]
+
+
Key:

‘Finite-1QC’

+
+
Switching States / Actions:
+
0: Transistor off.
+
1: Transistor on.
+
+
+
Action Space:

Discrete(2)

+
+
Output Voltages and Currents:
+
voltages: Box(0, 1, shape=(1,))
+
currents: Box(0, 1, shape=(1,))
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Discrete(2)
+

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 = Box(0.0, 1.0, (1,), float64)
+

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()
+

Reset all converter states to a default.

+
+
Returns:
+

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

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+set_action(action, t)
+

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 = Box(0.0, 1.0, (1,), float64)
+

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

+
+ +
+

Continuous One Quadrant Converter

+
+
+class gym_electric_motor.physical_systems.converters.ContOneQuadrantConverter(tau=0.0001, **kwargs)[source]
+
+
Key:

‘Cont1QC’

+
+
Action:

Duty Cycle of the Transistor in [0,1].

+
+
Action Space:

Box([0,1])

+
+
Output Voltages and Currents:
+
voltages: Box(0, 1, shape=(1,))
+
currents: Box(0, 1, shape=(1,))
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Box(0.0, 1.0, (1,), float64)
+

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

+
+ +
+
+convert(i_out, t)
+

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 = Box(0.0, 1.0, (1,), float64)
+

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()
+

Reset all converter states to a default.

+
+
Returns:
+

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

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+set_action(action, t)
+

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 = Box(0.0, 1.0, (1,), float64)
+

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

+
+ +
+
diff --git a/parts/physical_systems/converters/2QC.html b/parts/physical_systems/converters/2QC.html index b8478503..61fce042 100644 --- a/parts/physical_systems/converters/2QC.html +++ b/parts/physical_systems/converters/2QC.html @@ -112,9 +112,274 @@

Two Quadrant Converters

Discrete Two Quadrant Converter

+
+
+class gym_electric_motor.physical_systems.converters.FiniteTwoQuadrantConverter(tau=1e-05, **kwargs)[source]
+
+
Key:

‘Finite-2QC’

+
+
Switching States / Actions:
+
0: Both Transistors off.
+
1: Upper Transistor on.
+
2: Lower Transistor on.
+
+
+
Action Space:

Discrete(3)

+
+
Output Voltages and Currents:
+
voltages: Box(0, 1, shape=(1,))
+
currents: Box(-1, 1, shape=(1,))
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Discrete(3)
+

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 = Box(-1.0, 1.0, (1,), float64)
+

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()
+

Reset all converter states to a default.

+
+
Returns:
+

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

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+set_action(action, t)
+

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 = Box(0.0, 1.0, (1,), float64)
+

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

+
+ +
+

Continuous Two Quadrant Converter

+
+
+class gym_electric_motor.physical_systems.converters.ContTwoQuadrantConverter(tau=0.0001, **kwargs)[source]
+
+
Key:

‘Cont-2QC’

+
+
Actions:
+
Duty Cycle upper Transistor: Action
+
Duty Cycle upper Transistor: 1 - Action
+
+
+
Action Space:

Box([0,1])

+
+
Output Voltages and Currents:
+
voltages: Box(0, 1, shape=(1,))
+
currents: Box(-1, 1, shape=(1,))
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Box(0.0, 1.0, (1,), float64)
+

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

+
+ +
+
+convert(i_out, t)
+

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 = Box(-1.0, 1.0, (1,), float64)
+

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()
+

Reset all converter states to a default.

+
+
Returns:
+

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

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+set_action(action, t)
+

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 = Box(0.0, 1.0, (1,), float64)
+

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

+
+ +
+
diff --git a/parts/physical_systems/converters/4QC.html b/parts/physical_systems/converters/4QC.html index 8ed3f0bf..b9c8e6e8 100644 --- a/parts/physical_systems/converters/4QC.html +++ b/parts/physical_systems/converters/4QC.html @@ -112,9 +112,278 @@

Four Quadrant Converters

Discrete Four Quadrant Converter

+
+
+class gym_electric_motor.physical_systems.converters.FiniteFourQuadrantConverter(**kwargs)[source]
+
+
Key:

‘Finite-4QC’

+
+
Switching States / Actions:
+
0: T2, T4 on.
+
1: T1, T4 on.
+
2: T2, T3 on.
+
3: T1, T3 on.
+
+
+
Action Space:

Discrete(4)

+
+
Output Voltages and Currents:
+
Box(-1, 1, shape=(1,))
+
Box(-1, 1, shape=(1,))
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Discrete(4)
+

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 = Box(-1.0, 1.0, (1,), float64)
+

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 = Box(-1.0, 1.0, (1,), float64)
+

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

+
+ +
+

Continuous Four Quadrant Converter

+
+
+class gym_electric_motor.physical_systems.converters.ContFourQuadrantConverter(**kwargs)[source]
+

The continuous four quadrant converter (4QC) is simulated with two continuous 2QC.

+
+
Key:

‘Cont-4QC’

+
+
Actions:
+
Duty Cycle Transistor T1: 0.5 * (Action + 1)
+
Duty Cycle Transistor T2: 1 - 0.5 * (Action + 1)
+
Duty Cycle Transistor T3: 1 - 0.5 * (Action + 1)
+
Duty Cycle Transistor T4: 0.5 * (Action + 1)
+
+
+
Action Space:

Box(-1, 1, shape=(1,))

+
+
Output Voltages and Currents:
+
voltages: Box(-1, 1, shape=(1,))
+
currents: Box(-1, 1, shape=(1,))
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Box(-1.0, 1.0, (1,), float64)
+

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 = Box(-1.0, 1.0, (1,), float64)
+

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 = Box(-1.0, 1.0, (1,), float64)
+

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

+
+ +
+
diff --git a/parts/physical_systems/converters/B6C.html b/parts/physical_systems/converters/B6C.html index 797bdedc..a28d78f8 100644 --- a/parts/physical_systems/converters/B6C.html +++ b/parts/physical_systems/converters/B6C.html @@ -112,9 +112,323 @@

Three Phase Converters

Discrete B6 Bridge Converter

+
+
+class gym_electric_motor.physical_systems.converters.FiniteB6BridgeConverter(tau=1e-05, **kwargs)[source]
+

The finite B6 bridge converters (B6C) is simulated with three finite 2QC.

+
+
Key:

‘Finite-B6C’

+
+
Actions:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

H_1

H_2

H_3

0

lower

lower

lower

1

lower

lower

upper

2

lower

upper

lower

3

lower

upper

upper

4

upper

lower

lower

5

upper

lower

upper

6

upper

upper

lower

7

upper

upper

upper

+
+
Action Space:

Discrete(8)

+
+
Output Voltages and Currents:
+
voltages: Box(-1,1, shape=(3,))
+
currents: Box(-1,1, shape=(3,))
+
+
+
Output Voltage Space:

Box(-0.5, 0.5, shape=(3,))

+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Discrete(8)
+

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 = Box(-1.0, 1.0, (3,), float64)
+

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 = Box(-1.0, 1.0, (3,), float64)
+

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

+
+ +
+

Continuous B6 Bridge Converter

+
+
+class gym_electric_motor.physical_systems.converters.ContB6BridgeConverter(tau=0.0001, **kwargs)[source]
+

The continuous B6 bridge converter (B6C) is simulated with three continuous 2QC.

+
+
Key:

‘Cont-B6C’

+
+
Actions:

The Duty Cycle for each half bridge in the range of (-1,1)

+
+
Action Space:

Box(-1, 1, shape=(3,))

+
+
Output Voltages and Currents:
+
voltages: Box(-1,1, shape=(3,))
+
currents: Box(-1,1, shape=(3,))
+
+
+
Output Voltage Space:

Box(-0.5, 0.5, shape=(3,))

+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Box(-1.0, 1.0, (3,), float64)
+

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 = Box(-1.0, 1.0, (3,), float64)
+

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 = Box(-1.0, 1.0, (3,), float64)
+

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

+
+ +
+
diff --git a/parts/physical_systems/converters/DoubleConv.html b/parts/physical_systems/converters/DoubleConv.html index 8f0ed2a4..546bc0da 100644 --- a/parts/physical_systems/converters/DoubleConv.html +++ b/parts/physical_systems/converters/DoubleConv.html @@ -112,9 +112,274 @@

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

+
+ +
+
diff --git a/parts/physical_systems/converters/NoConv.html b/parts/physical_systems/converters/NoConv.html index e7d00f3c..b95fde7a 100644 --- a/parts/physical_systems/converters/NoConv.html +++ b/parts/physical_systems/converters/NoConv.html @@ -108,6 +108,123 @@

No Converter

+
+
+class gym_electric_motor.physical_systems.converters.NoConverter(tau, interlocking_time=0.0)[source]
+

Dummy Converter class used to directly transfer the supply voltage to the motor

+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+action_space = Box([], [], (0,), float64)
+

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 = Box(0.0, 1.0, (3,), float64)
+

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()
+

Reset all converter states to a default.

+
+
Returns:
+

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

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+set_action(action, t)
+

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 = Box(0.0, 1.0, (3,), float64)
+

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

+
+ +
+
diff --git a/parts/physical_systems/converters/converter.html b/parts/physical_systems/converters/converter.html index 88586102..c3f51797 100644 --- a/parts/physical_systems/converters/converter.html +++ b/parts/physical_systems/converters/converter.html @@ -123,12 +123,376 @@

Power Electronic Converters

Converter Base Class

+
+
+class gym_electric_motor.physical_systems.converters.PowerElectronicConverter(tau, interlocking_time=0.0)[source]
+

Base class for all converters in a SCMLSystem.

+
+
Properties:
+
voltages(tuple(float, float)): Determines which output voltage polarities the converter can generate.
+
E.g. (0, 1) - Only positive voltages / (-1, 1) Positive and negative voltages
+
+
+
currents(tuple(float, float)): Determines which output current polarities the converter can generate.
+
E.g. (0, 1) - Only positive currents / (-1, 1) Positive and negative currents
+
+
+
+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+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

+
+ +
+

Finite Control Set Converter

+
+
+class gym_electric_motor.physical_systems.converters.FiniteConverter(tau=1e-05, **kwargs)[source]
+

Base class for all finite converters.

+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+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()
+

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 Control Set Dynamically Averaged Converter

+
+
+class gym_electric_motor.physical_systems.converters.ContDynamicallyAveragedConverter(tau=0.0001, **kwargs)[source]
+

Base class for all continuously controlled converters that calculate the input voltages to the motor with a +dynamically averaged model over one time step.

+

This class also implements the interlocking time of the transistors as a discount on the output voltage.

+
+
Parameters:
+
    +
  • tau – Discrete time step of the system in seconds

  • +
  • interlocking_time – Interlocking time of the transistors in seconds

  • +
+
+
+
+
+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()
+

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

+
+ +
+
diff --git a/parts/physical_systems/electric_motors.html b/parts/physical_systems/electric_motors.html index a3a07c26..9f1f4796 100644 --- a/parts/physical_systems/electric_motors.html +++ b/parts/physical_systems/electric_motors.html @@ -87,6 +87,248 @@

Electric Motors

Electric Motor Base Class

+
+
+class gym_electric_motor.physical_systems.electric_motors.ElectricMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None, initial_limits=None)[source]
+

Base class for all technical electrical motor models.

+

A motor consists of the ode-state. These are the dynamic quantities of its ODE. +For example:

+
+
+
ODE-State of a DC-shunt motor: `` [i_a, i_e ] ``
    +
  • i_a: Anchor circuit current

  • +
  • i_e: Exciting circuit current

  • +
+
+
+
+

Each electric motor can be parametrized by a dictionary of motor parameters, +the nominal state dictionary and the limit dictionary.

+

Initialization is given by initializer(dict). It can be constant state value +or random value in given interval. +dict should be like: +{ ‘states’(dict): with state names and initital values

+
+
+
‘interval’(array like): boundaries for each state

(only for random init), shape(num states, 2)

+
+
+

‘random_init’(str): ‘uniform’ or ‘normal’ +‘random_params(tuple): mue(float), sigma(int)

+
+
+
Example initializer(dict) for constant initialization:

{ ‘states’: {‘omega’: 16.0}}

+
+
Example initializer(dict) for random initialization:

{ ‘random_init’: ‘normal’}

+
+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = []
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = []
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = []
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)[source]
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)[source]
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+reset(state_space, state_positions, **__)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+

Synchronous Motors

@@ -130,10 +372,574 @@

Parameter Dictionary\(U_N=\sqrt(2/3) U_L\) and \(I_N=\sqrt(2) I_S\).

Furthermore, the angular velocity is the electrical one and not the mechanical one \(\omega = p \omega_{me}\).

+
+
+class gym_electric_motor.physical_systems.electric_motors.SynchronousMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+

The SynchronousMotor and its subclasses implement the technical system of a three phase synchronous motor.

+

This includes the system equations, the motor parameters of the equivalent circuit diagram, +as well as limits and bandwidth.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

0.78

Stator resistance

l_d

H

1.2

Direct axis inductance

l_q

H

6.3e-3

Quadrature axis inductance

psi_p

Wb

0.0094

Effective excitation flux (PMSM only)

p

1

2

Pole pair number

j_rotor

kg/m^2

0.017

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_a

A

Current through line a

i_b

A

Current through line b

i_c

A

Current through line c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_a

V

Phase voltage for line a

u_b

V

Phase voltage for line b

u_c

V

Phase voltage for line c

u_alpha

V

Phase voltage in alpha axis

u_beta

V

Phase voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

epsilon

Electrical rotational angle

u_a

Phase voltage in phase a

u_b

Phase voltage in phase b

u_c

Phase voltage in phase c

u_alpha

Phase voltage in alpha axis

u_beta

Phase voltage in beta axis

u_sd

Phase voltage in direct axis

u_sq

Phase voltage in quadrature axis

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the root mean square (RMS) value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_sd', 'i_sq']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+VOLTAGES = ['u_sd', 'u_sq']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_ode(state, u_dq, omega, *_)[source]
+

The differential equation of the Synchronous Motor.

+
+
Parameters:
+
    +
  • state – The current state of the motor. [i_sd, i_sq, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_qd – The input voltages [u_sd, u_sq]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt([i_sd, i_sq, epsilon])

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+reset(state_space, state_positions, **__)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+

Synchronous Reluctance Motor

+
+
+class gym_electric_motor.physical_systems.electric_motors.SynchronousReluctanceMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

0.57

Stator resistance

l_d

H

10.1e-3

Direct axis inductance

l_q

H

4.1e-3

Quadrature axis inductance

p

1

4

Pole pair number

j_rotor

kg/m^2

0.8e-3

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_a

A

Current through branch a

i_b

A

Current through branch b

i_c

A

Current through branch c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_a

V

Voltage through branch a

u_b

V

Voltage through branch b

u_c

V

Voltage through branch c

u_alpha

V

Voltage in alpha axis

u_beta

V

Voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

epsilon

Electrical rotational angle

torque

Motor generated torque

u_a

Voltage in phase a

u_b

Voltage in phase b

u_c

Voltage in phase c

u_alpha

Voltage in alpha axis

u_beta

Voltage in beta axis

u_sd

Voltage in direct axis

u_sq

Voltage in quadrature axis

+

Note: +The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the root mean square (RMS) value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+

Permanent Magnet Synchronous Motor

@@ -187,6 +993,250 @@

Permanent Magnet Synchronous Motor\(\hat{I}_S=\sqrt{2} I_S\).

../../_images/Drehstromtrafo.svg
+
+
+class gym_electric_motor.physical_systems.electric_motors.PermanentMagnetSynchronousMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

18e-3

Stator resistance

l_d

H

0.37e-3

Direct axis inductance

l_q

H

1.2e-3

Quadrature axis inductance

p

1

3

Pole pair number

j_rotor

kg/m^2

0.03883

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_a

A

Current through line a

i_b

A

Current through line b

i_c

A

Current through line c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_a

V

Phase voltage for line a

u_b

V

Phase voltage for line b

u_c

V

Phase voltage for line c

u_alpha

V

Phase voltage in alpha axis

u_beta

V

Phase voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

epsilon

Electrical rotational angle

u_a

Phase voltage in phase a

u_b

Phase voltage in phase b

u_c

Phase voltage in phase c

u_alpha

Phase voltage in alpha axis

u_beta

Phase voltage in beta axis

u_sd

Phase voltage in direct axis

u_sq

Phase voltage in quadrature axis

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the RMS value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+electrical_jacobian(state, u_in, omega, *args)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+

diff --git a/parts/physical_systems/electric_motors/dc_base.html b/parts/physical_systems/electric_motors/dc_base.html index 90a266f0..16c70730 100644 --- a/parts/physical_systems/electric_motors/dc_base.html +++ b/parts/physical_systems/electric_motors/dc_base.html @@ -117,6 +117,391 @@

Base DC Motor

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.DcMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+

The DcMotor and its subclasses implement the technical system of a dc motor.

+

This includes the system equations, the motor parameters of the equivalent circuit diagram, +as well as limits.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_a

Ohm

16e-3

Armature circuit resistance

r_e

Ohm

16e-2

Exciting circuit resistance

l_a

H

19e-6

Armature circuit inductance

l_e

H

5.4e-3

Exciting circuit inductance

l_e_prime

H

1.7e-3

Effective excitation inductance

j_rotor

kg/m^2

0.025

Moment of inertia of the rotor

+
+
..note ::

The motor parameter are based on the following DC Motor (slightly adapted): +https://www.heinzmann-electric-motors.com/en/products/dc-motors/pmg-132-dc-motor

+
+
+ + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_a

A

Armature circuit current

i_e

A

Exciting circuit current

+ + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_a

V

Armature circuit voltage

u_e

v

Exciting circuit voltage

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i_a

Armature current

i_e

Exciting current

omega

Angular Velocity

torque

Motor generated torque

u_a

Armature Voltage

u_e

Exciting Voltage

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_a', 'i_e']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u_a', 'u_e']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)[source]
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+get_state_space(input_currents, input_voltages)[source]
+

Calculate the possible normalized state space for the motor as a tuple of dictionaries “low” and “high”.

+
+
Parameters:
+
    +
  • input_currents – Tuple of the two converters possible output currents.

  • +
  • input_voltages – Tuple of the two converters possible output voltages.

  • +
+
+
Returns:
+

Dictionaries defining if positive and negative values are possible for each motors state.

+
+
Return type:
+

tuple(dict,dict)

+
+
+
+ +
+
+i_in(currents)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
diff --git a/parts/physical_systems/electric_motors/dfim.html b/parts/physical_systems/electric_motors/dfim.html index a2e82d77..c7d8b457 100644 --- a/parts/physical_systems/electric_motors/dfim.html +++ b/parts/physical_systems/electric_motors/dfim.html @@ -141,6 +141,607 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.DoublyFedInductionMotor(**kwargs)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

4.42

Stator resistance

r_r

Ohm

3.51

Rotor resistance

l_m

H

297.5e-3

Main inductance

l_sigs

H

25.71e-3

Stator-side stray inductance

l_sigr

H

25.71e-3

Rotor-side stray inductance

p

1

2

Pole pair number

j_rotor

kg/m^2

13.695e-3

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_sa

A

Current through branch a

i_sb

A

Current through branch b

i_sc

A

Current through branch c

i_salpha

A

Current in alpha axis

i_sbeta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Rotor flux

Unit

Description

psi_rd

Vs

Direct axis of the rotor oriented flux

psi_rq

Vs

Quadrature axis of the rotor oriented flux

psi_ra

Vs

Rotor oriented flux in branch a

psi_rb

Vs

Rotor oriented flux in branch b

psi_rc

Vs

Rotor oriented flux in branch c

psi_ralpha

Vs

Rotor oriented flux in alpha direction

psi_rbeta

Vs

Rotor oriented flux in beta direction

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_sa

V

Stator voltage through branch a

u_sb

V

Stator voltage through branch b

u_sc

V

Stator voltage through branch c

u_salpha

V

Stator voltage in alpha axis

u_sbeta

V

Stator voltage in beta axis

u_ralpha

V

Rotor voltage in alpha axis

u_rbeta

V

Rotor voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_sa

Current in phase a

i_sb

Current in phase b

i_sc

Current in phase c

i_salpha

Current in alpha axis

i_sbeta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

u_sa

Voltage in phase a

u_sb

Voltage in phase b

u_sc

Voltage in phase c

u_salpha

Voltage in alpha axis

u_sbeta

Voltage in beta axis

u_sd

Voltage in direct axis

u_sq

Voltage in quadrature axis

u_ralpha

Rotor voltage in alpha axis

u_rbeta

Rotor voltage in beta axis

+

Note: +The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the RMS value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_salpha', 'i_sbeta']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = []
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *args)
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_sr_alphabeta, omega, *args)
+

The differential equation of the Induction Motor.

+
+
Parameters:
+
    +
  • state – The momentary state of the motor. [i_salpha, i_sbeta, psi_ralpha, psi_rbeta, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_sr_alphabeta – The input voltages [u_salpha, u_sbeta, u_ralpha, u_rbeta]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt( [i_salpha, i_sbeta, psi_ralpha, psi_rbeta, epsilon])

+
+
+
+ +
+
+i_in(state)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, omega=None)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+ diff --git a/parts/physical_systems/electric_motors/eesm.html b/parts/physical_systems/electric_motors/eesm.html index 8cf4291e..a6438ece 100644 --- a/parts/physical_systems/electric_motors/eesm.html +++ b/parts/physical_systems/electric_motors/eesm.html @@ -143,6 +143,584 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.ExternallyExcitedSynchronousMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

mOhm

15.55

Stator resistance

r_e

mOhm

7.2

Excitation resistance

l_d

mH

1.66

Direct axis inductance

l_q

mH

0.35

Quadrature axis inductance

l_m

mH

1.589

Mutual inductance

l_e

mH

1.74

Excitation inductance

p

1

3

Pole pair number

k

1

65.21

Transfer ratio of number of windings (N_s / N_e)

j_rotor

kg/m^2

0.3883

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_e

A

Excitation current

i_a

A

Current through branch a

i_b

A

Current through branch b

i_c

A

Current through branch c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_e

V

Exciting voltage

u_a

V

Voltage through branch a

u_b

V

Voltage through branch b

u_c

V

Voltage through branch c

u_alpha

V

Voltage in alpha axis

u_beta

V

Voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

i_e

Current in excitation circuit

omega

Mechanical angular Velocity

torque

Motor generated torque

epsilon

Electrical rotational angle

u_a

Voltage in phase a

u_b

Voltage in phase b

u_c

Voltage in phase c

u_alpha

Voltage in alpha axis

u_beta

Voltage in beta axis

u_sd

Voltage in direct axis

u_sq

Voltage in quadrature axis

u_e

Voltage in excitation circuit

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the RMS value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_sd', 'i_sq', 'i_e']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1, 2]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u_sd', 'u_sq', 'u_e']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *args)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_dqe, omega, *_)[source]
+

The differential equation of the Synchronous Motor.

+
+
Parameters:
+
    +
  • state – The current state of the motor. [i_sd, i_sq, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_qd – The input voltages [u_sd, u_sq]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt([i_sd, i_sq, epsilon])

+
+
+
+ +
+
+i_in(state)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+ diff --git a/parts/physical_systems/electric_motors/electric_motor.html b/parts/physical_systems/electric_motors/electric_motor.html index 06a896fc..72d7c59c 100644 --- a/parts/physical_systems/electric_motors/electric_motor.html +++ b/parts/physical_systems/electric_motors/electric_motor.html @@ -134,6 +134,248 @@

Electric Motors

Electric Motor Base Class

+
+
+class gym_electric_motor.physical_systems.electric_motors.ElectricMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None, initial_limits=None)[source]
+

Base class for all technical electrical motor models.

+

A motor consists of the ode-state. These are the dynamic quantities of its ODE. +For example:

+
+
+
ODE-State of a DC-shunt motor: `` [i_a, i_e ] ``
    +
  • i_a: Anchor circuit current

  • +
  • i_e: Exciting circuit current

  • +
+
+
+
+

Each electric motor can be parametrized by a dictionary of motor parameters, +the nominal state dictionary and the limit dictionary.

+

Initialization is given by initializer(dict). It can be constant state value +or random value in given interval. +dict should be like: +{ ‘states’(dict): with state names and initital values

+
+
+
‘interval’(array like): boundaries for each state

(only for random init), shape(num states, 2)

+
+
+

‘random_init’(str): ‘uniform’ or ‘normal’ +‘random_params(tuple): mue(float), sigma(int)

+
+
+
Example initializer(dict) for constant initialization:

{ ‘states’: {‘omega’: 16.0}}

+
+
Example initializer(dict) for random initialization:

{ ‘random_init’: ‘normal’}

+
+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = []
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = []
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = []
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)[source]
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)[source]
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+reset(state_space, state_positions, **__)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+ diff --git a/parts/physical_systems/electric_motors/extex.html b/parts/physical_systems/electric_motors/extex.html index 35626db2..9503e733 100644 --- a/parts/physical_systems/electric_motors/extex.html +++ b/parts/physical_systems/electric_motors/extex.html @@ -134,6 +134,276 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.DcExternallyExcitedMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_a', 'i_e']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u_a', 'u_e']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+get_state_space(input_currents, input_voltages)
+

Calculate the possible normalized state space for the motor as a tuple of dictionaries “low” and “high”.

+
+
Parameters:
+
    +
  • input_currents – Tuple of the two converters possible output currents.

  • +
  • input_voltages – Tuple of the two converters possible output voltages.

  • +
+
+
Returns:
+

Dictionaries defining if positive and negative values are possible for each motors state.

+
+
Return type:
+

tuple(dict,dict)

+
+
+
+ +
+
+i_in(currents)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+ diff --git a/parts/physical_systems/electric_motors/induction_base.html b/parts/physical_systems/electric_motors/induction_base.html index a4e7e0ef..4ba9120e 100644 --- a/parts/physical_systems/electric_motors/induction_base.html +++ b/parts/physical_systems/electric_motors/induction_base.html @@ -16,6 +16,7 @@ + @@ -117,6 +118,563 @@

Base Induction Motor

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.InductionMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None, initial_limits=None)[source]
+

The InductionMotor and its subclasses implement the technical system of a three phase induction motor.

+

This includes the system equations, the motor parameters of the equivalent circuit diagram, +as well as limits and bandwidth.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

2.9338

Stator resistance

r_r

Ohm

1.355

Rotor resistance

l_m

H

143.75e-3

Main inductance

l_sigs

H

5.87e-3

Stator-side stray inductance

l_sigr

H

5.87e-3

Rotor-side stray inductance

p

1

2

Pole pair number

j_rotor

kg/m^2

0.0011

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_sa

A

Current through line a

i_sb

A

Current through line b

i_sc

A

Current through line c

i_salpha

A

Current in alpha axis

i_sbeta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_sa

V

Phase voltage for line a

u_sb

V

Phase voltage for line b

u_sc

V

Phase voltage for line c

u_salpha

V

Phase voltage in alpha axis

u_sbeta

V

Phase voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

epsilon

Electrical rotational angle

u_sa

Phase voltage in phase a

u_sb

Phase voltage in phase b

u_sc

Phase voltage in phase c

u_salpha

Phase voltage in alpha axis

u_sbeta

Phase voltage in beta axis

u_sd

Phase voltage in direct axis

u_sq

Phase voltage in quadrature axis

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the root mean square (RMS) value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_salpha', 'i_sbeta']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = []
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *args)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_sr_alphabeta, omega, *args)[source]
+

The differential equation of the Induction Motor.

+
+
Parameters:
+
    +
  • state – The momentary state of the motor. [i_salpha, i_sbeta, psi_ralpha, psi_rbeta, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_sr_alphabeta – The input voltages [u_salpha, u_sbeta, u_ralpha, u_rbeta]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt( [i_salpha, i_sbeta, psi_ralpha, psi_rbeta, epsilon])

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, omega=None)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+
diff --git a/parts/physical_systems/electric_motors/permex.html b/parts/physical_systems/electric_motors/permex.html index c3097253..059f65f4 100644 --- a/parts/physical_systems/electric_motors/permex.html +++ b/parts/physical_systems/electric_motors/permex.html @@ -133,6 +133,360 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.DcPermanentlyExcitedMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+

The DcPermanentlyExcitedMotor is a DcMotor with a Permanent Magnet instead of the excitation circuit.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_a

Ohm

16e-3

Armature circuit resistance

l_a

H

19e-6

Armature circuit inductance

psi_e

Wb

0.165

Magnetic Flux of the permanent magnet

j_rotor

kg/m^2

0.025

Moment of inertia of the rotor

+ + + + + + + + + + + + + +

Motor Currents

Unit

Description

i

A

Circuit current

+ + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u

V

Circuit voltage

+ + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

Circuit Current

omega

Angular Velocity

torque

Motor generated torque

u

Circuit Voltage

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)[source]
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+get_state_space(input_currents, input_voltages)[source]
+

Calculate the possible normalized state space for the motor as a tuple of dictionaries “low” and “high”.

+
+
Parameters:
+
    +
  • input_currents – Tuple of the two converters possible output currents.

  • +
  • input_voltages – Tuple of the two converters possible output voltages.

  • +
+
+
Returns:
+

Dictionaries defining if positive and negative values are possible for each motors state.

+
+
Return type:
+

tuple(dict,dict)

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+ diff --git a/parts/physical_systems/electric_motors/pmsm.html b/parts/physical_systems/electric_motors/pmsm.html index 8cfe632c..425fb78f 100644 --- a/parts/physical_systems/electric_motors/pmsm.html +++ b/parts/physical_systems/electric_motors/pmsm.html @@ -135,6 +135,550 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.PermanentMagnetSynchronousMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

18e-3

Stator resistance

l_d

H

0.37e-3

Direct axis inductance

l_q

H

1.2e-3

Quadrature axis inductance

p

1

3

Pole pair number

j_rotor

kg/m^2

0.03883

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_a

A

Current through line a

i_b

A

Current through line b

i_c

A

Current through line c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_a

V

Phase voltage for line a

u_b

V

Phase voltage for line b

u_c

V

Phase voltage for line c

u_alpha

V

Phase voltage in alpha axis

u_beta

V

Phase voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

epsilon

Electrical rotational angle

u_a

Phase voltage in phase a

u_b

Phase voltage in phase b

u_c

Phase voltage in phase c

u_alpha

Phase voltage in alpha axis

u_beta

Phase voltage in beta axis

u_sd

Phase voltage in direct axis

u_sq

Phase voltage in quadrature axis

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the RMS value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_sd', 'i_sq']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u_sd', 'u_sq']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *args)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_dq, omega, *_)
+

The differential equation of the Synchronous Motor.

+
+
Parameters:
+
    +
  • state – The current state of the motor. [i_sd, i_sq, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_qd – The input voltages [u_sd, u_sq]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt([i_sd, i_sq, epsilon])

+
+
+
+ +
+
+i_in(state)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+ diff --git a/parts/physical_systems/electric_motors/scim.html b/parts/physical_systems/electric_motors/scim.html index edb805e9..0a49537a 100644 --- a/parts/physical_systems/electric_motors/scim.html +++ b/parts/physical_systems/electric_motors/scim.html @@ -141,6 +141,583 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.SquirrelCageInductionMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None, initial_limits=None)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

2.9338

Stator resistance

r_r

Ohm

1.355

Rotor resistance

l_m

H

143.75e-3

Main inductance

l_sigs

H

5.87e-3

Stator-side stray inductance

l_sigr

H

5.87e-3

Rotor-side stray inductance

p

1

2

Pole pair number

j_rotor

kg/m^2

0.0011

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_sa

A

Stator current through branch a

i_sb

A

Stator current through branch b

i_sc

A

Stator current through branch c

i_salpha

A

Stator current in alpha direction

i_sbeta

A

Stator current in beta direction

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Rotor flux

Unit

Description

psi_rd

Vs

Direct axis of the rotor oriented flux

psi_rq

Vs

Quadrature axis of the rotor oriented flux

psi_ra

Vs

Rotor oriented flux in branch a

psi_rb

Vs

Rotor oriented flux in branch b

psi_rc

Vs

Rotor oriented flux in branch c

psi_ralpha

Vs

Rotor oriented flux in alpha direction

psi_rbeta

Vs

Rotor oriented flux in beta direction

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_sa

V

Stator voltage through branch a

u_sb

V

Stator voltage through branch b

u_sc

V

Stator voltage through branch c

u_salpha

V

Stator voltage in alpha axis

u_sbeta

V

Stator voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_sa

Current in phase a

i_sb

Current in phase b

i_sc

Current in phase c

i_salpha

Current in alpha axis

i_sbeta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

u_sa

Voltage in phase a

u_sb

Voltage in phase b

u_sc

Voltage in phase c

u_salpha

Voltage in alpha axis

u_sbeta

Voltage in beta axis

u_sd

Voltage in direct axis

u_sq

Voltage in quadrature axis

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +Typically the rms value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the rms value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_salpha', 'i_sbeta']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = []
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *args)
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_salphabeta, omega, *args)[source]
+

The differential equation of the SCIM. +Sets u_ralpha = u_rbeta = 0 before calling the respective super function.

+
+ +
+
+i_in(state)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, omega=None)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+ diff --git a/parts/physical_systems/electric_motors/series.html b/parts/physical_systems/electric_motors/series.html index bd288c84..eb27dd79 100644 --- a/parts/physical_systems/electric_motors/series.html +++ b/parts/physical_systems/electric_motors/series.html @@ -133,6 +133,370 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.DcSeriesMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+

The DcSeriesMotor is a DcMotor with an armature and exciting circuit connected in series to one input voltage.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_a

Ohm

16e-3

Armature circuit resistance

r_e

Ohm

48e-3

Exciting circuit resistance

l_a

H

19e-6

Armature circuit inductance

l_e

H

5.4e-3

Exciting circuit inductance

l_e_prime

H

1.7e-3

Effective excitation inductance

j_rotor

kg/m^2

0.025

Moment of inertia of the rotor

+ + + + + + + + + + + + + +

Motor Currents

Unit

Description

i

A

Circuit current

+ + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u

V

Circuit voltage

+ + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

Circuit Current

omega

Angular Velocity

torque

Motor generated torque

u

Circuit Voltage

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)[source]
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+get_state_space(input_currents, input_voltages)[source]
+

Calculate the possible normalized state space for the motor as a tuple of dictionaries “low” and “high”.

+
+
Parameters:
+
    +
  • input_currents – Tuple of the two converters possible output currents.

  • +
  • input_voltages – Tuple of the two converters possible output voltages.

  • +
+
+
Returns:
+

Dictionaries defining if positive and negative values are possible for each motors state.

+
+
Return type:
+

tuple(dict,dict)

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+ diff --git a/parts/physical_systems/electric_motors/shunt.html b/parts/physical_systems/electric_motors/shunt.html index bdde4fa9..caa55ca0 100644 --- a/parts/physical_systems/electric_motors/shunt.html +++ b/parts/physical_systems/electric_motors/shunt.html @@ -134,6 +134,377 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.DcShuntMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+

The DcShuntMotor is a DC motor with parallel armature and exciting circuit connected to one input voltage.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_a

Ohm

16e-3

Armature circuit resistance

r_e

Ohm

4e-1

Exciting circuit resistance

l_a

H

19e-6

Armature circuit inductance

l_e

H

5.4e-3

Exciting circuit inductance

l_e_prime

H

1.7e-3

Effective excitation inductance

j_rotor

kg/m^2

0.025

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_a

A

Armature circuit current

i_e

A

Exciting circuit current

+ + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u

V

Voltage applied to both circuits

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i_a

Armature current

i_e

Exciting current

omega

Angular Velocity

torque

Motor generated torque

u

Voltage

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_a', 'i_e']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)[source]
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+get_state_space(input_currents, input_voltages)[source]
+

Calculate the possible normalized state space for the motor as a tuple of dictionaries “low” and “high”.

+
+
Parameters:
+
    +
  • input_currents – The converters possible output currents.

  • +
  • input_voltages – The converters possible output voltages.

  • +
+
+
Returns:
+

Dictionaries defining if positive and negative values are possible for each motors state.

+
+
Return type:
+

tuple(dict,dict)

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+ diff --git a/parts/physical_systems/electric_motors/synchronous_base.html b/parts/physical_systems/electric_motors/synchronous_base.html index 32fb89e5..602a2e77 100644 --- a/parts/physical_systems/electric_motors/synchronous_base.html +++ b/parts/physical_systems/electric_motors/synchronous_base.html @@ -16,6 +16,7 @@ + @@ -117,6 +118,558 @@

Base Synchronous Motor

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.SynchronousMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+

The SynchronousMotor and its subclasses implement the technical system of a three phase synchronous motor.

+

This includes the system equations, the motor parameters of the equivalent circuit diagram, +as well as limits and bandwidth.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

0.78

Stator resistance

l_d

H

1.2

Direct axis inductance

l_q

H

6.3e-3

Quadrature axis inductance

psi_p

Wb

0.0094

Effective excitation flux (PMSM only)

p

1

2

Pole pair number

j_rotor

kg/m^2

0.017

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_a

A

Current through line a

i_b

A

Current through line b

i_c

A

Current through line c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_a

V

Phase voltage for line a

u_b

V

Phase voltage for line b

u_c

V

Phase voltage for line c

u_alpha

V

Phase voltage in alpha axis

u_beta

V

Phase voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

torque

Motor generated torque

epsilon

Electrical rotational angle

u_a

Phase voltage in phase a

u_b

Phase voltage in phase b

u_c

Phase voltage in phase c

u_alpha

Phase voltage in alpha axis

u_beta

Phase voltage in beta axis

u_sd

Phase voltage in direct axis

u_sq

Phase voltage in quadrature axis

+
+

Note

+

The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the root mean square (RMS) value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_sd', 'i_sq']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u_sd', 'u_sq']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_dq, omega, *_)[source]
+

The differential equation of the Synchronous Motor.

+
+
Parameters:
+
    +
  • state – The current state of the motor. [i_sd, i_sq, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_qd – The input voltages [u_sd, u_sq]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt([i_sd, i_sq, epsilon])

+
+
+
+ +
+
+i_in(state)[source]
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+
diff --git a/parts/physical_systems/electric_motors/synrm.html b/parts/physical_systems/electric_motors/synrm.html index 2387cb14..e92e67eb 100644 --- a/parts/physical_systems/electric_motors/synrm.html +++ b/parts/physical_systems/electric_motors/synrm.html @@ -135,6 +135,548 @@

Torque Equation

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.SynchronousReluctanceMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None)[source]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Parameter

Unit

Default Value

Description

r_s

Ohm

0.57

Stator resistance

l_d

H

10.1e-3

Direct axis inductance

l_q

H

4.1e-3

Quadrature axis inductance

p

1

4

Pole pair number

j_rotor

kg/m^2

0.8e-3

Moment of inertia of the rotor

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Currents

Unit

Description

i_sd

A

Direct axis current

i_sq

A

Quadrature axis current

i_a

A

Current through branch a

i_b

A

Current through branch b

i_c

A

Current through branch c

i_alpha

A

Current in alpha axis

i_beta

A

Current in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Motor Voltages

Unit

Description

u_sd

V

Direct axis voltage

u_sq

V

Quadrature axis voltage

u_a

V

Voltage through branch a

u_b

V

Voltage through branch b

u_c

V

Voltage through branch c

u_alpha

V

Voltage in alpha axis

u_beta

V

Voltage in beta axis

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Limits /

Nominal Value Dictionary Entries:

Entry

Description

i

General current limit / nominal value

i_a

Current in phase a

i_b

Current in phase b

i_c

Current in phase c

i_alpha

Current in alpha axis

i_beta

Current in beta axis

i_sd

Current in direct axis

i_sq

Current in quadrature axis

omega

Mechanical angular Velocity

epsilon

Electrical rotational angle

torque

Motor generated torque

u_a

Voltage in phase a

u_b

Voltage in phase b

u_c

Voltage in phase c

u_alpha

Voltage in alpha axis

u_beta

Voltage in beta axis

u_sd

Voltage in direct axis

u_sq

Voltage in quadrature axis

+

Note: +The voltage limits should be the peak-to-peak value of the phase voltage (\(\hat{u}_S\)). +A phase voltage denotes the potential difference from a line to the neutral point in contrast to the line voltage between two lines. +Typically the root mean square (RMS) value for the line voltage (\(U_L\)) is given as +\(\hat{u}_S=\sqrt{2/3}~U_L\)

+

The current limits should be the peak-to-peak value of the phase current (\(\hat{i}_S\)). +Typically the RMS value for the phase current (\(I_S\)) is given as +\(\hat{i}_S = \sqrt{2}~I_S\)

+

If not specified, nominal values are equal to their corresponding limit values. +Furthermore, if specific limits/nominal values (e.g. i_a) are not specified they are inferred from +the general limits/nominal values (e.g. i)

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = ['i_sd', 'i_sq']
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = [0, 1]
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = ['u_sd', 'u_sq']
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)[source]
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_dq, omega, *_)
+

The differential equation of the Synchronous Motor.

+
+
Parameters:
+
    +
  • state – The current state of the motor. [i_sd, i_sq, epsilon]

  • +
  • omega – The mechanical load

  • +
  • u_qd – The input voltages [u_sd, u_sq]

  • +
+
+
Returns:
+

The derivatives of the state vector d/dt([i_sd, i_sq, epsilon])

+
+
+
+ +
+
+i_in(state)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+ diff --git a/parts/physical_systems/electric_motors/three_phase_base.html b/parts/physical_systems/electric_motors/three_phase_base.html index 45ab1575..b0d2e89c 100644 --- a/parts/physical_systems/electric_motors/three_phase_base.html +++ b/parts/physical_systems/electric_motors/three_phase_base.html @@ -117,6 +117,365 @@

Base Three Phase Motor

Code Documentation

+
+
+class gym_electric_motor.physical_systems.electric_motors.ThreePhaseMotor(motor_parameter=None, nominal_values=None, limit_values=None, motor_initializer=None, initial_limits=None)[source]
+

The ThreePhaseMotor and its subclasses implement the technical system of Three Phase Motors.

+

This includes the system equations, the motor parameters of the equivalent circuit diagram, +as well as limits and bandwidth.

+
+
Parameters:
+
    +
  • motor_parameter – Motor parameter dictionary. Contents specified +for each motor.

  • +
  • nominal_values – Nominal values for the motor quantities.

  • +
  • limit_values – Limits for the motor quantities.

  • +
  • motor_initializer

    Initial motor states (currents) +(‘constant’, ‘uniform’, ‘gaussian’ sampled from

    +
    +

    given interval or out of nominal motor values)

    +
    +

  • +
  • initial_limits – limits for of the initial state-value

  • +
+
+
+
+
+CURRENTS = []
+

List of the motor currents names

+
+
Type:
+

CURRENTS(list(str))

+
+
+
+ +
+
+CURRENTS_IDX = []
+

Indices for accessing all motor currents.

+
+
Type:
+

CURRENTS_IDX(list(int))

+
+
+
+ +
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+VOLTAGES = []
+

List of the motor input voltages names

+
+
Type:
+

VOLTAGES(list(str))

+
+
+
+ +
+
+electrical_jacobian(state, u_in, omega, *_)
+

Calculation of the jacobian of each motor ODE for the given inputs / The motors ODE-System.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

[0]: Derivatives of all electrical motor states over all electrical motor states shape:(states x states) +[1]: Derivatives of all electrical motor states over omega shape:(states,) +[2]: Derivative of Torque over all motor states shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray, ndarray)

+
+
+
+ +
+
+electrical_ode(state, u_in, omega, *_)
+

Calculation of the derivatives of each motor state variable for the given inputs / The motors ODE-System.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – The motors state.

  • +
  • u_in (list(float)) – The motors input voltages.

  • +
  • omega (float) – Angular velocity of the motor

  • +
+
+
Returns:
+

Derivatives of the motors ODE-system for the given inputs.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+i_in(state)
+
+
Parameters:
+

state (ndarray(float)) – ODE state of the motor

+
+
Returns:
+

List of all currents flowing into the motor.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+property initial_limits
+

Returns: +dict: nominal motor limits for choosing initial values

+
+ +
+
+initialize(state_space, state_positions, **__)
+

Initializes given state values. Values can be given as a constant or +sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval. Values are written in +initial_states attribute

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries (given by physical system)

  • +
  • state_positions (dict) – indices of system states (given by physical system)

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: Motor initial state and additional initializer parameter

+
+ +
+
+property limits
+

Readonly motors limit state array. Entries are set to the maximum physical possible values +in case of unspecified limits.

+
+
Returns:
+

Limits of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+property motor_parameter
+

Returns: +dict(float): The motors parameter dictionary

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Readonly motors nominal values.

+
+
Returns:
+

Current nominal values of the motor.

+
+
Return type:
+

dict(float)

+
+
+
+ +
+
+static q(quantities, epsilon)[source]
+

Transformation of the dq-representation into alpha-beta using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+static q_inv(quantities, epsilon)[source]
+

Transformation of the alpha-beta-representation into dq using the electrical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current electrical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_inv_me(quantities, epsilon)[source]
+

Transformation of the alpha-beta-representation into dq using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in alpha-beta-representation. Example [u_alpha, u_beta]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to dq-representation. Example [u_d, u_q]

+
+
+
+

Note

+

The transformation from alpha-beta to dq is just its inverse conversion with negated epsilon. +So this method calls q(quantities, -epsilon).

+
+
+ +
+
+q_me(quantities, epsilon)[source]
+

Transformation of the dq-representation into alpha-beta using the mechanical angle

+
+
Parameters:
+
    +
  • quantities – Array of two quantities in dq-representation. Example [i_d, i_q]

  • +
  • epsilon – Current mechanical angle of the motor

  • +
+
+
Returns:
+

Array of the two quantities converted to alpha-beta-representation. Example [u_alpha, u_beta]

+
+
+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+static t_23(quantities)[source]
+

Transformation from abc representation to alpha-beta representation

+
+
Parameters:
+

quantities – The properties in the abc representation like ‘’[u_a, u_b, u_c]’’

+
+
Returns:
+

The converted quantities in the alpha-beta representation like ‘’[u_alpha, u_beta]’’

+
+
+
+ +
+
+static t_32(quantities)[source]
+

Transformation from alpha-beta representation to abc representation

+
+
Parameters:
+

quantities – The properties in the alpha-beta representation like [u_alpha, u_beta]

+
+
Returns:
+

The converted quantities in the abc representation like [u_a, u_b, u_c]

+
+
+
+ +
+
diff --git a/parts/physical_systems/mechanical_loads/const_speed_load.html b/parts/physical_systems/mechanical_loads/const_speed_load.html index eabdb300..55dcaf6f 100644 --- a/parts/physical_systems/mechanical_loads/const_speed_load.html +++ b/parts/physical_systems/mechanical_loads/const_speed_load.html @@ -108,6 +108,216 @@

Constant Speed Load

Class Description

+
+
+class gym_electric_motor.physical_systems.mechanical_loads.ConstantSpeedLoad(omega_fixed=0, load_initializer=None, **kwargs)[source]
+

Constant speed mechanical load system which will always set the speed +to a predefined value.

+
+
Parameters:
+

omega_fixed (float)) – Fix value for the speed in rad/s.

+
+
+
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+get_state_space(omega_range)
+
+
Parameters:
+

omega_range (Tuple(int,int)) – Lower and upper values the motor can generate for omega normalized to (-1, 1)

+
+
Returns:
+

Lowest and highest possible values for all states normalized to (-1, 1)

+
+
Return type:
+

Tuple(dict,dict)

+
+
+
+ +
+
+initialize(state_space, state_positions, nominal_state, **__)
+

Initializes the state of the load on an episode start.

+

Values can be given as a constant or sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval.

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from physical system

  • +
  • state_space (gymnasium.spaces.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: The motors initial state and additional initializer parameters

+
+ +
+
+property j_total
+

Returns: +float: Total moment of inertia affecting the motor shaft.

+
+ +
+
+property limits
+

Returns: +dict(float): Mapping of the motor states to their limit values.

+
+ +
+
+mechanical_jacobian(t, mechanical_state, torque)[source]
+

Calculation of the jacobians of the mechanical-ODE for each of the mechanical state.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

[0]: Derivatives of the mechanical_state-odes over the mechanical_states shape:(states x states) +[1]: Derivatives of the mechanical_state-odes over the torque shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray)

+
+
+
+ +
+
+mechanical_ode(*_, **__)[source]
+

Calculation of the derivatives of the mechanical-ODE for each of the mechanical states.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

Derivatives of the mechanical state for the given input torque.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Returns: +dict(float): Mapping of the motor states to their nominal values

+
+ +
+
+property omega_fixed
+

Returns: +float: Constant value for omega in rad/s.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, nominal_state, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from +physical system

  • +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_j_rotor(j_rotor)
+
+
Parameters:
+

j_rotor (float) – The moment of inertia of the rotor shaft of the motor.

+
+
+
+ +
+
+property state_names
+

Returns: +list(str): Names of the states in the mechanical-ODE.

+
+ +
+
diff --git a/parts/physical_systems/mechanical_loads/ext_speed_load.html b/parts/physical_systems/mechanical_loads/ext_speed_load.html index f1cf7057..e60f5de1 100644 --- a/parts/physical_systems/mechanical_loads/ext_speed_load.html +++ b/parts/physical_systems/mechanical_loads/ext_speed_load.html @@ -108,6 +108,229 @@

External Speed Load

Class Description

+
+
+class gym_electric_motor.physical_systems.mechanical_loads.ExternalSpeedLoad(speed_profile, load_initializer=None, tau=0.0001, speed_profile_kwargs=None, **kwargs)[source]
+

External speed mechanical load system which will set the speed to a +predefined speed-function/ speed-profile.

+
+
Parameters:
+
    +
  • speed_profile (float -> float) –

    A callable(t, **speed_profile_args) -> float +which takes a timestep t and custom further arguments and returns a speed omega +.. rubric:: Example

    +

    (lambda t, amplitude, freq: amplitude*numpy.sin(2*pi*f))) +with additional parameters:

    +
    +

    amplitude(float), freq(float), time(float)

    +
    +

  • +
  • tau (float) – discrete time step of the system

  • +
  • speed_profile_kwargs (dict) – further arguments for speed_profile

  • +
  • kwargs (dict) – Arguments to be passed to superclass MechanicalLoad

  • +
+
+
+
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+get_state_space(omega_range)
+
+
Parameters:
+

omega_range (Tuple(int,int)) – Lower and upper values the motor can generate for omega normalized to (-1, 1)

+
+
Returns:
+

Lowest and highest possible values for all states normalized to (-1, 1)

+
+
Return type:
+

Tuple(dict,dict)

+
+
+
+ +
+
+initialize(state_space, state_positions, nominal_state, **__)
+

Initializes the state of the load on an episode start.

+

Values can be given as a constant or sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval.

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from physical system

  • +
  • state_space (gymnasium.spaces.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: The motors initial state and additional initializer parameters

+
+ +
+
+property j_total
+

Returns: +float: Total moment of inertia affecting the motor shaft.

+
+ +
+
+property limits
+

Returns: +dict(float): Mapping of the motor states to their limit values.

+
+ +
+
+mechanical_jacobian(t, mechanical_state, torque)[source]
+

Calculation of the jacobians of the mechanical-ODE for each of the mechanical state.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

[0]: Derivatives of the mechanical_state-odes over the mechanical_states shape:(states x states) +[1]: Derivatives of the mechanical_state-odes over the torque shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray)

+
+
+
+ +
+
+mechanical_ode(t, mechanical_state, torque=None)[source]
+

Calculation of the derivatives of the mechanical-ODE for each of the mechanical states.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

Derivatives of the mechanical state for the given input torque.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Returns: +dict(float): Mapping of the motor states to their nominal values

+
+ +
+
+property omega
+

Returns: +float: Function-value for omega in rad/s at time-step t.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(**kwargs)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from +physical system

  • +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_j_rotor(j_rotor)
+
+
Parameters:
+

j_rotor (float) – The moment of inertia of the rotor shaft of the motor.

+
+
+
+ +
+
+property state_names
+

Returns: +list(str): Names of the states in the mechanical-ODE.

+
+ +
+
diff --git a/parts/physical_systems/mechanical_loads/mechanical_load.html b/parts/physical_systems/mechanical_loads/mechanical_load.html index 3027fe5a..bf48c296 100644 --- a/parts/physical_systems/mechanical_loads/mechanical_load.html +++ b/parts/physical_systems/mechanical_loads/mechanical_load.html @@ -116,6 +116,198 @@

Mechanical Loads

MechanicalLoad Base Class

+
+
+class gym_electric_motor.physical_systems.mechanical_loads.MechanicalLoad(state_names=None, j_load=0.0, load_initializer=None)[source]
+

The MechanicalLoad is the base class for all the mechanical systems attached +to the electrical motors rotor.

+

It contains an mechanical ode system as well as the state names, limits and +nominal values of the mechanical quantities. The only required state is +‘omega’ as the rotational speed of the motor shaft in rad/s. +ConstantSpeedLoad can be initialized with the initializer as an +class parameter by instantiation. ExternalSpeedLoad takes the first value +of the SpeedProfile as initial value.

+

Initialization is given by initializer(dict). Can be a constant state value +or random value in given interval. +dict should be like:

+
+
+
{ ‘states’(dict): with state names and initial values
+
‘interval’(array like): boundaries for each state

(only for random init), shape(num states, 2)

+
+
+

‘random_init’(str): ‘uniform’ or ‘normal’ +‘random_params(tuple): mue(float), sigma(int)

+
+
+
+
+
Example initializer(dict) for constant initialization:

{ ‘states’: {‘omega’: 16.0}}

+
+
Example initializer(dict) for random initialization:

{ ‘random_init’: ‘normal’}

+
+
+
+
Parameters:
+
    +
  • state_names (list(str)) – List of the names of the states in the mechanical-ODE.

  • +
  • j_load (float) – Moment of inertia of the load affecting the motor shaft.

  • +
+
+
+
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+get_state_space(omega_range)[source]
+
+
Parameters:
+

omega_range (Tuple(int,int)) – Lower and upper values the motor can generate for omega normalized to (-1, 1)

+
+
Returns:
+

Lowest and highest possible values for all states normalized to (-1, 1)

+
+
Return type:
+

Tuple(dict,dict)

+
+
+
+ +
+
+initialize(state_space, state_positions, nominal_state, **__)[source]
+

Initializes the state of the load on an episode start.

+

Values can be given as a constant or sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval.

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from physical system

  • +
  • state_space (gymnasium.spaces.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: The motors initial state and additional initializer parameters

+
+ +
+
+property j_total
+

Returns: +float: Total moment of inertia affecting the motor shaft.

+
+ +
+
+property limits
+

Returns: +dict(float): Mapping of the motor states to their limit values.

+
+ +
+
+mechanical_jacobian(t, mechanical_state, torque)[source]
+

Calculation of the jacobians of the mechanical-ODE for each of the mechanical state.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

[0]: Derivatives of the mechanical_state-odes over the mechanical_states shape:(states x states) +[1]: Derivatives of the mechanical_state-odes over the torque shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray)

+
+
+
+ +
+
+mechanical_ode(t, mechanical_state, torque)[source]
+

Calculation of the derivatives of the mechanical-ODE for each of the mechanical states.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

Derivatives of the mechanical state for the given input torque.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+property nominal_values
+

Returns: +dict(float): Mapping of the motor states to their nominal values

+
+ +
+
+reset(state_space, state_positions, nominal_state, **__)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from +physical system

  • +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+set_j_rotor(j_rotor)[source]
+
+
Parameters:
+

j_rotor (float) – The moment of inertia of the rotor shaft of the motor.

+
+
+
+ +
+
+property state_names
+

Returns: +list(str): Names of the states in the mechanical-ODE.

+
+ +
+ diff --git a/parts/physical_systems/mechanical_loads/ornstein_uhlenbeck_load.html b/parts/physical_systems/mechanical_loads/ornstein_uhlenbeck_load.html index 0c9eb029..57cae3b2 100644 --- a/parts/physical_systems/mechanical_loads/ornstein_uhlenbeck_load.html +++ b/parts/physical_systems/mechanical_loads/ornstein_uhlenbeck_load.html @@ -108,6 +108,215 @@

Ornstein Uhlenbeck Load

Class Description

+
+
+class gym_electric_motor.physical_systems.mechanical_loads.OrnsteinUhlenbeckLoad(mu=0, sigma=0.0001, theta=1, tau=0.0001, omega_range=(-200.0, 200.0), **kwargs)[source]
+

The Ornstein-Uhlenbeck Load sets the speed to a torque-independent signal specified by the underlying OU-Process.

+
+
Parameters:
+
    +
  • mu (float) – Mean value of the underlying gaussian distribution of the OU-Process.

  • +
  • sigma (float) – Standard deviation of the underlying gaussian distribution of the OU-Process.

  • +
  • theta (float) – Drift towards the mean of the OU-Process.

  • +
  • tau (float) – discrete time step of the system

  • +
  • omega_range (2-Tuple(float)) – Minimal and maximal value for the process.

  • +
  • kwargs (dict) – further arguments passed to the superclass MechanicalLoad

  • +
+
+
+
+
+HAS_JACOBIAN = False
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+get_state_space(omega_range)
+
+
Parameters:
+

omega_range (Tuple(int,int)) – Lower and upper values the motor can generate for omega normalized to (-1, 1)

+
+
Returns:
+

Lowest and highest possible values for all states normalized to (-1, 1)

+
+
Return type:
+

Tuple(dict,dict)

+
+
+
+ +
+
+initialize(state_space, state_positions, nominal_state, **__)
+

Initializes the state of the load on an episode start.

+

Values can be given as a constant or sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval.

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from physical system

  • +
  • state_space (gymnasium.spaces.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: The motors initial state and additional initializer parameters

+
+ +
+
+property j_total
+

Returns: +float: Total moment of inertia affecting the motor shaft.

+
+ +
+
+property limits
+

Returns: +dict(float): Mapping of the motor states to their limit values.

+
+ +
+
+mechanical_jacobian(t, mechanical_state, torque)
+

Calculation of the jacobians of the mechanical-ODE for each of the mechanical state.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

[0]: Derivatives of the mechanical_state-odes over the mechanical_states shape:(states x states) +[1]: Derivatives of the mechanical_state-odes over the torque shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray)

+
+
+
+ +
+
+mechanical_ode(t, mechanical_state, torque)[source]
+

Calculation of the derivatives of the mechanical-ODE for each of the mechanical states.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

Derivatives of the mechanical state for the given input torque.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Returns: +dict(float): Mapping of the motor states to their nominal values

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(**kwargs)[source]
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from +physical system

  • +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_j_rotor(j_rotor)
+
+
Parameters:
+

j_rotor (float) – The moment of inertia of the rotor shaft of the motor.

+
+
+
+ +
+
+property state_names
+

Returns: +list(str): Names of the states in the mechanical-ODE.

+
+ +
+
diff --git a/parts/physical_systems/mechanical_loads/polystatic.html b/parts/physical_systems/mechanical_loads/polystatic.html index c32624a2..b62756a0 100644 --- a/parts/physical_systems/mechanical_loads/polystatic.html +++ b/parts/physical_systems/mechanical_loads/polystatic.html @@ -119,6 +119,249 @@

Polynomial Load Equation

Class Description

+
+
+class gym_electric_motor.physical_systems.mechanical_loads.PolynomialStaticLoad(load_parameter=None, limits=None, load_initializer=None)[source]
+

Mechanical system that models the Mechanical-ODE based on a static polynomial load torque.

+
+
Parameter dictionary entries:
    +
  • \(a / Nm\): Constant Load Torque coefficient (for modeling static friction)

  • +
  • \(b / (Nm s)\): Linear Load Torque coefficient (for modeling sliding friction)

  • +
  • \(c / (Nm s^2)\): Quadratic Load Torque coefficient (for modeling air resistances)

  • +
  • \(j_load / (kg m^2)\) : Moment of inertia of the mechanical system.

  • +
+
+
Usage Example:
>>> import gym_electric_motor as gem
+>>> from gym_electric_motor.physical_systems.mechanical_loads import PolynomialStaticLoad
+>>>
+>>> # Create a custom PolynomialStaticLoad instance
+>>> my_poly_static_load = PolynomialStaticLoad(
+...     load_parameter=dict(a=1e-3, b=1e-4, c=0.0, j_load=1e-3),
+...     limits=dict(omega=150.0), # rad / s
+... )
+>>>
+>>> env = gem.make(
+...     'Cont-SC-ExtExDc-v0',
+...     load=my_poly_static_load
+... )
+>>> terminated = True
+>>> for _ in range(1000):
+>>>     if terminated:
+>>>         state, reference = env.reset()
+>>>     (state, reference), reward, terminated, truncated, _ = env.step(env.action_space.sample())
+
+
+
+
+
+
Parameters:
+
    +
  • load_parameter (dict(float)) – Parameter dictionary. Keys: 'a', 'b', 'c', 'j_load'

  • +
  • limits (dict) – dictionary to update the limits of the load-instance. Keys: 'omega'

  • +
  • load_initializer (dict) – Dictionary to parameterize the initializer.

  • +
+
+
+
+
+HAS_JACOBIAN = True
+

Parameter indicating if the class is implementing the optional jacobian function

+
+ +
+
+get_state_space(omega_range)
+
+
Parameters:
+

omega_range (Tuple(int,int)) – Lower and upper values the motor can generate for omega normalized to (-1, 1)

+
+
Returns:
+

Lowest and highest possible values for all states normalized to (-1, 1)

+
+
Return type:
+

Tuple(dict,dict)

+
+
+
+ +
+
+initialize(state_space, state_positions, nominal_state, **__)
+

Initializes the state of the load on an episode start.

+

Values can be given as a constant or sampled random out of a statistical distribution. Initial value is in +range of the nominal values or a given interval.

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from physical system

  • +
  • state_space (gymnasium.spaces.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
+
+ +
+
+property initializer
+

Returns: +dict: The motors initial state and additional initializer parameters

+
+ +
+
+property j_total
+

Returns: +float: Total moment of inertia affecting the motor shaft.

+
+ +
+
+property limits
+

Returns: +dict(float): Mapping of the motor states to their limit values.

+
+ +
+
+property load_parameter
+

Returns: +dict(float): Parameter dictionary of the load.

+
+ +
+
+mechanical_jacobian(t, mechanical_state, torque)[source]
+

Calculation of the jacobians of the mechanical-ODE for each of the mechanical state.

+

Overriding this method is optional for each subclass. If it is overridden, the parameter HAS_JACOBIAN must also +be set to True. Otherwise, the jacobian will not be called.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

[0]: Derivatives of the mechanical_state-odes over the mechanical_states shape:(states x states) +[1]: Derivatives of the mechanical_state-odes over the torque shape:(states,)

+
+
Return type:
+

Tuple(ndarray, ndarray)

+
+
+
+ +
+
+mechanical_ode(t, mechanical_state, torque)[source]
+

Calculation of the derivatives of the mechanical-ODE for each of the mechanical states.

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

  • +
  • mechanical_state (ndarray(float)) – Current state of the mechanical system.

  • +
  • torque (float) – Generated input torque by the electrical motor.

  • +
+
+
Returns:
+

Derivatives of the mechanical state for the given input torque.

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_values
+

Returns: +dict(float): Mapping of the motor states to their nominal values

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(state_space, state_positions, nominal_state, **__)
+

Reset the motors state to a new initial state. (Default 0)

+
+
Parameters:
+
    +
  • nominal_state (list) – nominal values for each state given from +physical system

  • +
  • state_space (gymnasium.Box) – normalized state space boundaries

  • +
  • state_positions (dict) – indexes of system states

  • +
+
+
Returns:
+

The initial motor states.

+
+
Return type:
+

numpy.ndarray(float)

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_j_rotor(j_rotor)[source]
+
+
Parameters:
+

j_rotor (float) – The moment of inertia of the rotor shaft of the motor.

+
+
+
+ +
+
+property state_names
+

Returns: +list(str): Names of the states in the mechanical-ODE.

+
+ +
+ diff --git a/parts/physical_systems/ode_solvers/euler.html b/parts/physical_systems/ode_solvers/euler.html index 9aaf7ce4..92a8493f 100644 --- a/parts/physical_systems/ode_solvers/euler.html +++ b/parts/physical_systems/ode_solvers/euler.html @@ -106,6 +106,90 @@

Euler Solver

+
+
+class gym_electric_motor.physical_systems.solvers.EulerSolver(nsteps=1)[source]
+

Solves a system of differential equations of first order for a given time step with linear approximation.

+
+
+
+
Parameters:
+

nsteps (int) – Number of cycles to calculate for each iteration. Higher steps make the system more accurate, +but take also longer to compute.

+
+
+
+
+integrate(t)[source]
+

Integrate the ODE-System from current time until time t

+
+
Parameters:
+

t (float) – Time until the system shall be integrated

+
+
Returns:
+

New system state at time t

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+set_f_params(*args)
+

Set further arguments for the systems function call like input quantities.

+
+
Parameters:
+

args (list) – Additional arguments for the next function calls.

+
+
+
+ +
+
+set_initial_value(initial_value, t=0)
+

Set the new initial system state after reset.

+
+
Parameters:
+
    +
  • initial_value (numpy.ndarray(float)) – Initial system state

  • +
  • t (float) – Initial system time

  • +
+
+
+
+ +
+
+set_system_equation(system_equation, jac=None)
+

Setting of the systems equation.

+
+
Parameters:
+
    +
  • system_equation (function_pointer) – Pointer to the systems equation with the parameters (t, y, *args)

  • +
  • jac (function_pointer) – Pointer to the systems jacobian with the parameters (t, y, *args)

  • +
+
+
+
+ +
+
+property t
+

Returns: +float: Current system time t

+
+ +
+
+property y
+

Returns: +float: Current system state y

+
+ +
+
diff --git a/parts/physical_systems/ode_solvers/ode_solver.html b/parts/physical_systems/ode_solvers/ode_solver.html index e1572b27..50637613 100644 --- a/parts/physical_systems/ode_solvers/ode_solver.html +++ b/parts/physical_systems/ode_solvers/ode_solver.html @@ -120,6 +120,82 @@

ODE-Solvers

ODE-Solver Base Class

+
+
+class gym_electric_motor.physical_systems.solvers.OdeSolver[source]
+

Interface and base class for all used OdeSolvers in gym-electric-motor.

+
+
+integrate(t)[source]
+

Integrate the ODE-System from current time until time t

+
+
Parameters:
+

t (float) – Time until the system shall be integrated

+
+
Returns:
+

New system state at time t

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+set_f_params(*args)[source]
+

Set further arguments for the systems function call like input quantities.

+
+
Parameters:
+

args (list) – Additional arguments for the next function calls.

+
+
+
+ +
+
+set_initial_value(initial_value, t=0)[source]
+

Set the new initial system state after reset.

+
+
Parameters:
+
    +
  • initial_value (numpy.ndarray(float)) – Initial system state

  • +
  • t (float) – Initial system time

  • +
+
+
+
+ +
+
+set_system_equation(system_equation, jac=None)[source]
+

Setting of the systems equation.

+
+
Parameters:
+
    +
  • system_equation (function_pointer) – Pointer to the systems equation with the parameters (t, y, *args)

  • +
  • jac (function_pointer) – Pointer to the systems jacobian with the parameters (t, y, *args)

  • +
+
+
+
+ +
+
+property t
+

Returns: +float: Current system time t

+
+ +
+
+property y
+

Returns: +float: Current system state y

+
+ +
+ diff --git a/parts/physical_systems/ode_solvers/scipy_ode.html b/parts/physical_systems/ode_solvers/scipy_ode.html index 1265c0d9..387e3592 100644 --- a/parts/physical_systems/ode_solvers/scipy_ode.html +++ b/parts/physical_systems/ode_solvers/scipy_ode.html @@ -106,6 +106,91 @@

scipy.integrate.ode Solver

+
+
+class gym_electric_motor.physical_systems.solvers.ScipyOdeSolver(integrator='dopri5', **kwargs)[source]
+

Wrapper class for all ode-solvers in the scipy.integrate.ode package.

+

https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html

+
+
Parameters:
+
    +
  • integrator (str) – String to choose the integrator from the scipy.integrate.ode

  • +
  • kwargs (dict) – All parameters that can be set in the “set_integrator”-method of scipy.integrate.ode

  • +
+
+
+
+
+integrate(t)[source]
+

Integrate the ODE-System from current time until time t

+
+
Parameters:
+

t (float) – Time until the system shall be integrated

+
+
Returns:
+

New system state at time t

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+set_f_params(*args)[source]
+

Set further arguments for the systems function call like input quantities.

+
+
Parameters:
+

args (list) – Additional arguments for the next function calls.

+
+
+
+ +
+
+set_initial_value(initial_value, t=0)[source]
+

Set the new initial system state after reset.

+
+
Parameters:
+
    +
  • initial_value (numpy.ndarray(float)) – Initial system state

  • +
  • t (float) – Initial system time

  • +
+
+
+
+ +
+
+set_system_equation(system_equation, jac=None)[source]
+

Setting of the systems equation.

+
+
Parameters:
+
    +
  • system_equation (function_pointer) – Pointer to the systems equation with the parameters (t, y, *args)

  • +
  • jac (function_pointer) – Pointer to the systems jacobian with the parameters (t, y, *args)

  • +
+
+
+
+ +
+
+property t
+

Returns: +float: Current system time t

+
+ +
+
+property y
+

Returns: +float: Current system state y

+
+ +
+
diff --git a/parts/physical_systems/ode_solvers/scipy_odeint.html b/parts/physical_systems/ode_solvers/scipy_odeint.html index fcdd5ce8..1dc2cd8a 100644 --- a/parts/physical_systems/ode_solvers/scipy_odeint.html +++ b/parts/physical_systems/ode_solvers/scipy_odeint.html @@ -106,6 +106,88 @@

scipy.integrate.odeint Solver

+
+
+class gym_electric_motor.physical_systems.solvers.ScipyOdeIntSolver(**kwargs)[source]
+

Wrapper class for all ode-solvers in the scipy.integrate.odeint function.

+

https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.odeint.html

+
+
Parameters:
+

kwargs (dict) – Arguments to pass to the solver. See the scipy description for further information.

+
+
+
+
+integrate(t)[source]
+

Integrate the ODE-System from current time until time t

+
+
Parameters:
+

t (float) – Time until the system shall be integrated

+
+
Returns:
+

New system state at time t

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+set_f_params(*args)
+

Set further arguments for the systems function call like input quantities.

+
+
Parameters:
+

args (list) – Additional arguments for the next function calls.

+
+
+
+ +
+
+set_initial_value(initial_value, t=0)
+

Set the new initial system state after reset.

+
+
Parameters:
+
    +
  • initial_value (numpy.ndarray(float)) – Initial system state

  • +
  • t (float) – Initial system time

  • +
+
+
+
+ +
+
+set_system_equation(system_equation, jac=None)
+

Setting of the systems equation.

+
+
Parameters:
+
    +
  • system_equation (function_pointer) – Pointer to the systems equation with the parameters (t, y, *args)

  • +
  • jac (function_pointer) – Pointer to the systems jacobian with the parameters (t, y, *args)

  • +
+
+
+
+ +
+
+property t
+

Returns: +float: Current system time t

+
+ +
+
+property y
+

Returns: +float: Current system state y

+
+ +
+
diff --git a/parts/physical_systems/ode_solvers/scipy_solve_ivp.html b/parts/physical_systems/ode_solvers/scipy_solve_ivp.html index 200f7684..6d4658ae 100644 --- a/parts/physical_systems/ode_solvers/scipy_solve_ivp.html +++ b/parts/physical_systems/ode_solvers/scipy_solve_ivp.html @@ -106,6 +106,83 @@

scipy.integrate.solve_ivp Solver

+
+
+class gym_electric_motor.physical_systems.solvers.ScipySolveIvpSolver(**kwargs)[source]
+

Wrapper class for all ode-solvers in the scipy.integrate.solve_ivp function

+

https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html

+
+
+integrate(t)[source]
+

Integrate the ODE-System from current time until time t

+
+
Parameters:
+

t (float) – Time until the system shall be integrated

+
+
Returns:
+

New system state at time t

+
+
Return type:
+

ndarray(float)

+
+
+
+ +
+
+set_f_params(*args)
+

Set further arguments for the systems function call like input quantities.

+
+
Parameters:
+

args (list) – Additional arguments for the next function calls.

+
+
+
+ +
+
+set_initial_value(initial_value, t=0)
+

Set the new initial system state after reset.

+
+
Parameters:
+
    +
  • initial_value (numpy.ndarray(float)) – Initial system state

  • +
  • t (float) – Initial system time

  • +
+
+
+
+ +
+
+set_system_equation(system_equation, jac=None)[source]
+

Setting of the systems equation.

+
+
Parameters:
+
    +
  • system_equation (function_pointer) – Pointer to the systems equation with the parameters (t, y, *args)

  • +
  • jac (function_pointer) – Pointer to the systems jacobian with the parameters (t, y, *args)

  • +
+
+
+
+ +
+
+property t
+

Returns: +float: Current system time t

+
+ +
+
+property y
+

Returns: +float: Current system state y

+
+ +
+
diff --git a/parts/physical_systems/physical_system.html b/parts/physical_systems/physical_system.html index 019eca88..cd343bc7 100644 --- a/parts/physical_systems/physical_system.html +++ b/parts/physical_systems/physical_system.html @@ -97,6 +97,118 @@

Physical Systems

Physical System Base Class

+
+
+class gym_electric_motor.core.PhysicalSystem(action_space, state_space, state_names, tau)[source]
+

The Physical System module encapsulates the physical model of the system as well as the simulation from one step +to the next.

+
+
Parameters:
+
    +
  • action_space (gymnasium.Space) – The set of allowed actions on the system.

  • +
  • state_space (gymnasium.Space) – The set of possible systems states.

  • +
  • state_names (ndarray(str)) – The names of the systems states

  • +
  • tau (float) – The systems simulation time interval.

  • +
+
+
+
+
+property action_space
+

Returns: +gymnasium.Space: An Farama Gymnasium Space that describes the possible actions on the system.

+
+ +
+
+close()[source]
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

Returns: +ndarray(float): An array containing the maximum allowed physical values for each state variable.

+
+ +
+
+property nominal_state
+

Returns: +ndarray(float): An array containing the nominal values for each state variable.

+
+ +
+
+reset(initial_state=None)[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

Returns: +ndarray(str): Array containing the names of the systems states.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

Returns: +gymnasium.Space: An Farama Gymnasium Space that describes the possible states of the system.

+
+ +
+
+property unwrapped
+

Returns this instance of the physical system.

+

If the system is wrapped into multiple PhysicalSystemWrappers this property returns directly the innermost system.

+
+ +
+ diff --git a/parts/physical_systems/scml_system.html b/parts/physical_systems/scml_system.html index 72cd3ff7..51a4be2f 100644 --- a/parts/physical_systems/scml_system.html +++ b/parts/physical_systems/scml_system.html @@ -116,17 +116,274 @@

Supply Converter Motor Load System (SCML) +
+class gym_electric_motor.physical_systems.physical_systems.SCMLSystem(converter, motor, load, supply, ode_solver, tau=0.0001, calc_jacobian=None)[source]
+

The SCML(Supply-Converter-Motor-Load)-System is used for the simulation of +a technical setting consisting of these components and a solver for the electrical ODE of the motor and mechanical +ODE of the load.

+
+
Parameters:
+
    +
  • converter (PowerElectronicConverter) – Converter for the physical system

  • +
  • motor (ElectricMotor) – Motor of the system

  • +
  • load (MechanicalLoad) – Mechanical Load of the System

  • +
  • supply (VoltageSupply) – Voltage Supply

  • +
  • ode_solver (OdeSolver) – Ode Solver to use in this setting

  • +
  • tau (float) – discrete time step of the system

  • +
  • calc_jacobian (bool) – If True, the jacobian matrices will be taken into account for the ode-solvers. +Default: The jacobians are used, if available

  • +
+
+
+
+
+property converter
+

The power electronic converter instance in the system

+
+ +
+
+property electrical_motor
+

The electrical motor instance of the system

+
+ +
+
+property limits
+

Returns: +ndarray(float): An array containing the maximum allowed physical values for each state variable.

+
+ +
+
+property mechanical_load
+

The mechanical load instance in the system

+
+ +
+
+property nominal_state
+

Returns: +ndarray(float): An array containing the nominal values for each state variable.

+
+ +
+
+reset(*_)[source]
+

Reset all the systems modules to an initial state.

+
+
Returns:
+

The new state of the system.

+
+
+
+ +
+
+seed(seed=None)[source]
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+simulate(action, *_, **__)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property supply
+

The voltage supply instance in the physical system

+
+ +
+

Dc Motor System

+
+
+class gym_electric_motor.physical_systems.physical_systems.DcMotorSystem(converter, motor, load, supply, ode_solver, tau=0.0001, calc_jacobian=None)[source]
+

SCML-System that can be used for all DC Motors.

+
+
Parameters:
+
    +
  • converter (PowerElectronicConverter) – Converter for the physical system

  • +
  • motor (ElectricMotor) – Motor of the system

  • +
  • load (MechanicalLoad) – Mechanical Load of the System

  • +
  • supply (VoltageSupply) – Voltage Supply

  • +
  • ode_solver (OdeSolver) – Ode Solver to use in this setting

  • +
  • tau (float) – discrete time step of the system

  • +
  • calc_jacobian (bool) – If True, the jacobian matrices will be taken into account for the ode-solvers. +Default: The jacobians are used, if available

  • +
+
+
+
+

Synchronous Motor System

+
+
+class gym_electric_motor.physical_systems.physical_systems.SynchronousMotorSystem(control_space='abc', **kwargs)[source]
+

SCML-System that can be used with all Synchronous Motors

+
+
Parameters:
+
    +
  • control_space (str) – (‘abc’ or ‘dq’) Choose, if actions the actions space is in dq or abc space

  • +
  • kwargs – Further arguments to pass tp SCMLSystem

  • +
+
+
+
+
+reset(*_)[source]
+

Reset all the systems modules to an initial state.

+
+
Returns:
+

The new state of the system.

+
+
+
+ +
+
+simulate(action, *_, **__)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+

Squirrel Cage Induction Motor System

+
+
+class gym_electric_motor.physical_systems.physical_systems.SquirrelCageInductionMotorSystem(control_space='abc', ode_solver='scipy.ode', **kwargs)[source]
+

SCML-System for the Squirrel Cage Induction Motor

+
+
Parameters:
+
    +
  • control_space (str) – (‘abc’ or ‘dq’) Choose, if actions the actions space is in dq or abc space

  • +
  • kwargs – Further arguments to pass tp SCMLSystem

  • +
+
+
+
+
+reset(*_)[source]
+

Reset all the systems modules to an initial state.

+
+
Returns:
+

The new state of the system.

+
+
+
+ +
+
+simulate(action, *_, **__)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+

Doubly Fed Induction Motor System

+
+
+class gym_electric_motor.physical_systems.physical_systems.DoublyFedInductionMotorSystem(ode_solver='scipy.ode', **kwargs)[source]
+

SCML-System for the Doubly Fed Induction Motor

+
+
Parameters:
+

kwargs – Further arguments to pass tp SCMLSystem

+
+
+
+
+reset(*_)[source]
+

Reset all the systems modules to an initial state.

+
+
Returns:
+

The new state of the system.

+
+
+
+ +
+
+simulate(action, *_, **__)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
diff --git a/parts/physical_systems/voltage_supplies/ac_1_phase_supply.html b/parts/physical_systems/voltage_supplies/ac_1_phase_supply.html index e928a495..93095b75 100644 --- a/parts/physical_systems/voltage_supplies/ac_1_phase_supply.html +++ b/parts/physical_systems/voltage_supplies/ac_1_phase_supply.html @@ -106,6 +106,68 @@

AC 1 Phase Supply

+
+
+class gym_electric_motor.physical_systems.voltage_supplies.AC1PhaseSupply(u_nominal=230, supply_parameter=None)[source]
+

AC one phase voltage supply

+
+
Parameters:
+
    +
  • u_nominal (float) – Single phasic effective value of the voltage supply

  • +
  • supply_parameter (dict) – Consists of frequency f in Hz and phase phi in range of [0,2*pi) in case you wish for a fixed phase

  • +
+
+
+
+
+get_voltage(t, *_, **__)[source]
+

Get the supply voltage based on the floating supply current i_sup, the time t and optional further arguments.

+
+
Parameters:
+
    +
  • i_sup (float) – Supply current floating into the system.

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

  • +
+
+
Returns:
+

Supply Voltage(s) at time t.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+reset()[source]
+

Reset the voltage supply to an initial state. +This method is called at every reset of the physical system.

+
+
Returns:
+

The initial supply voltage.

+
+
Return type:
+

float

+
+
+
+ +
+
+supply_range = ()
+

Minimum and Maximum values of the Supply Voltage.

+
+ +
+
+property u_nominal
+

Returns: +float: Nominal Voltage of the Voltage Supply

+
+ +
+
diff --git a/parts/physical_systems/voltage_supplies/ac_3_phase_supply.html b/parts/physical_systems/voltage_supplies/ac_3_phase_supply.html index 4bb74eb7..7e4720e2 100644 --- a/parts/physical_systems/voltage_supplies/ac_3_phase_supply.html +++ b/parts/physical_systems/voltage_supplies/ac_3_phase_supply.html @@ -106,6 +106,68 @@

AC 3 Phase Supply

+
+
+class gym_electric_motor.physical_systems.voltage_supplies.AC3PhaseSupply(u_nominal=400, supply_parameter=None)[source]
+

AC three phase voltage supply

+
+
Parameters:
+
    +
  • u_nominal (float) – Three phasic effective value of the voltage supply

  • +
  • supply_parameter (dict) – Consists of frequency f in Hz and phase phi in range of [0,2*pi) in case you wish for a fixed phase

  • +
+
+
+
+
+get_voltage(t, *_, **__)[source]
+

Get the supply voltage based on the floating supply current i_sup, the time t and optional further arguments.

+
+
Parameters:
+
    +
  • i_sup (float) – Supply current floating into the system.

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

  • +
+
+
Returns:
+

Supply Voltage(s) at time t.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+reset()[source]
+

Reset the voltage supply to an initial state. +This method is called at every reset of the physical system.

+
+
Returns:
+

The initial supply voltage.

+
+
Return type:
+

float

+
+
+
+ +
+
+supply_range = ()
+

Minimum and Maximum values of the Supply Voltage.

+
+ +
+
+property u_nominal
+

Returns: +float: Nominal Voltage of the Voltage Supply

+
+ +
+
diff --git a/parts/physical_systems/voltage_supplies/ideal_voltage_supply.html b/parts/physical_systems/voltage_supplies/ideal_voltage_supply.html index 3fe80eb8..979b5bef 100644 --- a/parts/physical_systems/voltage_supplies/ideal_voltage_supply.html +++ b/parts/physical_systems/voltage_supplies/ideal_voltage_supply.html @@ -106,6 +106,65 @@

Ideal Voltage Supply

+
+
+class gym_electric_motor.physical_systems.voltage_supplies.IdealVoltageSupply(u_nominal=600.0)[source]
+

Ideal Voltage Supply that supplies with u_nominal independent of the time and the supply current.

+
+
Parameters:
+

u_nominal (float) – Nominal voltage of the Voltage Supply.

+
+
+
+
+get_voltage(*_, **__)[source]
+

Get the supply voltage based on the floating supply current i_sup, the time t and optional further arguments.

+
+
Parameters:
+
    +
  • i_sup (float) – Supply current floating into the system.

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

  • +
+
+
Returns:
+

Supply Voltage(s) at time t.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+reset()
+

Reset the voltage supply to an initial state. +This method is called at every reset of the physical system.

+
+
Returns:
+

The initial supply voltage.

+
+
Return type:
+

float

+
+
+
+ +
+
+supply_range = ()
+

Minimum and Maximum values of the Supply Voltage.

+
+ +
+
+property u_nominal
+

Returns: +float: Nominal Voltage of the Voltage Supply

+
+ +
+
diff --git a/parts/physical_systems/voltage_supplies/rc_voltage_supply.html b/parts/physical_systems/voltage_supplies/rc_voltage_supply.html index 13382982..ffea3209 100644 --- a/parts/physical_systems/voltage_supplies/rc_voltage_supply.html +++ b/parts/physical_systems/voltage_supplies/rc_voltage_supply.html @@ -106,6 +106,73 @@

RC Voltage Supply

+
+
+class gym_electric_motor.physical_systems.voltage_supplies.RCVoltageSupply(u_nominal=600.0, supply_parameter=None)[source]
+

DC voltage supply modeled as RC element

+

This Voltage Supply is a model of a non ideal voltage supply. +The ideal voltage source U_0 is part of an RC element.

+
+
Parameters:
+

supply_parameter (dict) – Consists or Resistance R in Ohm and Capacitance C in Farad

+
+
+
+
Additional notes:

If the product of R and C get too small the numerical stability of the ODE is not given anymore +typical time differences tau are only in the range of 10e-3. One might want to consider R*C as a +time constant. The resistance R can be considered as a simplified inner resistance model.

+
+
+
+
+get_voltage(t, i_sup)[source]
+

Get the supply voltage based on the floating supply current i_sup, the time t and optional further arguments.

+
+
Parameters:
+
    +
  • i_sup (float) – Supply current floating into the system.

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

  • +
+
+
Returns:
+

Supply Voltage(s) at time t.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+reset()[source]
+

Reset the voltage supply to an initial state. +This method is called at every reset of the physical system.

+
+
Returns:
+

The initial supply voltage.

+
+
Return type:
+

float

+
+
+
+ +
+
+supply_range = ()
+

Minimum and Maximum values of the Supply Voltage.

+
+ +
+
+property u_nominal
+

Returns: +float: Nominal Voltage of the Voltage Supply

+
+ +
+
diff --git a/parts/physical_systems/voltage_supplies/voltage_supply.html b/parts/physical_systems/voltage_supplies/voltage_supply.html index e76dc8ac..ae49a38a 100644 --- a/parts/physical_systems/voltage_supplies/voltage_supply.html +++ b/parts/physical_systems/voltage_supplies/voltage_supply.html @@ -116,6 +116,70 @@

Voltage Supplies

Voltage Supply Base Class

+
+
+class gym_electric_motor.physical_systems.voltage_supplies.VoltageSupply(u_nominal)[source]
+

Base class for all VoltageSupplies to be used in a SCMLSystem.

+
+
Parameter:

supply_range(Tuple(float,float)): Minimal and maximal possible value for the voltage supply. +u_nominal(float): Nominal supply voltage

+
+
+
+
Parameters:
+

u_nominal (float) – Nominal voltage of the Voltage Supply.

+
+
+
+
+get_voltage(t, i_sup)[source]
+

Get the supply voltage based on the floating supply current i_sup, the time t and optional further arguments.

+
+
Parameters:
+
    +
  • i_sup (float) – Supply current floating into the system.

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

  • +
+
+
Returns:
+

Supply Voltage(s) at time t.

+
+
Return type:
+

list(float)

+
+
+
+ +
+
+reset()[source]
+

Reset the voltage supply to an initial state. +This method is called at every reset of the physical system.

+
+
Returns:
+

The initial supply voltage.

+
+
Return type:
+

float

+
+
+
+ +
+
+supply_range = ()
+

Minimum and Maximum values of the Supply Voltage.

+
+ +
+
+property u_nominal
+

Returns: +float: Nominal Voltage of the Voltage Supply

+
+ +
+ diff --git a/parts/random_component.html b/parts/random_component.html index b32c4ee6..ca2bc378 100644 --- a/parts/random_component.html +++ b/parts/random_component.html @@ -85,6 +85,90 @@

Random Component

+
+
+class gym_electric_motor.RandomComponent[source]
+

Base class for all random components in the environment.

+

Every component (e.g. ReferenceGenerator or ElectricMotor) that has any kind of random behavior has to derive from +the RandomComponent class directly or indirectly via its own base class.

+

During the seeding of the environment, the random components ‘seed’ function is called and a sub-seed is passed +for every random component. From this sub-seed, further new seeds and reference generators +are generated at the beginning of each episode. This ensures a reproducible random behavior for each new episode +no matter how long the previous episodes have been. Therefore, each random environment component has to call the +‘next_generator()’ method during reset.

+

Everytime a random number is used, it has to be drawn from the random_generator.

+

Example

+
>>> import gym_electric_motor as gem
+>>> import numpy as np
+>>>
+>>>
+>>> class MyRandomReferenceGenerator(gem.ReferenceGenerator, gem.RandomComponent):
+>>>
+>>>     def __init__(self):
+>>>         gem.ReferenceGenerator.__init__(self)
+>>>         gem.RandomComponent.__init__(self)
+>>>         self.my_random_var = np.array([0.0]) # Only for exemplary purpose
+>>>         # Further custom initialization
+>>>         # ...
+>>>
+>>>     def reset(self, initial_state=None, initial_reference=None):
+>>>         self.next_generator()
+>>>         # Reset further components states
+>>>
+>>>     def get_reference(self, state, *_, **__):
+>>>         # Draw from the classes random_generator
+>>>         self.my_random_var = self.random_generator.normal(size=1)
+>>>         # Do something with the random variable e.g.:
+>>>         return np.ones_like(state) * self.my_random_var
+>>>
+>>>     def get_reference_observation(self, state, *_, **__):
+>>>         # Do sth.
+>>>         return self.my_random_var
+>>>
+
+
+
+
+next_generator()[source]
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+seed(seed=None)[source]
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
diff --git a/parts/reference_generators/const_reference_generator.html b/parts/reference_generators/const_reference_generator.html index 55b78cc9..0568616c 100644 --- a/parts/reference_generators/const_reference_generator.html +++ b/parts/reference_generators/const_reference_generator.html @@ -99,6 +99,114 @@

Constant Reference Generator

+
+
+class gym_electric_motor.reference_generators.ConstReferenceGenerator(reference_state='omega', reference_value=0.5, **kwargs)[source]
+

Reference Generator that generates a constant reference for a single state variable.

+
+
Parameters:
+
    +
  • reference_value (float) – Normalized Value for the const reference.

  • +
  • reference_state (string) – Name of the state to reference

  • +
  • kwargs (dict) – Arguments passed to the superclass ReferenceGenerator.

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)[source]
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)[source]
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

Reset of references for a new episode.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state array of the environment.

  • +
  • initial_reference (ndarray(float)) – If not None: A desired initial reference array.

  • +
+
+
Returns:
+

The reference array at time step 0.

+

reference_observation(value in reference_space): The reference observation for the next time step.

+

trajectories(dict(list(float)): If available, generated trajectories for the Visualization can be passed here. Otherwise return None.

+

+
+
Return type:
+

reference_array(ndarray(float))

+
+
+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/multiple_ref_generator.html b/parts/reference_generators/multiple_ref_generator.html index 2b8654f1..5ab94acb 100644 --- a/parts/reference_generators/multiple_ref_generator.html +++ b/parts/reference_generators/multiple_ref_generator.html @@ -99,6 +99,153 @@

Multiple Reference Generator

+
+
+class gym_electric_motor.reference_generators.MultipleReferenceGenerator(sub_generators, sub_args=None, **kwargs)[source]
+

Reference Generator that combines multiple sub reference generators that all have to reference +different state variables.

+
+
Parameters:
+
    +
  • sub_generators (list(str/class/object)) – List of keys, classes or objects to instantiate the sub_generators

  • +
  • sub_args (dict/list(dict)/None) – (Optional) Arguments to pass to the sub_converters. If not passed all kwargs +will be passed to each sub_generator.

  • +
  • kwargs – All kwargs of the environment. Passed to the sub_generators, if no sub_args are passed.

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(state, **kwargs)[source]
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(state, *_, **kwargs)[source]
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)[source]
+

Reset of references for a new episode.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state array of the environment.

  • +
  • initial_reference (ndarray(float)) – If not None: A desired initial reference array.

  • +
+
+
Returns:
+

The reference array at time step 0.

+

reference_observation(value in reference_space): The reference observation for the next time step.

+

trajectories(dict(list(float)): If available, generated trajectories for the Visualization can be passed here. Otherwise return None.

+

+
+
Return type:
+

reference_array(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)[source]
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/reference_generator.html b/parts/reference_generators/reference_generator.html index e514da48..24a3f8dd 100644 --- a/parts/reference_generators/reference_generator.html +++ b/parts/reference_generators/reference_generator.html @@ -115,6 +115,132 @@

Reference Generators

Reference Generator Base Class

+
+
+class gym_electric_motor.core.ReferenceGenerator[source]
+

The abstract base class for reference generators in gym electric motor environments.

+
+
reference_space:

Space of reference observations as defined in the Farama Gymnasium Toolbox.

+
+
+

The reference generator is called twice per step.

+
+
Call of get_reference():

Returns the reference array which has the same shape as the state array and contains +values for currently referenced state variables and a default value (e.g zero) for non-referenced variables. +This reference array is used to calculate rewards.

+
+
Example:

reference_array=np.array([0.8, 0.0, 0.0, 0.0])

+

state_variables=['omega', 'torque', 'i', 'u', 'u_sup']

+

Here, the state consists of five quantities but only 'omega' is referenced during control.

+
+
+
+
Call of get_reference_observation():

Returns the reference observation, which is shown to the agent. +Any shape and content is generally valid, however, values must be within the declared reference space. +For example, the reference observation may contain future reference values of the next n steps.

+
+
Example:

reference_observation = np.array([0.8, 0.6, 0.4])

+

This reference observation may be valid for an omega-controlled environment that shows the agent not +only the reference for the next time step omega_(t+1)=0.8 but also omega_(t+2)=0.6 and omega_(t+3)=0.4.

+
+
+
+
+
+
+close()[source]
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(state, *_, **__)[source]
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(state, *_, **__)[source]
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)[source]
+

Reset of references for a new episode.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state array of the environment.

  • +
  • initial_reference (ndarray(float)) – If not None: A desired initial reference array.

  • +
+
+
Returns:
+

The reference array at time step 0.

+

reference_observation(value in reference_space): The reference observation for the next time step.

+

trajectories(dict(list(float)): If available, generated trajectories for the Visualization can be passed here. Otherwise return None.

+

+
+
Return type:
+

reference_array(ndarray(float))

+
+
+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/sawtooth_reference_generator.html b/parts/reference_generators/sawtooth_reference_generator.html index 496370c4..b4b62b86 100644 --- a/parts/reference_generators/sawtooth_reference_generator.html +++ b/parts/reference_generators/sawtooth_reference_generator.html @@ -99,6 +99,158 @@

Sawtooth Reference Generator

+
+
+class gym_electric_motor.reference_generators.SawtoothReferenceGenerator(amplitude_range=None, frequency_range=(1, 10), offset_range=None, **kwargs)[source]
+
+

Reference Generator that generates a Sawtooth wave with a random amplitude, frequency, phase and offset.

+
+

The reference is generated for a certain length and then new parameters are drawn uniformly from a selectable range.

+
+
Parameters:
+
    +
  • amplitude_range (tuple(float,float)) – Lower and upper limit for the amplitude.

  • +
  • frequency_range (tuple(float,float)) – Lower and upper limit for the frequency.

  • +
  • offset_range (tuple(float,float)) – Lower and upper limit for the offset

  • +
  • kwargs (dict) – Arguments passed to the superclass SubepisodedReferenceGenerator .

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

The references are reset. If an initial reference is passed, this value will be the first reference value of +the next episode. Otherwise it will be 0.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state of the physical system.

  • +
  • initial_reference (ndarray(float)) – (Optional) The first reference value.

  • +
+
+
Returns:
+

initial reference array. +initial_reference_observation(element of reference_space): An initial observation of the next reference. +trajectory(None): No initial trajectory is passed.

+
+
Return type:
+

initial_reference(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/sinusoidal_reference_generator.html b/parts/reference_generators/sinusoidal_reference_generator.html index e397d41e..0ef9b17d 100644 --- a/parts/reference_generators/sinusoidal_reference_generator.html +++ b/parts/reference_generators/sinusoidal_reference_generator.html @@ -99,6 +99,156 @@

Sinusoidal Reference Generator

+
+
+class gym_electric_motor.reference_generators.SinusoidalReferenceGenerator(amplitude_range=None, frequency_range=(1, 10), offset_range=None, *_, **kwargs)[source]
+

Reference Generator that generates a sinusoidal wave with a random amplitude, frequency, phase and offset. +The reference is generated for a certain length and then new parameters are drawn uniformly from a selectable range.

+
+
Parameters:
+
    +
  • amplitude_range (tuple(float,float)) – Lower and upper limit for the amplitude.

  • +
  • frequency_range (tuple(float,float)) – Lower and upper limit for the frequency.

  • +
  • offset_range (tuple(float,float)) – Lower and upper limit for the offset

  • +
  • kwargs (any) – Arguments passed to the superclass SubepisodedReferenceGenerator .

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

The references are reset. If an initial reference is passed, this value will be the first reference value of +the next episode. Otherwise it will be 0.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state of the physical system.

  • +
  • initial_reference (ndarray(float)) – (Optional) The first reference value.

  • +
+
+
Returns:
+

initial reference array. +initial_reference_observation(element of reference_space): An initial observation of the next reference. +trajectory(None): No initial trajectory is passed.

+
+
Return type:
+

initial_reference(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/step_reference_generator.html b/parts/reference_generators/step_reference_generator.html index ef6f18e6..53ced85d 100644 --- a/parts/reference_generators/step_reference_generator.html +++ b/parts/reference_generators/step_reference_generator.html @@ -99,6 +99,156 @@

Step Reference Generator

+
+
+class gym_electric_motor.reference_generators.StepReferenceGenerator(amplitude_range=None, frequency_range=(1, 10), offset_range=None, **kwargs)[source]
+

Reference Generator that generates a step function with a random amplitude, frequency, phase and offset. +The reference is generated for a certain length and then new parameters are drawn uniformly from a selectable range.

+
+
Parameters:
+
    +
  • amplitude_range (tuple(float,float)) – Lower and upper limit for the amplitude.

  • +
  • frequency_range (tuple(float,float)) – Lower and upper limit for the frequency.

  • +
  • offset_range (tuple(float,float)) – Lower and upper limit for the offset

  • +
  • kwargs (any) – Arguments passed to the superclass SubepisodedReferenceGenerator .

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

The references are reset. If an initial reference is passed, this value will be the first reference value of +the next episode. Otherwise it will be 0.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state of the physical system.

  • +
  • initial_reference (ndarray(float)) – (Optional) The first reference value.

  • +
+
+
Returns:
+

initial reference array. +initial_reference_observation(element of reference_space): An initial observation of the next reference. +trajectory(None): No initial trajectory is passed.

+
+
Return type:
+

initial_reference(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/subepisoded_reference_generator.html b/parts/reference_generators/subepisoded_reference_generator.html index 3edd3b30..2b7bd2d8 100644 --- a/parts/reference_generators/subepisoded_reference_generator.html +++ b/parts/reference_generators/subepisoded_reference_generator.html @@ -99,6 +99,160 @@

Subepisoded Reference Generator

+
+
+class gym_electric_motor.reference_generators.subepisoded_reference_generator.SubepisodedReferenceGenerator(reference_state='omega', episode_lengths=(500, 2000), limit_margin=None, **kwargs)[source]
+

Base Class for Reference Generators, which change their parameters in certain ranges after a random number of +time steps and can pre-calculate their references in these “sub episodes”.

+
+
Parameters:
+
    +
  • reference_state (str) – Name of the state that this reference generator is referencing.

  • +
  • episode_lengths (Tuple(int,int)) – Minimum and maximum length of a sub episode.

  • +
  • limit_margin (Tuple(float,float)/float/None) – Factor, how close the references should get to the limits. +If a tuple is passed, then the lower[0] and upper[1] margin might differ. +If a float is passed, both margins are equal. +If None(default), the limit margin equals (nominal values/limits). +In general, the limit margin should not exceed (-1, 1)

  • +
  • kwargs (dict) – Keyword arguments to be passed to the base class ReferenceGenerator

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)[source]
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)[source]
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)[source]
+

The references are reset. If an initial reference is passed, this value will be the first reference value of +the next episode. Otherwise it will be 0.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state of the physical system.

  • +
  • initial_reference (ndarray(float)) – (Optional) The first reference value.

  • +
+
+
Returns:
+

initial reference array. +initial_reference_observation(element of reference_space): An initial observation of the next reference. +trajectory(None): No initial trajectory is passed.

+
+
Return type:
+

initial_reference(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/switched_reference_generator.html b/parts/reference_generators/switched_reference_generator.html index a01d3718..d7ecce62 100644 --- a/parts/reference_generators/switched_reference_generator.html +++ b/parts/reference_generators/switched_reference_generator.html @@ -99,6 +99,152 @@

Switched Reference Generator

+
+
+class gym_electric_motor.reference_generators.SwitchedReferenceGenerator(sub_generators, p=None, super_episode_length=(100, 10000))[source]
+

Reference Generator that switches randomly between multiple sub generators with a certain probability p for each.

+
+
Parameters:
+
    +
  • sub_generators (list(ReferenceGenerator)) – ReferenceGenerator instances to be used as the sub_generators.

  • +
  • p (list(float)/None) – (Optional) Probabilities for each sub_generator. If None a uniform +probability for each sub_generator is used.

  • +
  • super_episode_length (Tuple(int, int)) – Minimum and maximum number of time steps a sub_generator is used.

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(state, **kwargs)[source]
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(state, *_, **kwargs)[source]
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)[source]
+

Reset of references for a new episode.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state array of the environment.

  • +
  • initial_reference (ndarray(float)) – If not None: A desired initial reference array.

  • +
+
+
Returns:
+

The reference array at time step 0.

+

reference_observation(value in reference_space): The reference observation for the next time step.

+

trajectories(dict(list(float)): If available, generated trajectories for the Visualization can be passed here. Otherwise return None.

+

+
+
Return type:
+

reference_array(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)[source]
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/triangular_reference_generator.html b/parts/reference_generators/triangular_reference_generator.html index f18c586e..e21bf954 100644 --- a/parts/reference_generators/triangular_reference_generator.html +++ b/parts/reference_generators/triangular_reference_generator.html @@ -99,6 +99,157 @@

Triangular Reference Generator

+
+
+class gym_electric_motor.reference_generators.TriangularReferenceGenerator(amplitude_range=None, frequency_range=(1, 10), offset_range=None, *_, **kwargs)[source]
+

Reference Generator that generates a triangular waveform with random asymmetry. The Amplitude, frequency and offset +are also randomized within a specified range. +The reference is generated for a certain length and then new parameters are drawn uniformly from a selectable range.

+
+
Parameters:
+
    +
  • amplitude_range (tuple(float,float)) – Lower and upper limit for the amplitude.

  • +
  • frequency_range (tuple(float,float)) – Lower and upper limit for the frequency.

  • +
  • offset_range (tuple(float,float)) – Lower and upper limit for the offset

  • +
  • kwargs (dict) – Arguments passed to the superclass SubepisodedReferenceGenerator .

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

The references are reset. If an initial reference is passed, this value will be the first reference value of +the next episode. Otherwise it will be 0.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state of the physical system.

  • +
  • initial_reference (ndarray(float)) – (Optional) The first reference value.

  • +
+
+
Returns:
+

initial reference array. +initial_reference_observation(element of reference_space): An initial observation of the next reference. +trajectory(None): No initial trajectory is passed.

+
+
Return type:
+

initial_reference(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/wiener_process_reference_generator.html b/parts/reference_generators/wiener_process_reference_generator.html index e0af2eeb..ceb48c93 100644 --- a/parts/reference_generators/wiener_process_reference_generator.html +++ b/parts/reference_generators/wiener_process_reference_generator.html @@ -99,6 +99,157 @@

Wiener Process Reference Generator

+
+
+class gym_electric_motor.reference_generators.WienerProcessReferenceGenerator(sigma_range=(0.001, 0.1), initial_range=None, **kwargs)[source]
+

Reference Generator that generates a reference for one state by a Wiener Process with the changing parameter +sigma and mean = 0.

+
+
Parameters:
+
    +
  • sigma_range (Tuple(float,float)) – Lower and Upper limit for the sigma-parameter of the WienerProcess.

  • +
  • initial_range (Tuple(float,float)) – Minimal and maximal normalized value of the initial reference point +of a new episode. Default: Equal to the limit margin inherited from the +SubepisodedReferenceGenerator

  • +
  • kwargs – Further arguments to pass to SubepisodedReferenceGenerator

  • +
+
+
+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(*_, **__)
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(*_, **__)
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)[source]
+

The references are reset. If an initial reference is passed, this value will be the first reference value of +the next episode. Otherwise it will be 0.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state of the physical system.

  • +
  • initial_reference (ndarray(float)) – (Optional) The first reference value.

  • +
+
+
Returns:
+

initial reference array. +initial_reference_observation(element of reference_space): An initial observation of the next reference. +trajectory(None): No initial trajectory is passed.

+
+
Return type:
+

initial_reference(ndarray(float))

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reference_generators/zero_reference_generator.html b/parts/reference_generators/zero_reference_generator.html index f49feee0..9a05466a 100644 --- a/parts/reference_generators/zero_reference_generator.html +++ b/parts/reference_generators/zero_reference_generator.html @@ -99,6 +99,105 @@

Zero Reference Generator

+
+
+class gym_electric_motor.reference_generators.ZeroReferenceGenerator[source]
+

Dummy Reference Generator that does not generate any reference but zeros for all states.

+
+
+close()
+

Called by the environment, when the environment is deleted to close files, store logs, etc.

+
+ +
+
+get_reference(state=None, *_, **__)[source]
+

Returns the reference array of the current time step.

+

The reference array needs to be in the same shape as the state variables. For referenced states the reference +value is passed. For unreferenced states a default value (e.g. Zero) can be set in the reference array.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Current reference array.

+
+
Return type:
+

ndarray(float))

+
+
+
+ +
+
+get_reference_observation(state=None, *_, **__)[source]
+

Returns the reference observation for the next time step. This observation needs to fit in the reference space.

+
+
Parameters:
+

state (ndarray(float)) – Current state array of the environment.

+
+
Returns:
+

Observation for the next reference time step.

+
+
Return type:
+

value in reference_space

+
+
+
+ +
+
+property reference_names
+

Returns: +reference_names(list(str)): A list containing all names of the referenced states in the reference +observation.

+
+ +
+
+property referenced_states
+

Returns: +ndarray(bool): Boolean-Array with the length of the state_variables indicating which states are referenced.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

Reset of references for a new episode.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – The initial state array of the environment.

  • +
  • initial_reference (ndarray(float)) – If not None: A desired initial reference array.

  • +
+
+
Returns:
+

The reference array at time step 0.

+

reference_observation(value in reference_space): The reference observation for the next time step.

+

trajectories(dict(list(float)): If available, generated trajectories for the Visualization can be passed here. Otherwise return None.

+

+
+
Return type:
+

reference_array(ndarray(float))

+
+
+
+ +
+
+set_modules(physical_system)[source]
+

Announcement of the PhysicalSystem to the ReferenceGenerator.

+

In subclasses, store all important information from the physical system to the ReferenceGenerator here. +The environment announces the physical system to the ReferenceGenerator during its initialization.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system of the environment.

+
+
+
+ +
+
diff --git a/parts/reward_functions/reward_function.html b/parts/reward_functions/reward_function.html index 041a8def..66d626c6 100644 --- a/parts/reward_functions/reward_function.html +++ b/parts/reward_functions/reward_function.html @@ -97,6 +97,96 @@

Reward Functions

Reward Function Base Class

+
+
+class gym_electric_motor.core.RewardFunction[source]
+

The abstract base class for reward functions in gym electric motor environments.

+

The reward function is called once per step and returns reward for the current time step.

+
+
+reward_range
+

Defining lowest and highest possible rewards.

+
+
Type:
+

Tuple(float, float)

+
+
+
+ +
+
+close()[source]
+

Called, when the environment is closed to store logs, close files etc.

+
+ +
+
+reset(initial_state=None, initial_reference=None)[source]
+

This function is called by the environment when reset.

+

Inner states of the reward function can be reset here, if necessary.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – Initial state array of the Environment

  • +
  • initial_reference (ndarray(float)) – Initial reference array of the environment.

  • +
+
+
+
+ +
+
+reward(state, reference, k=None, action=None, violation_degree=0.0)[source]
+

Reward calculation. If limits have been violated the reward is calculated with a separate function.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – Environments state array.

  • +
  • reference (ndarray(float)) – Environments reference array.

  • +
  • k (int) – Systems momentary time-step

  • +
  • action (element of action space) – The previously taken action.

  • +
  • violation_degree (float in [0.0, 1.0]) – Degree of violation of the constraints. 0.0 indicates that all +constraints are complied. 1.0 indicates that the constraints have been so much violated, that a reset is +necessary.

  • +
+
+
Returns:
+

Reward for this state, reference, action tuple.

+
+
Return type:
+

float

+
+
+
+ +
+
+reward_range = (-inf, inf)
+

Lower and upper possible reward

+
+
Type:
+

Tuple(int,int)

+
+
+
+ +
+
+set_modules(physical_system, reference_generator, constraint_monitor)[source]
+

Setting of the physical system, to set state arrays fitting to the environments states

+
+
Parameters:
+
    +
  • physical_system (PhysicalSystem) – The physical system of the environment

  • +
  • reference_generator (ReferenceGenerator) – The reference generator of the environment.

  • +
  • constraint_monitor (ConstraintMonitor) – The constraint monitor of the environment.

  • +
+
+
+
+ +
+ diff --git a/parts/reward_functions/weighted_sum_of_errors.html b/parts/reward_functions/weighted_sum_of_errors.html index 6d7e9e72..d08202f9 100644 --- a/parts/reward_functions/weighted_sum_of_errors.html +++ b/parts/reward_functions/weighted_sum_of_errors.html @@ -16,6 +16,7 @@ + @@ -116,6 +117,143 @@

Usage Guide

API Documentation

+
+
+class gym_electric_motor.reward_functions.weighted_sum_of_errors.WeightedSumOfErrors(reward_weights=None, normed_reward_weights=False, violation_reward=None, gamma=0.9, reward_power=1, bias=0.0)[source]
+

A reward function that calculates the reward as the weighted sum of errors with a certain power.

+
+\[r_{wse} = - \sum_i w_i ((|s_i-s^*_i|) / l_i) ^{n_i} + b\]
+
+
Notation:
    +
  • \(r_\mathrm{wse}\): Weighted sum of error reward

  • +
  • \(w_{i}\): Reward weight of state \(i\)

  • +
  • \(s_{i}\): State value of state \(i\)

  • +
  • \(s^*_{i}\): Reference value of state \(i\)

  • +
  • \(l_{i}\): State length of state \(i\)

  • +
  • \(n_{i}\): Reward power of state \(i\)

  • +
  • \(b\): Bias

  • +
+
+
+
+
\(l_i = 1\) for states with positive values only.
+
\(l_i = 2\) for states with positive and negative values.
+
+

If environments constraints are violated to a certain degree, a special violation reward is returned as follows:

+
+\[r_{total} = (1.0 - d_{violation}) r_{wse} + d_{violation} r_{violation}\]
+
+
Notation:
    +
  • \(r_{total}\): Total reward

  • +
  • \(r_{wse}\): Weighted sum of error reward

  • +
  • \(r_{violation}\): Constraint violation reward

  • +
  • \(d_{violation}\): Limit violation degree \(d_{violation} \in [0,1]\)

  • +
+
+
+

The violation reward can be chosen freely by the user and shall punish the agents to comply with the constraints. +Per default, the violation reward is selected so that it is always the worst expected reward the agent could get.

+
+\[r_{violation} = r_{wse,min} / (1 - \gamma)\]
+

\(r_{wse,min}\) is the minimal \(r_{wse}\) (=reward_range[0]) and \(\gamma\) the agents discount factor.

+
+
Parameters:
+
    +
  • reward_weights (dict/list/ndarray(float)) – Dict mapping state names to reward_weights, 0 otherwise. +Or an array with the reward_weights on the position of the state_names.

  • +
  • normed_reward_weights (bool) – If True, the reward weights will be normalized to sum up to 1.

  • +
  • violation_reward (None/float) –

    The punishment reward if constraints have been violated.

    +
      +
    • None(default): Per default, the violation reward is calculated as described above.

    • +
    • float: This value is taken as limit violation reward.

    • +
    +

  • +
  • gamma (float in [0.0, 1.0]) – Discount factor for the reward punishment. +Should equal agents’ discount factor gamma. Used only, if violation_reward=None.

  • +
  • reward_power (dict/list(float)/float) – Reward power for each of the systems states.

  • +
  • bias (float/'positive') –

    Additional bias that is added to the reward.

    +
      +
    • float: The value that is added

    • +
    • ’positive’: The bias is selected so that the minimal reward is zero and all further are positive.

    • +
    +

  • +
+
+
+
+
+close()
+

Called, when the environment is closed to store logs, close files etc.

+
+ +
+
+reset(initial_state=None, initial_reference=None)
+

This function is called by the environment when reset.

+

Inner states of the reward function can be reset here, if necessary.

+
+
Parameters:
+
    +
  • initial_state (ndarray(float)) – Initial state array of the Environment

  • +
  • initial_reference (ndarray(float)) – Initial reference array of the environment.

  • +
+
+
+
+ +
+
+reward(state, reference, k=None, action=None, violation_degree=0.0)[source]
+

Reward calculation. If limits have been violated the reward is calculated with a separate function.

+
+
Parameters:
+
    +
  • state (ndarray(float)) – Environments state array.

  • +
  • reference (ndarray(float)) – Environments reference array.

  • +
  • k (int) – Systems momentary time-step

  • +
  • action (element of action space) – The previously taken action.

  • +
  • violation_degree (float in [0.0, 1.0]) – Degree of violation of the constraints. 0.0 indicates that all +constraints are complied. 1.0 indicates that the constraints have been so much violated, that a reset is +necessary.

  • +
+
+
Returns:
+

Reward for this state, reference, action tuple.

+
+
Return type:
+

float

+
+
+
+ +
+
+reward_range = (-inf, inf)
+

Lower and upper possible reward

+
+
Type:
+

Tuple(int,int)

+
+
+
+ +
+
+set_modules(physical_system, reference_generator, constraint_monitor)[source]
+

Setting of the physical system, to set state arrays fitting to the environments states

+
+
Parameters:
+
    +
  • physical_system (PhysicalSystem) – The physical system of the environment

  • +
  • reference_generator (ReferenceGenerator) – The reference generator of the environment.

  • +
  • constraint_monitor (ConstraintMonitor) – The constraint monitor of the environment.

  • +
+
+
+
+ +
+ diff --git a/parts/state_action_processors/cos_sin_processor.html b/parts/state_action_processors/cos_sin_processor.html index 63bece7d..5f6b7e6c 100644 --- a/parts/state_action_processors/cos_sin_processor.html +++ b/parts/state_action_processors/cos_sin_processor.html @@ -84,6 +84,181 @@

Cos Sin Processor

+
+
+class gym_electric_motor.physical_system_wrappers.CosSinProcessor(angle='epsilon', physical_system=None, remove_angle=False)[source]
+

Adds cos(angle) and sin(angle) states to the systems state vector that are the cosine and sine of a +certain systems state.

+

Optionally, the CosSinProcessor can also remove the angle from the state vector.

+
+
Parameters:
+
    +
  • angle (string) – Name of the state whose cosine and sine will be added to the systems state vector. +Default: 'epsilon'

  • +
  • physical_system (PhysicalSystem(optional)) – Inner system of this processor.

  • +
  • remove_angle (bool) – Remove the angle from the state vector

  • +
+
+
+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+property angle
+

Returns the name of the state whose cosine and sine are appended to the state vector.

+
+ +
+
+close()
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset()[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner physical system of this PhysicalSystemWrapper.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/state_action_processors/current_sum_processor.html b/parts/state_action_processors/current_sum_processor.html index fce3ffae..1bc09c5d 100644 --- a/parts/state_action_processors/current_sum_processor.html +++ b/parts/state_action_processors/current_sum_processor.html @@ -84,6 +84,173 @@

Current Sum Processor

+
+
+class gym_electric_motor.physical_system_wrappers.current_sum_processor.CurrentSumProcessor(currents, limit='max', physical_system=None)[source]
+

Adds an i_sum state to the systems state vector that adds up currents.

+
+
Parameters:
+
    +
  • currents (Iterable[string]) – Iterable of the names of the currents to be summed up.

  • +
  • limit ('max'/'sum') – Selection if the limit and nominal values of i_sum are calculated by the maximum of +the limits / nominal values of the source currents or their summation.

  • +
  • physical_system (PhysicalSystem(optional)) – The inner PhysicalSystem of this processor.

  • +
+
+
+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+close()
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset()[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner physical system of this PhysicalSystemWrapper.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/state_action_processors/dead_time_processor.html b/parts/state_action_processors/dead_time_processor.html index 43396d1d..d2b9d28d 100644 --- a/parts/state_action_processors/dead_time_processor.html +++ b/parts/state_action_processors/dead_time_processor.html @@ -84,6 +84,192 @@

Dead Time Processor

+
+
+class gym_electric_motor.physical_system_wrappers.DeadTimeProcessor(steps=1, reset_action=None, physical_system=None)[source]
+

The DeadTimeProcessor delays the actions to the physical system for a parameterizable amount of steps.

+
+
Reset Actions:

When the environment is reset, no valid previous actions are available. Per default, constant reset actions are +used. Also, custom reset actions parameterized. Therefore, a method can be passed during initialization of a +DeadTimeProcessor. This method needs to return a list of valid actions of the action space whose length equals +the number of dead time steps.

+

The default reset actions are zeros. The concrete shape is derived by the concrete action spaces: +Discrete, MultiDiscrete, Box.

+
+
+

Args: +steps(int): Number of steps to delay the actions. +reset_action(callable): A callable that returns a list of length steps to initialize the dead-actions

+
+

after a reset. Default: See above in the class description

+
+

physical_system(PhysicalSystem (optional)): The inner physical system of this PhysicalSystemWrapper.

+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+close()
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property dead_time
+

The number of delayed steps.

+
+
Type:
+

int

+
+
+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset()[source]
+

Resets the processor and the inner physical system for a new episode.

+
+
Returns:
+

The initial state of the system.

+
+
Return type:
+

numpy.ndarray[float]

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner PhysicalSystem of the DeadTimeProcessor.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The physical system to be set.

+
+
+
+ +
+
+simulate(action)[source]
+

Saves the action, applies the dead-time action and simulates the system for one time step.

+
+
+
Args:

action(element of the action_space): The next action for the system.

+
+
+
+
+
Returns:
+

The next state of the system.

+
+
Return type:
+

numpy.ndarray[float]

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/state_action_processors/dq_to_abc_action_processor.html b/parts/state_action_processors/dq_to_abc_action_processor.html index e06f79a4..c7820879 100644 --- a/parts/state_action_processors/dq_to_abc_action_processor.html +++ b/parts/state_action_processors/dq_to_abc_action_processor.html @@ -84,6 +84,172 @@

Dq To Abc Action Processor

+
+
+class gym_electric_motor.physical_system_wrappers.DqToAbcActionProcessor(angle_name, physical_system=None)[source]
+

The DqToAbcActionProcessor converts an inner system with an AC motor and actions in abc coordinates to a +system to which actions in the dq-coordinate system can be applied.

+
+
Parameters:
+
    +
  • angle_name (string) – Name of the state that defines the current angle of the AC-motor

  • +
  • physical_system (PhysicalSystem(optional)) – The inner physical system.

  • +
+
+
+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+close()
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset(**kwargs)[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner physical system of this PhysicalSystemWrapper.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/state_action_processors/flux_observer.html b/parts/state_action_processors/flux_observer.html index 03841dc4..30902a63 100644 --- a/parts/state_action_processors/flux_observer.html +++ b/parts/state_action_processors/flux_observer.html @@ -16,6 +16,7 @@ + @@ -84,6 +85,189 @@

Flux Observer

+
+
+class gym_electric_motor.physical_system_wrappers.FluxObserver(current_names=('i_sa', 'i_sb', 'i_sc'), physical_system=None)[source]
+

The FluxObserver extends the systems state vector of induction machine environments by estimated flux states +psi_abs, and psi_angle. The flux is estimated as follows:

+
+
+\[psi_{abs} = |\Psi|\]
+
+\[psi_{angle} = \angle{\Psi}\]
+
+\[\Psi \in \mathbb{C}\]
+
+\[I_{s, \alpha \beta} = \left( I_{s,\alpha}, I_{s, \beta} \right) ^T\]
+
+\[\Delta \Psi_k = \frac {(I_{s, \alpha}+jI_{s, \beta}) R_r L_m}{L_r} +- \Psi_{k-1}(\frac{R_r}{L_r}+ j\omega)\]
+
+\[\Psi_k = \sum_{i=0}^k (\Psi_{k-1} + \Delta\Psi_k) \tau\]
+
+
+
Parameters:
+
    +
  • current_names (Iterable[string]) – Names of the currents to be observed to estimate the flux. +(Default: ('i_sa', 'i_sb', 'i_sc'))

  • +
  • physical_system (PhysicalSystem) – (Optional) Physical System to initialize this observer. If not passed, +the observer will be initialized during environment creation.

  • +
+
+
+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+close()
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+reset()[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner physical system of this PhysicalSystemWrapper.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/state_action_processors/state_action_processor.html b/parts/state_action_processors/state_action_processor.html index 2729951a..b2644ccd 100644 --- a/parts/state_action_processors/state_action_processor.html +++ b/parts/state_action_processors/state_action_processor.html @@ -97,6 +97,140 @@

Physical System Wrapper

Physical System Wrapper Base Class

+
+
+class gym_electric_motor.physical_system_wrappers.PhysicalSystemWrapper(physical_system=None)[source]
+

A PhysicalSystemWrapper is a wrapper around the PhysicalSystem of a gem-environment.

+

It may be used to modify its states and actions. In contrast to gym-wrappers which are put around the whole +environment, modified states by the PhysicalSystemWrappers can be referenced, rewarded and visualized by the +other components of the environment.

+
+
Parameters:
+

physical_system (PhysicalSystem) – (Optional) The inner physical system can be passed to directly call the +set_physical_system-method after the initialization.

+
+
+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+reset(**kwargs)[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+seed(seed=None)[source]
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner physical system of this PhysicalSystemWrapper.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/state_action_processors/state_noise_processor.html b/parts/state_action_processors/state_noise_processor.html index d5dce9c8..7739b31c 100644 --- a/parts/state_action_processors/state_noise_processor.html +++ b/parts/state_action_processors/state_noise_processor.html @@ -84,6 +84,180 @@

State Noise Processor

+
+
+class gym_electric_motor.physical_system_wrappers.StateNoiseProcessor(states, random_dist='normal', random_kwargs=(), random_length=1000, physical_system=None)[source]
+

The StateNoiseProcessor puts additional noise onto the systems state.

+
+
The random distribution of the noise can be selected by those available in the numpy random generator:

https://numpy.org/doc/stable/reference/random/generator.html#distributions

+
+
+

Example

+
+
Parameters:
+

states – Names of the states onto which the noise shall be added. +Shortcut ‘all’: Add it to all available states.

+
+
+
+
+property action_space
+

The processed action space.

+

If it is unset, the action space of the inner physical system is returned.

+
+ +
+
+close()
+

Called, when the environment is closed. +Close the System and all of its submodules by closing files, saving logs etc.

+
+ +
+
+property k
+

Returns: +int: The current systems time step k.

+
+ +
+
+property limits
+

The processed physical system limits.

+

If it is unset, the inner limits are returned.

+
+ +
+
+next_generator()
+

Sets a new reference generator for a new episode.

+
+ +
+
+property nominal_state
+

The processed physical system nominal state.

+

If it is unset, the inner nominal state is returned.

+
+ +
+
+property physical_system
+

The next inner physical_system or the next inner physical_system_wrapper.

+
+ +
+
+property random_generator
+

The random generator that has to be used to draw the random numbers.

+
+ +
+
+property random_kwargs
+

Returns the random keyword arguments that are passed through to the random generator function.

+
+ +
+
+reset()[source]
+

Reset the physical system to an initial state before a new episode starts.

+
+
Returns:
+

The initial systems state

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+seed(seed=None)
+

The function to set the seed.

+

This function is called by within the global seed call of the environment. The environment passes the sub-seed +to this component that is generated based on the source-seed of the env.

+
+
Parameters:
+

seed ((np.random.SeedSequence, None)) – Seed sequence to derive new seeds and reference generators at every +episode start. Default: None (a new SeedSequence is generated).

+
+
Returns:
+

A list containing all seeds within this RandomComponent. In general, this list has length 1. +If the RandomComponent holds further RandomComponent instances, the list has to contain also these +entropies. The entropy of this instance has to be placed always at first place.

+
+
Return type:
+

List(int)

+
+
+
+ +
+
+property seed_sequence
+

The base seed sequence that generates the sub generators and sub seeds at every environment reset.

+
+ +
+
+set_physical_system(physical_system)[source]
+

Sets the inner physical system of this PhysicalSystemWrapper.

+
+
Parameters:
+

physical_system (PhysicalSystem) – The inner physical system or Physical System Wrapper.

+
+
+
+ +
+
+simulate(action)[source]
+

Simulation of the Physical System for one time step with the input action. +This method is called in the environment in every step to update the systems state.

+
+
Parameters:
+

action (element of action_space) – The action to play on the system for the next time step.

+
+
Returns:
+

The systems state after the action was applied.

+
+
Return type:
+

element of state_space

+
+
+
+ +
+
+property state_names
+

The processed physical system state names.

+

If it is unset, the state names of the inner physical system are returned.

+
+ +
+
+property state_positions
+

Returns: +dict(int): Dictionary mapping the state names to its positions in the state arrays

+
+ +
+
+property state_space
+

The processed state space.

+

If it is unset, the state space of the inner physical system is returned.

+
+ +
+
+property unwrapped
+

The innermost physical system within all Physical System Wrappers.

+
+ +
+
diff --git a/parts/utils.html b/parts/utils.html index 65dfeafb..2fadeb5d 100644 --- a/parts/utils.html +++ b/parts/utils.html @@ -84,8 +84,73 @@
-
-

Utils

+
+

Utils

+
+
+gym_electric_motor.utils.set_state_array(input_values, state_names)[source]
+

Setting of the input values to a valid state array with the shape of the physical systems state.

+

The input values can be passed as dict with state_name: value pairs or as list / ndarray. In the latter case the +shape of the list has to fit the state_names shape and the list will just be returned as array. If a float is +passed as input value, then this value will be set onto all positions of the state array equally.

+
+
Parameters:
+
    +
  • input_values (dict(float) / list(float) / ndarray(float) / float) – Values to be set onto the state array.

  • +
  • state_names (list(str)) – List containing the state names of the physical system.

  • +
+
+
Returns:
+

An initialized state array with all values passed in input values set onto the corresponding position in +the state_names and zero otherwise.

+
+
+
+ +
+
+gym_electric_motor.utils.state_dict_to_state_array(state_dict, state_array, state_names)[source]
+

Mapping of a passed state dictionary to a fitting state array.

+

This function is mainly used in the initialization phase to map a dictionary of passed state_name, state_value pairs +to a numpy state array with the entries of the state_dict at the corresponding places of the state_names.

+
+
Parameters:
+
    +
  • state_dict (dict) – Dictionary containing pairs of state_name, state_values for the state_array

  • +
  • state_array (iterable) – Array into which the state_dict entries shall be passed

  • +
  • state_names (list/ndarray(str)) – List of the state names.

  • +
+
+
+
+ +
+
+gym_electric_motor.utils.update_parameter_dict(source_dict, update_dict, copy=True)[source]
+

Merges two dictionaries (source and update) together.

+

It is similar to pythons dict.update() method. Furthermore, it assures that all keys in the update dictionary are +already present in the source dictionary. Otherwise a KeyError is thrown.

+
+
Parameters:
+
    +
  • source_dict (dict) – Source dictionary to be updated.

  • +
  • update_dict (dict) – The new dictionary with the entries to update the source dict.

  • +
  • copy (bool) – Flag, if the source dictionary shall be copied before updating. (Default True)

  • +
+
+
Returns:
+

The updated source dictionary.

+
+
Return type:
+

dict

+
+
+
+
Exceptions:

KeyError: Thrown, if a key in the update dict is not available in the source dict.

+
+
+
+
diff --git a/parts/visualizations/console_printer.html b/parts/visualizations/console_printer.html index 04511d24..866ee2a7 100644 --- a/parts/visualizations/console_printer.html +++ b/parts/visualizations/console_printer.html @@ -91,6 +91,73 @@

Console Printer

+
+
+class gym_electric_motor.visualization.console_printer.ConsolePrinter(verbose=0, update_freq=1)[source]
+

Prints current training values of the environment on the console.

+

These include environment state and reference values as well as the number of training steps, the rewards +and the cumulative reward. It also shows why an episode has terminated (external, constraint violation)

+
+
Parameters:
+
    +
  • verbose (Int) –

    Integer indicating whether and at which frequency the console will be printed. +Options:

    +
    +

    0: No Printing +1: Printing after an episode has terminated +2: Printing at each step of an episode

    +
    +

  • +
  • update_freq (Int) – Unsigned Integer setting the update frequency if verbose is 2. +It’s value n means that each nth step the corresponding output will be printed

  • +
+
+
+
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()[source]
+

Gets called on environment reset. Handles internal value reset and External reset printing

+
+ +
+
+on_reset_end(state, reference)[source]
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)[source]
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at each step of the environment. +Handles per step printing as well es constraint violation printing

+
+ +
+
+render()[source]
+

Function to update the user interface.

+
+ +
+
+set_env(env)[source]
+

Gets the limits of the current physical system for accurate printing

+
+ +
+
diff --git a/parts/visualizations/motor_dashboard.html b/parts/visualizations/motor_dashboard.html index 36c01e85..5768fdec 100644 --- a/parts/visualizations/motor_dashboard.html +++ b/parts/visualizations/motor_dashboard.html @@ -16,6 +16,7 @@ + @@ -152,6 +153,134 @@

Usage Guide

Motor Dashboard API

+
+
+class gym_electric_motor.visualization.motor_dashboard.MotorDashboard(render_mode=None, *args, **kwargs)[source]
+
+
Parameters:
+
    +
  • state_plots ('all'/iterable(str)) – An iterable of state names to be shown. If ‘all’ all states will be shown. +Default: () (no plotted states)

  • +
  • action_plots ('all'/iterable(int)) – If action_plots=’all’, all actions will be plotted. If more than one +action can be applied on the environment it can be selected by its index. +Default: () (no plotted actions).

  • +
  • reward_plot (boolean) – Select if the current reward is to be plotted. Default: False

  • +
  • additional_plots (iterable((TimePlot/EpisodePlot/StepPlot))) – Additional already instantiated plots +to be shown on the dashboard

  • +
  • update_interval (int > 0) – Amount of steps after which the plots are updated. Updating each step reduces the +performance drastically. Default: 1000

  • +
  • time_plot_width (int > 0) – Width of the step plots in steps. Default: 10000 steps +(1 second for continuously controlled environments / 0.1 second for discretely controlled environments)

  • +
  • style (string) – Select one of the matplotlib-styles. e.g. “dark-background”. +Default: None (the already selected style)

  • +
+
+
+
+
+figure()[source]
+

Get main figure (MotorDashboard)

+
+ +
+
+initialize()
+

Called with first render() call to setup the figures and plots.

+
+ +
+
+on_close()[source]
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Called before the environment is reset. All subplots are reset.

+
+ +
+
+on_reset_end(state, reference)
+

Called after the environment is reset. The initial data is passed.

+
+
Parameters:
+
    +
  • state (array(float)) – The initial state \(s_0\).

  • +
  • reference (array(float)) – The initial reference for the first time step \(s^*_0\).

  • +
+
+
+
+ +
+
+on_step_begin(k, action)
+

The information about the last environmental step is passed.

+
+
Parameters:
+
    +
  • k (int) – The current episode step.

  • +
  • action (ndarray(float) / int) – The taken action \(a_k\).

  • +
+
+
+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

The information after the step is passed

+
+
Parameters:
+
    +
  • k (int) – The current episode step

  • +
  • state (array(float)) – The state of the env after the step \(s_k\).

  • +
  • reference (array(float)) – The reference corresponding to the state \(s^*_k\).

  • +
  • reward (float) – The reward that has been received for the last action that lead to the current state +\(r_{k}\).

  • +
  • terminated (bool) – Flag, that indicates, if the last action lead to a terminal state \(t_{k}\).

  • +
+
+
+
+ +
+
+render()
+

Updates the plots every update cycle calls of this method.

+
+ +
+
+reset_figures()
+

Method to reset the figures to the initial state.

+

This method can be called, when the plots shall be reset after the training and before the test, for example. +Another use case, that requires the call of this method by the user, is when the dashboard is executed within +a jupyter notebook and the figures shall be plotted below a new cell.

+
+ +
+
+set_env(env)[source]
+

Called during initialization of the environment to interconnect all modules. State names, references,… +might be saved here for later processing

+
+
Parameters:
+

env (ElectricMotorEnvironment) – The environment.

+
+
+
+ +
+
+property update_interval
+

Number of steps until the visualization is updated

+
+ +
+

diff --git a/parts/visualizations/motor_dashboard_plots/action_plot.html b/parts/visualizations/motor_dashboard_plots/action_plot.html index 8e5ce050..09aee67d 100644 --- a/parts/visualizations/motor_dashboard_plots/action_plot.html +++ b/parts/visualizations/motor_dashboard_plots/action_plot.html @@ -103,6 +103,97 @@

Action Plot

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.ActionPlot(action=0)[source]
+

Class to plot the instantaneous actions applied on the environment

+
+
Parameters:
+

action (int) – Index of the action to be plotted, if there are multiple continuous actions. +Select 0, if the environment has a Discrete action space. Default: 0

+
+
+
+
+property data_idx
+

Returns the current index to access the time and data arrays.

+
+ +
+
+initialize(axis)[source]
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)[source]
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)[source]
+

Sets the environment of the motor.

+
+ +
+
+set_width(width)
+

Sets the width of the plot in data points.

+
+
Parameters:
+

width (int > 0) – The width of the plot

+
+
+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/cumulative_constraint_violation_plot.html b/parts/visualizations/motor_dashboard_plots/cumulative_constraint_violation_plot.html index e7f7eab9..e64be546 100644 --- a/parts/visualizations/motor_dashboard_plots/cumulative_constraint_violation_plot.html +++ b/parts/visualizations/motor_dashboard_plots/cumulative_constraint_violation_plot.html @@ -103,6 +103,74 @@

Cumulative Constraint Violation Plot

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.CumulativeConstraintViolationPlot[source]
+

Plots the cumulative number of constraint violations during the runtime of the env. into an axis.

+
+
+initialize(axis)[source]
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)
+

Sets the environment of the motor.

+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/episode_length_plot.html b/parts/visualizations/motor_dashboard_plots/episode_length_plot.html index daef5e42..cbd4123a 100644 --- a/parts/visualizations/motor_dashboard_plots/episode_length_plot.html +++ b/parts/visualizations/motor_dashboard_plots/episode_length_plot.html @@ -103,6 +103,74 @@

Episode Length Plot

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.EpisodeLengthPlot[source]
+

Plot to display the lengths of all episodes.

+
+
+initialize(axis)[source]
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)
+

Sets the environment of the motor.

+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/episode_plots.html b/parts/visualizations/motor_dashboard_plots/episode_plots.html index 1ce545cc..eed606e5 100644 --- a/parts/visualizations/motor_dashboard_plots/episode_plots.html +++ b/parts/visualizations/motor_dashboard_plots/episode_plots.html @@ -104,6 +104,74 @@

Episode Plot (Abstract)

The EpisodePlot is the base class for all plots that plot data with number of episodes on the x-axis.

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.EpisodePlot[source]
+

Base Plot class that all episode based plots .

+
+
+initialize(axis)
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()[source]
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)
+

Sets the environment of the motor.

+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/mean_episode_reward_plot.html b/parts/visualizations/motor_dashboard_plots/mean_episode_reward_plot.html index 0f0af244..73769857 100644 --- a/parts/visualizations/motor_dashboard_plots/mean_episode_reward_plot.html +++ b/parts/visualizations/motor_dashboard_plots/mean_episode_reward_plot.html @@ -103,6 +103,74 @@

Mean Episode Reward Plot

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.MeanEpisodeRewardPlot[source]
+

Class to plot the mean episode reward

+
+
+initialize(axis)[source]
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)
+

Sets the environment of the motor.

+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/reward_plot.html b/parts/visualizations/motor_dashboard_plots/reward_plot.html index aa37136c..a901ff6a 100644 --- a/parts/visualizations/motor_dashboard_plots/reward_plot.html +++ b/parts/visualizations/motor_dashboard_plots/reward_plot.html @@ -103,6 +103,91 @@

Reward Plot

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.RewardPlot[source]
+

Plot to display the instantaneous reward during the episode

+
+
+property data_idx
+

Returns the current index to access the time and data arrays.

+
+ +
+
+initialize(axis)[source]
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)[source]
+

Sets the environment of the motor.

+
+ +
+
+set_width(width)
+

Sets the width of the plot in data points.

+
+
Parameters:
+

width (int > 0) – The width of the plot

+
+
+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/state_plot.html b/parts/visualizations/motor_dashboard_plots/state_plot.html index fbdfa0ea..8a39d9ba 100644 --- a/parts/visualizations/motor_dashboard_plots/state_plot.html +++ b/parts/visualizations/motor_dashboard_plots/state_plot.html @@ -103,6 +103,96 @@

State Plot

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.StatePlot(state)[source]
+

Plot to display the environments states and their references.

+
+
Parameters:
+

state (str) – Name of the state to plot

+
+
+
+
+property data_idx
+

Returns the current index to access the time and data arrays.

+
+ +
+
+initialize(axis)[source]
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)[source]
+

Sets the environment of the motor.

+
+ +
+
+set_width(width)
+

Sets the width of the plot in data points.

+
+
Parameters:
+

width (int > 0) – The width of the plot

+
+
+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/step_plot.html b/parts/visualizations/motor_dashboard_plots/step_plot.html index 229c4efd..4dad6aa2 100644 --- a/parts/visualizations/motor_dashboard_plots/step_plot.html +++ b/parts/visualizations/motor_dashboard_plots/step_plot.html @@ -104,6 +104,127 @@

Step Plot (Abstract)

The StepPlot is the base class for all plots that plot data with the cumulative number of steps on the x-axis.

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.TimePlot[source]
+

Base class for all MotorDashboardPlots that have the cumulative simulated time on the x-Axis.

+

These use fixed-size numpy-arrays as x and y data. The plot is moved along the time axis and old data is cut out. +Furthermore, if the environment is reset manually or a limit violation occurs, a blue or red vertical line is +plotted to indicate these cases in the timeline.

+
+
+_t
+

The cumulative simulation time.

+
+
Type:
+

float

+
+
+
+ +
+
+_k
+

The cumulative no of taken steps.

+
+
Type:
+

int

+
+
+
+ +
+
+_x_width
+

The width of the x-axis plot. (Set automatically by the dashboard)

+
+
Type:
+

int

+
+
+
+ +
+
+property data_idx
+

Returns the current index to access the time and data arrays.

+
+ +
+
+initialize(axis)
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()[source]
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()[source]
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)[source]
+

Sets the environment of the motor.

+
+ +
+
+set_width(width)[source]
+

Sets the width of the plot in data points.

+
+
Parameters:
+

width (int > 0) – The width of the plot

+
+
+
+ +
+
diff --git a/parts/visualizations/motor_dashboard_plots/time_plot.html b/parts/visualizations/motor_dashboard_plots/time_plot.html index 6078bd32..c5182a6c 100644 --- a/parts/visualizations/motor_dashboard_plots/time_plot.html +++ b/parts/visualizations/motor_dashboard_plots/time_plot.html @@ -104,6 +104,127 @@

Time Plot (Abstract)

The TimePlot is the base class for all plots that plot data with the time on the x-axis.

+
+
+class gym_electric_motor.visualization.motor_dashboard_plots.TimePlot[source]
+

Base class for all MotorDashboardPlots that have the cumulative simulated time on the x-Axis.

+

These use fixed-size numpy-arrays as x and y data. The plot is moved along the time axis and old data is cut out. +Furthermore, if the environment is reset manually or a limit violation occurs, a blue or red vertical line is +plotted to indicate these cases in the timeline.

+
+
+_t
+

The cumulative simulation time.

+
+
Type:
+

float

+
+
+
+ +
+
+_k
+

The cumulative no of taken steps.

+
+
Type:
+

int

+
+
+
+ +
+
+_x_width
+

The width of the x-axis plot. (Set automatically by the dashboard)

+
+
Type:
+

int

+
+
+
+ +
+
+property data_idx
+

Returns the current index to access the time and data arrays.

+
+ +
+
+initialize(axis)
+

Initialization of the plot.

+

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

+
+
Parameters:
+

axis (matplotlib.pyplot.axis) – Axis to plot in

+
+
+
+ +
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()[source]
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)[source]
+

Gets called at the end of each step

+
+ +
+
+render()[source]
+

Update of the plots axis.

+

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes +are scaled dynamically.

+
+ +
+
+reset_data()[source]
+

Called by the dashboard, when the figures are reset to generate a new figure.

+
+ +
+
+set_env(env)[source]
+

Sets the environment of the motor.

+
+ +
+
+set_width(width)[source]
+

Sets the width of the plot in data points.

+
+
Parameters:
+

width (int > 0) – The width of the plot

+
+
+
+ +
+
diff --git a/parts/visualizations/visualization.html b/parts/visualizations/visualization.html index 334940eb..4355bc0d 100644 --- a/parts/visualizations/visualization.html +++ b/parts/visualizations/visualization.html @@ -99,6 +99,58 @@

Visualization

Visualization Base Class

+
+
+class gym_electric_motor.core.ElectricMotorVisualization[source]
+

Base class for all visualizations in GEM. +The visualization is basically only a Callback that is extended by a render() function to update the figure. +With the function calls that are inherited by the Callback superclass (e.g. on_step_end), +the data is passed from the environment to the visualization. In the render() function the passed data can be +visualized in the desired way.

+
+
+on_close()
+

Gets called at the beginning of a close

+
+ +
+
+on_reset_begin()
+

Gets called at the beginning of each reset

+
+ +
+
+on_reset_end(state, reference)
+

Gets called at the end of each reset

+
+ +
+
+on_step_begin(k, action)
+

Gets called at the beginning of each step

+
+ +
+
+on_step_end(k, state, reference, reward, terminated)
+

Gets called at the end of each step

+
+ +
+
+render()[source]
+

Function to update the user interface.

+
+ +
+
+set_env(env)
+

Sets the environment of the motor.

+
+ +
+ diff --git a/py-modindex.html b/py-modindex.html index c4997faa..e39f56e5 100644 --- a/py-modindex.html +++ b/py-modindex.html @@ -3,17 +3,18 @@ - Python Module Index — gym-electric-motor 2021 documentation - + Python Module Index — gym-electric-motor 2021 documentation + + - + - + + - - + @@ -41,11 +42,11 @@