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.