An integrated Solver Manager: using R and Python for energy systems optimization ?
Emilio L. Cano1, , Antonio Alonso-Ayuso1 , Javier M. Moguerza1 and Felipe Ortega1 1. Universidad Rey Juan Carlos ? Contact author:
[email protected]
Keywords: Optimization, interfaces, decision support systems, energy systems planning, risk management
EnRiMa (Energy Efficiency and Risk Management in Public Buildings) is an EU FP7 research project in which a Decision Support System (DSS), aiming at supporting building operators on both operational and strategic decisions, is being developed. Such DSS is composed of several integrated modules, which are in charge of specific tasks as a distributed system. The EnRiMa DSS relies on Stochastic Optimization as a framework for decision making under uncertainty. This approach provides optimal strategic decisions given all the scenarios considered, rather than for parameter estimates. Hence, not only average values of crucial parameters such as demand or investment and energy costs are used, but also their variability. That variability is implemented through the use of scenario trees. A scenario tree is a discretized representation of the stochastic process of the system. The so-called Solver Manager module gathers the input from the rest of the modules through an interface, generates the problem instance, calls the optimization software, and delivers the solution eventually presented to the decision maker. Thus, the Graphical User Interface (GUI) DSS module provides input from and shows the solution to the user. The Scenario Generator tool DSS module provides the scenario tree structure and stochasticity information about the parameters. The DSS Kernel module provides data services to the rest of the modules, allowing a sound integration. The Solver Manager consists of two independent components: the interface and the “core script”. The Solver Manager Interface allows us to separate communication tasks and other interaction features from the core features of the Solver Manager. The Solver Manager Interface has being built using the Python programming language. Using the data services provided by the DSS Kernel, the Solver Manager Interface retrieves the stochastic optimization problem instance data from a MySql database and creates XML files. Next, data.frame objects are created using the XML R package. The Solver Manager main script uses the optimr R library, which is being developed by the Department of Statistics and Operations Research at Universidad Rey Juan Carlos, and the gdxrrw package to interact with the GAMS optimization software. That script, after checking the model and the instance, generates the data for the optimization software, calls the optimizer and manages the output, storing the results in R objects ready for the Solver Manager Interface to make them available for the decision maker. Further development of the DSS will include the use of other optimizers, including R capabilities and APIs. References Energy efficiency and risk management in public buildings – EnRiMa. enrima-project.eu.
http://www.
Conejo, A., M. Carri´on, and J. Morales (2010). Decision Making Under Uncertainty in Electricity Markets. International Series in Operations Research and Management Science Series. Springer. Dirkse, S. and R. Jain (2012). gdxrrw: An interface between GAMS and R. R package version 0.2.0. Kaut, M., K. T. Midthun, A. S. Werner, A. Tomasgard, L. Hellemo, and M. Fodstad (2012). Dual-level scenario trees – scenario generation and applications in energy planning. Optimization Online. report 2012/08/3551.