Andras Herczeg: Energy capacity planning and modeling - with Open Source Energy Modeling System (OSeMOSYS) (Final Report) Rensselaer Polytechnic Institute MANE-6960H01 Mathematical Modeling of Energy and Environmental Systems Spring 2013 Professor Ernesto Gutierrez-Miravete
Research question How a micro-grid should be optimized for capacity (expansion) for the electricity generation system, in respect to the prioritized construction of renewables (including fuel cells) and natural gas-based power plants? Energy models to simulate capacity planning The sustainability of a comprehensive energy development is ensured by energy planning, which combine multiple elements to an integrated standpoint. It creates a roadmap while optimally allocating (domestic) resources and complies with the energy policy (e.g. energy security) concerns. From the financial point of view the investment and other institutional requirements are takes into account. Finally it can be used for testing to identify the best solution and also to find if current energy policy measures are feasible (e.g. maintain accessibility and affordability. The recent years the need for energy modeling and systems analysis grew significantly. Since capacity building is a long-term development, universities or research institutes became very active to develop modeling capability, which is supported by their international and national networks. Subsequently, the network structure also helps to promote interdisciplinary exchange that becomes very advantageous, as energy modeling and scenario analysis relies on many disciplines. The current energy models can be divided into four categories (IEA): 1) Integrated Assessment Models (e.g. AIM, REMIND-R, WITCH) 2) Economic models (e.g. GEMINI-E3, E3MG, IMACLIM-R, OECD ENV-LINKAGES) 3) Energy systems models (e.g. MARKAL, TIMES, MESSAGE, LEAP, PRIMES, NEMS) 4) Engineering models (e.g. RETScreen) The different models offer answer for different questions. In the case of capacity planning the best choice is the energy systems models (for examples of energy systems models please see Appendix) the best choice. 2
The connection between LEAP and OSeMOSYS The Long range Energy Alternatives Planning System (LEAP) is a user friendly, integrated modeling tool for energy policy analysis and climate change mitigation assessment, which can be used in various ways including to track energy consumption, production and resource extraction in all sectors of an economy. It should be noted though that LEAP is not a model of a particular energy system, but rather a tool that can be used to create models of different energy systems, where each requires its own unique data structures. 1 LEAP also includes numerous capabilities, for instance it can automatically calculate least cost capacity expansion, which are integrated to the Open Source Energy Modeling System (OSeMOSYS) which has been developed by a coalition of organizations including the International Atomic Energy Agency (IAEA) and the UK Energy Research Center. OSeMOSYS is included as part of LEAP's standard installation and fully integrated into LEAP's user interface. Finally, no further software is needed to use optimization in LEAP. LEAP and OSeMOSYS have a completely transparent connection, which enables users of LEAP to automatically writes the data files required by OSeMOSYS through utilizing on the same data input presented already in LEAP (e.g. process efficiencies, availability rates, emission factors etc.). Other existing energy system models do not emphasize that level of compactness and openness, which create a barrier to develop new capabilities or attract much more new users. Finally, the differences of the top-down and the bottom-up design should be noted. While the clear distinction between top-down and bottom-up (see Table 1 for detailed comparison) started to diminish, still hybrid models are relatively new, in which the two approaches have been merged. LEAP is an example of a hybrid model as it supports a wide range of different modeling methodologies: on the demand side these range from bottom-up, end-use accounting techniques to top-down macroeconomic modeling. 1 For more information visit: An Introduction to LEAP, http://www.energycommunity.org/default.asp?action=47 (accessed April 2013) 3
Source: Van Beeck. (1999) Table 1. Characteristics of top-down and bottom-up models The hybrid approach provides greater flexibility to the interconnected tools (e.g. OSeMOSYS) as well. That enables them to perform more accurate optimization calculations and decide what types of technologies and when to add them so as to meet a certain demand in the future. OSeMOSYS OSeMOSYS is fully-fledged energy systems optimization model. It is a flexible and transparent tool that becomes very handful when energy planning problems arise as it easily allows the testing of new applications and formulations. Its code is relatively straightforward (detailed description of the model inputs, parameters, and outputs) and well-documented (still, less than 5- pages), which builds on an open source programming language (GNU MathProg) and solver (GLPK). GNU MathProg is a modeling language intended for describing linear mathematical 4
programming models. These descriptions consist of a set of statements and data blocks constructed by the user. 2 The programming language is supported by GNU Linear Programming Kit (GLPK), a software toolkit aiming at solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems. It is a set of routines written in ANSI C and organized in the form of a callable library. 3 That structure makes OSeMOSYS an ideal choice for beginners as well. The structure of the code is composed of functional "blocks", each of which is divided into several layers of abstraction (Howells et al., 2011): I. A conceptual description of the model elements. II. An algebraic formulation of this description. III. The model s implementation in a programming language. IV. The application of the model. Figure 1. OSeMOSYS blocks and levels of abstraction Source: Howells et a. (2011) 2 For more information visit: GNU MathProg, Available at: http://lpsolve.sourceforge.net/5.5/mathprog.htm (accessed April 2013) 3 For more information visit: Makhorin A. GLPK (GNU Linear Programming Kit), Available at: http://www.gnu.org/s/glpk/ (accessed April 2013) 5
As illustrated in Figure 1, the blocks include specifications of the objective (1), costs (2), storage (3), capacity adequacy (4), energy balance (5), constraints (6) and emissions (7). Given its open source nature, OSeMOSYS provides the flexibility to recode the model to represent specific modeling needs and options as well (Welsch et al., 2012). A lego block structure allows easily adding elements. Every block consists of a plain english describtion, the formulas, and the actual code. OSeMOSYS modeling reliability can be tested and validated compare to other system. For instance with the same parameters, the results are very similar when run in both MARKAL and OSeMOSYS. Source: Howells et al. (2011) Figure 2. UTOPIA power plant capacities in MARKAL and OSeMOSYS 6
Analysis with OSeMOSYS A simplified problem for demonstration The main constraint in this case is technical, as there can be a (maximum) limit imposed in new capacity investments in particular technologies (e.g. coal-fired plants), while also certain less efficient technologies (e.g. renewables) have a minimum cap determined. Another constraint is the type of generation (base/intermediate/peaking). 4 Figure 3. Major Classification of Generators Source: ISO New England However, in that certain case the number of available technologies are limited to limited due to the project`s small size (for instance in the case of a microgrid. Problem 4 For more information visit: http://www.iso-ne.com/support/training/courses/ (accessed April 2013) 7
Microgrid: 5MW power need (a fire and a police station, town hall, school, gas station and a grocery store) Available generations sources: Small-hydro: capacity: 1 MW, availability: 100 hours/week Diesel engine(s): capacity: 0-5 MW, availability: 168 hours/week Simplifying assumption: load factor 100% The cost of the diesel generated power is 3 times more than the hydro power. Depending on the maintenance/refilling schedule, the state require to run the small-hydro plan as much as possible to reduce CO 2 emission Planning period: 1 week Objective function The general constraint in terms of the decision variables is: min z = x 1 + 3 x 2 (1) (objective function) x 1 + 5 x 2 5 *168 840 (2) (demand constraint) Other constraint: x 1 1*100 = 100 (3) (availability constraint) x 1 0, x 2 0 (4) (sign constraint) File name: RPI.txt Comments Lines 1 through 5 are comments. # anywhere on a line begins a comment to the end of the line. C-style comments can also be used, as shown on line 7. 2 # Capacity problem for Microgrid 3 # 4 # This finds the optimal solution for Microgrid The decision variables 8
The first MathProg step is to declare the decision variables: lines 8 and 9 declare x 1 and x 2. Note, that every sentence in GNU MathProg must end with a semicolon (;) 7 /* Decision variables */ 8 var x1 >=0; /* hydro */ 9 var x2 >=0; /* diesel */ These variables could have been called hydro and diesel, but that could cause confusion on the mathematics side. The objective function Linear problems can be either maximized or minimized; the target (objective function - z) in the case of this particular analysis (as Line 12 declares) is the latter - to reduce cost. In the GNU MathProg: the colon (:) character separates the name of the objective function and its definition. the asterisk (*) character denotes multiplication and, similarly, the plus (+), minus (- ), and forward slash (/) characters denote addition, subtraction, and division as one would expect. 11 /* Objective function */ 12 minimize z: x1 + 3*x2; The constraints Although s.t. is not required at the beginning of the line to declare a constraint, it improves the readability of the code. Lines 14, 15, and 16 define the constraints. 14 /* Constraints */ 15 s.t. Demand : x1 + 5*x2 <= 840; 16 s.t. Capacity : x1 <= 100; The problem data set In this particular case no data section is needed due to the simplicity of the input file. This problem is so simple that the problem data is directly included in the objective function and constraints declarations as the coefficients of the decision variables in the declarations. Also, it should be noted that -due to the assumptions - four OSeMOSYS building blocks are necessary for that problem: (1) Objective, (2) Costs, (4) Capacity Adequacy and (6) Constraints. 9
However; (5) Energy Balance and (6) Emissions play an important role in an extended model with a larger data set. Ending the input file Every GNU MathProg file must end with end;, as seen on line 19. 17 18 end; Command line This command line uses two glpsol options: The -m option tells glpsol that the input is written in GNU MathProg. The -o option tells glpsol to send its output to microgrid.sol. microgrid -m microgrid.mod -o microgrid.sol Results Future paths GNU MathProg through OSeMOSYS offers great opportunities to extend the programming, including what Figure 4 refers (notification time, start-up time, minimum run time, minimum down time) and other factors as well (a more detailed energy demand forecast, additional supply options, emission target e.g. annual CO 2 cap, etc.) 10
Figure 4. Major Classification of Generators Source: ISO New England The sample data set ( UTOPIA ) can also use for further modification to find more accurate and updated solution for future problems. Figure 5. The UTOPIA reference energy system (RES) Source: Howells et al. (2011) 11
For instance it can be used to better the increasing needs of real-time generation that arise from the expansion of the PHEV and electric vehicles. 12
Appendix Source: IEA 5 Figure 6. Example of the bottom-up energy system model: TIMES Source: IAEA Figure 7. Example of an integrated energy planner: MESSAGE 5 For more information visit: http://www.iea.org/media/workshops/2012/egrd/remme.pdf (accessed 2013 April) 13
References Fay, A.J. and Golomb, D.S. (2012): Energy and Environment - Scientific and Technological Principles, Oxford University Press, New York Howells, M., Rogner, H., Strachan N. and et al. (2011): OSeMOSYS: The Open Source Energy Modeling System - An introduction to its ethos, structure and development, Energy Policy 39 5850-5870. International Energy Agency s (IEA) webpage - http://www.iea.org (accessed 2013 April) Van Beeck, N. (1999): Classsification of Energy Models, FEW 777, May 1999 Wallace, S.W. and Fleten S.-E. (2003): Stochastic Programming Models in Energy; Handbooks in OR & MS (eds. A. Ruszczynski and Shapiro, E.) Vol. 10 Welsch, A., Howells M. et al. (2012): Modelling elements of Smart Grids - Enhancing the OSeMOSYS (Open Source Energy Modelling System) code; Energy, 46 337-550 Accessed software MARKAL, TIMES - Energy technology Systems Analysis Program (ETSAP) - http://www.ieaetsap.org/web/markal.asp MAED, MESSAGE International Atomic Energy Agency (IAEA) http://www.iaea.org/ourwork/st/ne/pess/pessenergymodels.html (accessed 2013 April) OSeMOSYS - The Open Source Energy Modeling System (OSeMOSYS) - http://osemosysmain.yolasite.com/ (accessed 2013 April) 14