ModelicaGym: applying reinforcement learning to Modelica models

This paper presents ModelicaGym toolbox that was developed to employ Reinforcement Learning (RL) for solving optimization and control tasks in Modelica models. The developed tool allows connecting models using Functional Mock-up Interface (FMI) to OpenAI Gym toolkit in order to exploit Modelica equation-based modeling and co-simulation together with RL algorithms as a functionality of the tools correspondingly. Thus, ModelicaGym facilitates fast and convenient development of RL algorithms and their comparison when solving optimal control problem for Modelica dynamic models. Inheritance structure of ModelicaGym toolbox's classes and the implemented methods are discussed in details. The toolbox functionality validation is performed on Cart-Pole balancing problem. This includes physical system model description and its integration using the toolbox, experiments on selection and influence of the model parameters (i.e. force magnitude, Cart-pole mass ratio, reward ratio, and simulation time step) on the learning process of Q-learning algorithm supported with the discussion of the simulation results.

[1]  Michael Chertkov,et al.  Options for Control of Reactive Power by Distributed Photovoltaic Generators , 2010, Proceedings of the IEEE.

[2]  Luigi Vanfretti,et al.  Power system model identification exploiting the Modelica language and FMI technologies , 2014, 2014 IEEE International Conference on Intelligent Energy and Power Systems (IEPS).

[3]  Giovanni De Magistris,et al.  Reinforcement Learning Testbed for Power-Consumption Optimization , 2018, ArXiv.

[4]  Richard S. Sutton,et al.  Neuronlike adaptive elements that can solve difficult learning control problems , 1983, IEEE Transactions on Systems, Man, and Cybernetics.

[5]  Peter Fritzson,et al.  A Generic FMU Interface for Modelica , 2011, EOOLT.

[6]  Mattias Hallén Comminution control using reinforcement learning : Comparing control strategies for size reduction in mineral processing , 2018 .

[7]  L. Vanfretti,et al.  Unambiguous power system dynamic modeling and simulation using modelica tools , 2013, 2013 IEEE Power & Energy Society General Meeting.

[8]  Luigi Vanfretti,et al.  Bayesian Parameter Estimation of Power System Primary Frequency Controls under Modeling Uncertainties , 2015 .

[9]  Richard S. Sutton,et al.  Reinforcement Learning: An Introduction , 1998, IEEE Trans. Neural Networks.

[10]  Adrian Pop,et al.  OpenModelica - A free open-source environment for system modeling, simulation, and teaching , 2006, 2006 IEEE Conference on Computer Aided Control System Design, 2006 IEEE International Conference on Control Applications, 2006 IEEE International Symposium on Intelligent Control.

[11]  Johan Åkesson,et al.  PyFMI: A Python Package for Simulation of Coupled Dynamic Models with the Functional Mock-up Interface , 2016 .

[12]  Ian A. Hiskens,et al.  Achieving Controllability of Electric Loads , 2011, Proceedings of the IEEE.