def __init__(self, motor='DcPermEx', reward_function=None, reference_generator=None, **kwargs):
     """
     Args:
         motor(ElectricMotor): Electric Motor used in the PhysicalSystem
         reward_function(RewardFunction): Reward Function for the environment
         reference_generator(ReferenceGenerator): Reference Generator for the environment
         kwargs(dict): Further kwargs tot pass to the superclass and the submodules
     """
     physical_system = DcMotorSystem(motor=motor, **kwargs)
     reference_generator = reference_generator or WienerProcessReferenceGenerator(**kwargs)
     reward_function = reward_function or WeightedSumOfErrors(**kwargs)
     super().__init__(
         physical_system, reference_generator=reference_generator, reward_function=reward_function, **kwargs
     )
 def __init__(self, motor='SynRM', reward_function=None, reference_generator=None, constraints=None, **kwargs):
     """
     Args:
         motor(ElectricMotor): Electric Motor used in the PhysicalSystem
         reward_function(RewardFunction): Reward Function for the environment
         reference_generator(ReferenceGenerator): Reference Generator for the environment
         kwargs(dict): Further kwargs tot pass to the superclass and the submodules
     """
     physical_system = SynchronousMotorSystem(motor=motor, **kwargs)
     reference_generator = reference_generator or WienerProcessReferenceGenerator(**kwargs)
     reward_function = reward_function or WeightedSumOfErrors(**kwargs)
     constraints_ = constraints if constraints is not None \
         else ('i_a', 'i_b', 'i_c', SquaredConstraint(('i_sd', 'i_sq')))
     super().__init__(
         physical_system, reference_generator=reference_generator, reward_function=reward_function,
         constraints=constraints_, **kwargs
     )
Example #3
0
        motor_parameter=dict(r_a=15e-3, r_e=15e-3, l_a=1e-3, l_e=1e-3),

        # Set the parameters of the mechanical polynomial load (the default load class)
        load_parameter=dict(a=0, b=.1, c=.1, j_load=0.04),

        # Defines the utilized power converter, which determines the action space
        # 'Disc-1QC' is our notation for a discontinuous one-quadrant converter,
        # which is a one-phase buck converter with available actions 'switch on' and 'switch off'
        converter='Disc-1QC',

        # Define which states will be shown in the state observation (what we can "measure")
        state_filter=['omega', 'i'],

        # Define the reward function and to which state variable it applies
        # Here, we define it for current control
        reward_function=WeightedSumOfErrors(observed_states='i'),

        # Defines which numerical solver is to be used for the simulation
        # euler is fastest but not most precise
        ode_solver='euler',
        solver_kwargs={},

        # Define and parameterize the reference generator for the current reference
        reference_generator=WienerProcessReferenceGenerator(
            reference_state='i', sigma_range=(3e-3, 3e-2)),

        # Defines which variables to plot via the builtin dashboard monitor
        visualization=MotorDashboard(state_plots=['i', 'omega']),
    )

    # Now, the environment will output states and references separately