Balmorel open source energy system model

As the world progresses towards a cleaner energy future with more variable renewable energy sources, energy system models are required to deal with new challenges. This article describes design, development and applications of the open source energy system model Balmorel, which is a result of a long and fruitful cooperation between public and private institutions within energy system research and analysis. The purpose of the article is to explain the modelling approach, to highlight strengths and challenges of the chosen approach, to create awareness about the possible applications of Balmorel as well as to inspire to new model developments and encourage new users to join the community. Some of the key strengths of the model are the flexible handling of the time and space dimensions and the combination of operation and investment optimisation. Its open source character enables diverse, worldwide applications for exploratory energy scenarios as well as policy analysis as the applications outlined demonstrate. The existing functionality and structural suitability for extensions make it a useful tool for assessing challenges of the ongoing energy transitions. Numerous model extensions have been developed as different challenges to the energy transition have arisen. One of these includes the option of running the model with unit commitment. To meet new challenges, further development is needed and consequently the article outlines suggestions for future development, such as including transport of local biomass as part of the optimisation and speeding up the model. © 2018 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).


Introduction
The conversion of energy sources to electricity and the delivery of heat and transportation services are both technically complex and have large economic and environmental implications to society. For these reasons, energy system modelling has a long tradition spanning back to the 1950s when linear programming was utilised for capacity expansion planning [1]. Planning of more sustainable energy supply gained attention in energy modelling after the oil crisis in 1970s [2]. Today, energy system models are widely used by energy companies, policy makers and research institutions to increase insight into energy markets, future energy system development and implications of energy policies. The increasing efforts to replace fossil fuels with renewable energy resources in order to mitigate climate gas emissions and to address challenges like energy security, scarcity of resources and energy affordability, shift the temporal and spatial scope of analysis. Further, the electricity, heating and transportation sectors will likely become more integrated. These developments add new complexity to energy systems and thereby new challenges to energy system models. The benefits of energy system modelling tools become even more evident under this development. Balmorel is one such tool which has a long application history of extensive use in both public and private sectors.
Balmorel is a bottom-up partial equilibrium energy system optimisation model with a special focus on electricity and district heating sectors. The first version of Balmorel was released in 2001 by Hans Ravn et al. [3]. Since the first version, an extensive cooperation between research institutions and consultancies in several countries have gradually developed the model according to new needs and demands as the energy sector has evolved. The source code has been provided online since 2001 and was assigned the ISC license in 2017 [4]. Balmorel fulfils one of the preconditions for required transparency for energy models since its code is open source. Also, all input data and all data manipulations are in clear code, with documentation in Ref. [5]. The solution is obtained by application of solvers for which the principles and properties of the obtained solution have been part of the standard repertoire for decades [6].
The objective of this paper is three fold: 1) To describe the Balmorel model as of 2017.2) To discuss the experiences from close to 20 years of continuous model development. 3

Overview
Balmorel is a partial equilibrium model for simultaneous optimisation of generation, transmission and consumption of electricity and heat under the assumption of perfectly competitive markets [3,5,7]. The model finds the optimal way to satisfy the energy demand maximising social welfare, viz., consumers' utility minus producers' cost of electricity and district heat generation, storage, transmission and distribution; subject to technical, physical and regulatory constraints.
Balmorel is written in the GAMS (General Algebraic Modelling System) modelling language [8] and built in a generic, extensible modular structure (cf. Section 2.5); therefore, new energy commodities (e.g. hydrogen or biofuels production) and features (e.g. transportation) might be included through addons in the basic modelling framework, which is described in this section. The Balmorel core model is linear, but mixed-integer modelling may be applied, e.g. in order to represent economies of scale and unit commitment.
The model is data-driven and has a high degree of flexibility with respect to temporal and spatial options. Time might be defined chronologically in three layers, while the basic time unit (e.g., two hours, hour, half hour, etc.) is not predefined in the structure of the model. Concerning space, Balmorel is divided into three hierarchical geographical entities (cf. Section 2.2). The level of detail of the temporal and spatial dimensions will be user-defined.
Resources' market prices and final energy demands are exogenous parameters in Balmorel. Availability of some resources might be exogenously constrained, in case the system has no or limited access to interregional trade markets.
The base model includes conversion of energy resources to electricity and heat, storage and transmission and associated costs and losses related to energy distribution.
The supply side consists of various generation technologies, whose planned capacity, commissioning and decommissioning is defined exogenously. New capacity investment and endogenous decommissioning are found as a result of the optimisation. These technologies have specified fuel types, fuel efficiency, investment and operation & maintenance (O&M) costs, ratio between power and heat production (co-generation units), expected technical lifetime, as well as environmental characteristics for each technology; such as SO2, NOx or CH4 emissions. Variable renewable energy (VRE) technologies (e.g., wind, solar power, solar heat, runof-river and reservoir hydropower) have production or inflow profiles exogenously given at each time segment and geographical entity, with the possibility of curtailment.
There are two types of storage implemented in Balmorel: shortterm storages of electricity and heat and long-term storages of electricity, heat and hydrological reservoirs. All storages are limited by storage dynamics.
Electricity trade in Balmorel might take place between different Regions, 2 subject to the capacity of transmission lines -including existing, planned and endogenous investments-and their availability. Trade of electricity with third Regions, which are not explicitly modelled, can be defined by providing exogenous power flows per time segment or through prices and limits to power transmission, where the exact amount of electricity trade at each time segment with the third Region is determined endogenously.
Energy balance constraints ensure that energy supply equals demand at every time segment and geographical entity. The equilibrium condition provides energy commodity prices for all geographical entities and time segments. The optimal solution is found along with associated dual variables, or shadow prices.
Different running modes can be applied depending on the desired level of foresight for optimisation between time segments and if endogenous investments are taken into account (cf. Section 2.3). Fig. 1 illustrates the core structure of the model. Depending on the application, various types of electricity and heat demands, additional technologies etc. can be defined. Where appropriate, the input may be differentiated with respect to technologies, time and space.

Spatial resolution
Space is in Balmorel defined by using three layers of geographical entities. The entities are from broadest to narrowest: Country, Region and Area. The entities are organised in a hierarchy such that each Region or Area belongs to exactly one Country or Region, respectively. However, each Country can contain many Regions and each Region can contain many Areas.
The Country layer allows for general economic input to be defined, such as policy measures, renewable energy targets, resource restrictions and fuel prices. The Country level is also extensively utilised for summarising results.
Between Regions, power transmission limitations can be defined such that congestion can be modelled within a Country. Another distinguished feature of the Regional layer is that here the electric power demand is defined and electricity balance is maintained. Therefore, on the Region level, the marginal cost of supplying power demand can be observed, which can be interpreted as the geographically specific market price of power in the model output. The model may be set up for the Regions to depict market bidding entities, nodes or used for congestion analysis. No power grid is considered inside a Region i.e. a copper plate system is assumed.
Areas are used to represent individual geographical characteristics within a Region. Wind, hydro, solar and other climate conditions are defined on the Area level, as well the type and capacity of all power and heat generating and storage units. Because a Region can include multiple Areas, more than one set of climate conditions can be defined within a Region. For example, two Areas in a Region can represent distinct onshore and offshore wind potentials. Heat demand can also be defined in Areas, such that one Area can either depict a single district heating network or an aggregated heat supply and demand from multiple networks.

Temporal resolution
In Balmorel, time might be defined chronologically using three hierarchic layers: the highest layer is called Year, the middle layer Investments and policy measures can be assessed over the span of one or more Years. Section 2.3 elaborates on the details of how investments are viewed over a single or multiple Years.
In addition to technical structuring of time in the model, Seasons allow to depict seasonality within a Year. Such characteristics could be hydro reservoir levels, other long-term storages, renewable energy production or availability of production capacities. Terms are the smallest definition of time available. For each Term, optimal heat and power dispatch are determined. The operation of storage technologies is assessed between Terms.

Running modes
The Balmorel model can be run in four different modes, which vary with respect to the optimisation period and whether endogenous investments are allowed. In all model modes, the complete model horizon (the whole time period that is modelled) can include multiple optimisation periods, meaning the overall studied time period in the model can be longer than the section of time which is optimised simultaneously. Within the specified optimisation period the model has perfect foresight on future energy system parameters like electricity and district heat demand, taxes and policies, and fluctuation of weather dependent energy sources. In all running modes, the level of detail in temporal resolution can vary according to user choice depending on the complexity, data availability and the purpose of the constructed model. Having all input data regarding time variations at the same high level of detail (e.g., hourly) hence makes it possible to flexibly choose time aggregation from analysis to analysis. Table 1 gives an overview of key characteristics of the different Balmorel running modes, and more detailed descriptions of each mode are given in the following.

Myopic simulation mode -Balbase1
The Balbase1 running mode optimises the short-term operation of a user-specified energy system, without allowing for endogenous investments in generation or transmission capacities. The optimisation period is one Year (myopic), assuming perfect foresight within the modelled Year, optimising simultaneously for all time segments in the Year, the short-term energy dispatch of a userspecified (exogenous) power and heat system. Nevertheless, many Years can be included in the model horizon. This includes optimal allocation of thermal plants, generation from VRE, transmission between power Regions, dynamics between the power and heat markets, hydropower reservoir dynamics and other long-or short-term storage. With exogenously specified energy system parameters, future capacities will be based on the user's assumptions for the development of the energy sector, climate and energy policies.

Myopic investment mode -Balbase2
The Balbase2 mode of the model is based on Balbase1 with the additional option of modelling investments in technologies and transmission capacities. Given the assumed energy system, fuel and carbon prices and energy demand for the modelled Year, investments in new production and transmission capacities are optimised along with the operation as in Balbase1, based on an assumed interest rate, investment costs and lifetime. If the social welfare is higher with than without an investment for that specific Year, the respective investment will be made at the beginning of the Year. Such endogenous investments are available in subsequent Years.

Seasonal optimisation -Balbase3
The Balbase3 mode of the model is similar to the short-term energy dispatch described in Balbase1, but instead of one Year, the optimisation period is one Season. This allows a higher temporal resolution in complex models where using Balbase1 with a high temporal resolution is too time consuming. If Balbase3 is chosen, the highest available level of temporal detail within a Season will automatically be used. Because the model lacks vision outside of the optimisation period, some output from model runs with one or more full Years can be used as input for Balbase3. Such input could be available hydro power resource for a given Season, status of long-term storage or investments made in Balbase2. These dynamics between one of the long-term scenario modes and the short-term dispatch mode (Balbase3) enables detailed investigation of seasonal dynamics in long-term scenarios.

Rolling horizon optimisation -Balbase4
The Balbase4 mode contains all the functionality of Balbase2 (and therefore that of Balbase1), but in distinction to Balbase1 and Balbase2, an optimisation period with more than one Year may be solved. Further, a rolling horizon approach is used, such that a sequence of partially overlapping multi-year models are solved. A novel feature for the rolling horizon investment mode is the explicit distinction between actors' (consumers', producers', transmission system operators' (TSO)) and society's time and risk preferences. From a structural point of view, this running mode Balbase4 will replace Balbase1 and Balbase2 since it includes all functions of these. This better look ahead mechanism for investment decisions is already available in the most recent version [9] and has been applied for prediction of electricity prices [10,11]. Since it is not fully tested yet, Balbase1 and Balbase2 still exist, also to keep backward compatibility.

Main equations
This section provides further details without going into implementation details or algebraic formulation. The commented source code can be found on GitHub [9], Zenodo [12] and the model homepage [13]. For the declarations and definitions of equations, we refer to the available GAMS code and its description [14] since this will reflect the current version of the coding. The link of reference [14] directly leads to the overview of the equation declaration in the code. See also 2.6 for more information on publishing of the code.

Objective function
The objective function in Balmorel maximises social welfare subject to technical, physical and regulatory constraints. It represents the sum of system costs which include fuel, transmission, fixed and variable O&M costs, taxes and subsidies, minus consumers' utility. In the case of running a model in myopic investment mode, annuitized investment costs are also included. Furthermore, if a rolling horizon investment mode is chosen, components of the objective function are represented by their net present value (NPV). The difference is caused by the need to value e.g. investments made in different years at the same time in rolling horizon investment mode.

Balance equations
These equations ensure that electricity and heat supply equal demand in each time step and for every relevant geographical entity.

Capacity constraints
The generation level of each specific dispatchable technology per time slice and geographical entity is limited by the exogenous and endogenous installed capacity.

Energy constraints
Energy constraints reflect bounds on energy over a certain time interval. These equations indicate that the energy used or stored might be lower, equal or higher than a given value.

Operational constraints
These equations represent the technical characteristics associated to the technologies and their related operational specifications. For example, they might define what are the feasible ratios between electricity and heat generation for a co-generation plant, chronology related aspects like how fast a storage can be charged or discharged, or ramping rates for a generator.

Other constraints
Other physical and technical limitations can be defined in Balmorel, as maximum level of expansion capacity at a given Year, etc. Furthermore, the user can define specific political goals at each geographic entity in a Year. Examples of political targets are maximum level of greenhouse gas emissions, minimum share of renewable energy generation, restrictions to fossil fuel consumption or degree of self-sufficiency.

Code structure
Formulation, documentation and solution of the mathematical model of Balmorel is done in the GAMS modelling language.
The main code declares and defines input data (parameter, sets, scalars), includes data and options files, and declares and defines variables and equations. Through option files, the user can select Balmorel and GAMS control options such as running mode (cf. Section 2.3), usage of addons, solver options, and amount and details of output generation. Balmorel aids the user in debugging through specific standardised error messages and a logfile for input and solution evaluation. Besides the automatic GAMS output in gdx format, output describing the energy system results is automatically generated in various text files. Optionally the output can be converted to a database file for subsequent use.
Optional extensions of the model code that provide additional functionality, e.g. transfer of heat, combined technologies, electric vehicles, are called addons. Some addons heavily influence calculation time and need thus be carefully chosen according to their impact on the question to be answered by the respective model run. Table 2 lists the addons that are included in the model version available for download at [15] and [9].

Open source character
Balmorel's model code is openly available since its creation and first release in 2001. In 2017, the code was assigned the ISC license [4], which grants the "[p]ermission to use, copy, modify, and/or distribute this software for any purpose with or without fee […], provided that the above copyright notice and this permission notice appear in all copies" (excerpt of the license file of Balmorel). Although this has always been the intention (as stated in the code although in different and not recognised wording) and has been common practice since 2001, the license eliminates all legal uncertainty caused when no recognised license is given. In contrast to a copyleft license, which requires that derivative work is shared under the same or a compatible license [16], this permissive license places the fewest restriction on users and adopters. The only legal barrier to utilising Balmorel code is the required GAMS licence.
The process of assigning a recognised license to the model code involved contacting contributors to the code and getting their consent. There was consensus on the principles stated in the code, on the home page of the model and in all communication, and it was therefore considered unproblematic to formally apply a license statement believed to have the same content as was always intended, although in different wording.
Stable versions of the code as well as documentation of model structure [5] and exemplary data have been released on the model homepage [13] since 2001. Many projects have opted to modify the code to suit a specific task. The structure of the model and its coding in a high level modelling language facilitate this. Most of the present addons (Table 2) have their root in such situations, and have been included in the publicly accessible code. The implementation of the core model has proven to be a robust structure for this for almost two decades.
Until recently the interchange of code modification and addition of new functionality took place mainly on bilateral basis. To the extent that a new project-developed functionality was found of more general applicability, the relevant code sections were adapted to the version kept by the main author, documented and released on the home page. Today, the development of Balmorel is enhanced through the use of available collaborative code development tools. The collaborative development of Balmorel now takes place at the code hosting platform Bitbucket, which allows for version control and a review process of new code. The main development so far has taken place in private repositories. However, recently the community has released the current stable version in a public repository on GitHub [9]. Starting from version 3.02 [15], all the released versions on GitHub will be published on Zenodo [12].
The current usage of two code hosting platforms is not a well planned strategy, but is due to the grown structure. Collaborative work on Balmorel utilising version control started in a private repository on Bitbucket for just one project. Due to experienced advantages, other projects and developers joined in and the repository has become the main development platform. However, the advantage of GitHub is its integration with Zenodo, which enables publication of a release with a quotable doi. Moreover, moving the development completely to the GitHub repository would increase transparency and visibility of the community, as well as enable additional contributions from other Balmorel users. Nevertheless, this planned step requires planning and coordination within the community to ensure a painless transition.
A core developer group of about ten persons including the initial author are presently developing the described version of Balmorel. These are based at the company RAM-lose, Danish Technical University (DTU), Norwegian University of Life Sciences (NMBU) and Tallinn University of Technology (TTU). There are closed forks of Balmorel in EA Energy Analyses and other companies as this possibility is implied in the license. Furthermore, other research institutions (e.g. Chalmers University of Technology, Sweden) further develop Balmorel without actively publishing it. Via informal knowledge exchange and within the scope of jointly conducted projects, also some of the successful code improvements of closed forks feed back into the open version of Balmorel. The following Table 2 Overview Balmorel addons available in version 3.02 available at [15].

Abbreviation Description
AGKNdisc Permits specification that for any technology the endogenous investment must be in one of the predefined MW-sizes combtech Creates dependencies between technologies for simulation of multiple boilers within a power plant or e.g. multiple fuel boilers Fjernvarme Expansion of the district heating grid to new customers can be decided endogenously gas heattrans Allows modelling of supply and demand of natural gas Allows for transportation of heat from one district heat area to another similar to handling of electricity transmission hydrogen Allows for modelling of hydrogen producing and consuming technologies such as electrolyzer and fuel cells hyrsbb123 Hydropower production in Balmorel running mode Balbase3 is optimised with respect to amounts or water values found by the other Balmorel modes policies Allows modelling of various policies such as capacity targets for certain technologies or maximum energy related climate emissions REShareE Allows specification of a renewable energy share in electricity consumption within a country or group of countries REShareEH Allows specification of a renewable energy share in heat consumption within a country or group of countries TimeAggregation Reduces the amount of time slices without loosing representation of chronologically ordered time sequences unitcommitment Includes unit commitment variables and enables detailed modelling of thermal power plant cycling costs x3v Allows a piecewise step function for the price-quantity relationship for electricity exchange with third countries section gives insights in the different applications and user groups.

Research fields
Balmorel has for the last 16 years been applied for exploratory energy scenarios and policy analyses for different scenario horizons up to 2060. The focus varies from assessing the feasibility and role of specific technical components in the system (e.g., biogas upgrading, heat storage options, transmission lines) to assessing the interactions of power, heat, gas and transport sector. Table 3 summarises peer reviewed publications grouped into main fields of research.
The common ground of all applications is the aspect of transformation of energy systems. Since growing shares of VRE sources like wind and solar intensively affect the structure of the whole energy system, this aspect is found in most of the studies. However, the focus of the analysis range from technical and private economic effects of heat pumps in a specific district heating area [17] to the assessment of cost optimal energy systems of several countries [18,19]. Technology interaction of wind and thermal power plants [20,21] as well as specific technologies like waste for energy generation [22,23], biogas upgrading [24], heat savings of buildings [25,26], household electricity savings [27] and internalisation of local health externalities [28] have all been in the focus of applications.
Along with changes in the energy systems due to, inter alia, climate change mitigation ambitions, the research questions and thus the Balmorel applications have developed. The focus on the provision of flexibility by electric mobility, electrification of heat sector [29], interconnecting thermal and hydropower regions [30] and demand management [31], have gained importance as well as the effects of sector coupling (power, heat, gas, transport, waste): Although the core model does not represent the gas and transport sectors [32e34], implemented a road transport addon [35e37], analysed the effects of electric vehicles [38,39], assessed the role of hydrogen in the system and [40] analysed the system linkages to the gas sector.
Most research questions require the combined optimisation of operation and investments, which is a strength of Balmorel. A more detailed assessment of dispatch may require unit commitment which is implemented as an addon. Strategic behaviour building on top of Balmorel was on the other hand analysed in Ref. [41].
Effects of emission certificates [42], comparison of emission market and certificates [43] as well as assessments of different support schemes and taxes for district heating [44] are examples for Balmorel applications to assess regulatory aspects of energy systems.

Worldwide applications
Academia (Table 3) has not been the only driver of Balmorel utilisation and development. EA Energy Analyses [49] has been a key actor, and also other consulting companies such as COWI [50], and other companies or organisations such as HOFOR [51], Danish Energy Association [52], Estonian Transmission System Operator Elering [53, p.27], and government institutions such as the Mexican Energy Ministry [54], have carried out a multitude of energy system scenarios, energy policy analyses and feasibility studies of various technologies in diverse geographical contexts. Some of the companies/organisations mentioned above utilise Balmorel continuously for various analyses which are not publicly listed, but EA Energy Analyses provides a comprehensive overview of Balmorel applications [55]. The Balmorel model is also extensively utilised in education. To our knowledge, at least 10 PhD and 27 master/ diploma students of different countries completed their theses having applied Balmorel to approach specific questions on energy system transformation [56]. In 2017, there are 12 ongoing PhD and one ongoing master project employing Balmorel. A list of these, which gives an overview of the topics, but does not claim to be complete, can be found in the supplementary material of this article.

Strengths
In the light of an increasing demand for open and transparent energy system models [57e60], a major advantage of Balmorel is that the model code is open source. Balmorel is widely used, well tested, its core has over many years proved to be robust and suitable to adaptations. The model has been applied to a wide range of energy system studies, and for analysing various types of energy systems throughout the world. As a result, the model is continuously extended and improved, and new model developments are continuously shared.
The structure of the Balmorel model is transparent and the geographical and temporal scope is flexible. The resulting advantage is that, the temporal resolution could span from very detailed simulations with several time steps per hour, to long-term scenarios with a few time steps per week or less. Furthermore, it can Table 3 Fields of research of peer reviewed publications based on Balmorel.
The different running modes of Balmorel enable optimisation of short-term operation, as well as long-term investment planning in power, heat and interconnector capacities for one or several Areas and Regions.
The bottom-up representation of the supply side makes it suitable for analyses of energy markets consisting of various production and storage technologies. Furthermore, it allows for modelling of elastic electricity and heat demand, which is not commonly covered in energy system models.
The possibility for a high resolution in time and space enables it to capture the multiple time series of a power system. While a common simplification in energy system models is the use of nonconsecutive time segments or representative hours and load duration curves, Balmorel by default uses chronological time, or consecutive time steps. This enables more realistic modelling of VRE, hydro reservoir dynamics and other long-and short-term storage.
The regionalisation and model structure is well adapted for analysing integrated liberalised energy markets. Balmorel is one of few models with a detailed representation of district heating and the interaction between heat and power market.

Limitations
First, the Balmorel model is a deterministic energy system model, and it assumes perfect foresight. The model as such does not represent behaviours which are characterised by stochastic properties such as e.g. generation from variable renewable energy or forced outage of dispatchable generation units. The stochastic nature of the production, consumption and environment are modelled by exogenous time series. The model does not capture imperfect predictability issues related to, for example, hydro power inflow or wind forecasts. Also uncertainties of a non-stochastic nature, such as political decisions on energy and environmental systems, are presently outside the realm of the model. Second, several electricity transmission and district heating grid related issues are not handled in Balmorel. Examples for the electricity system are e.g., voltage and angle stability, and reserve management (primary and secondary). For district heating, distribution network examples are time delays and temperature levels.
Third, the energy producers are assumed to behave as price takers without any strategic market behaviour. In markets where the clearing conditions differ significantly from those under perfect competition, the Balmorel model structure is less suited although it has been utilised to model imperfect competition [41]. While assuming perfect competition may be questionable for a specific market it does rest on a heavy tradition and it leads to transparent modelling.

Potential future development
Coupling with the transport and the gas sector [61] is handled in specific projects but should be included in a more permanent way. The same applies to a refined presentation of flexibility characteristics (e.g., ramping constraints) and options. Decomposition of demand is crucial to improve the modelling of demand side management.
Availability and price of resources are exogenously defined in Balmorel. However, some resources are scattered over large areas, and they can be transported at a cost, in order to maximise the value from its use. This is the case for biomass and waste resources, which are becoming increasingly important in renewable energy systems. In order to determine future perspectives for renewable gasses, taken into account availability and transportation costs of bioenergy resources, Balmorel has been linked with the generalised network optimisation model OptiFlow [62]. The abstract nature of a generalised network model enhanced the extensibility of the core Balmorel model significantly. Currently, OptiFlow is being further developed to represent generation of renewable gases and bio refineries.
Concerning electricity transmission, efforts are made to enhance possibilities by implementing an addon with a flow-based representation of the network. The currently existing technical solution of the Balmorel flow-based addon corresponds to the flow-based market coupling principle described by the Nordic TSOs in Ref. [63] and utilised in Central Western Europe [64]. Current efforts are directed at designing an input data derivation methodology according to publicly available data sets.
The effect of parametric uncertainty has already been evaluated by applying Monte Carlo analysis with latin hypercube sampling. A global sensitivity analysis was also employed in Balmorel using the Morris screening methodology [11]. In the future, a framework for conducting sensitivity and uncertainty analysis will be embedded in the Balmorel model, in order to ensure robust results from a common statistical evaluation.
There is often a trade-off between level of spatial, temporal and technological detail; expansion of the model by the inclusion of functionality and running time. These issues may result in structural uncertainties, which could impact the sensitivity of the model runs. Current efforts on speeding up the model, such as aggregation of time and of space, solver tuning and decomposition for parallel computing might allow to increase the level of detail and functionalities of the model without entailing a computational burden. Depending on the aggregation level, the functionalities chosen and whether the variables are to be counted by the thousands or by the millions, the model can take from minutes to days to solve using a state of the art solver.
With the objective to increase transparency, the Balmorel community plans to improve the coordination of input data collection and documentation including updating from public databases. If successful, in the medium-term, input data sets can also be made openly available, achieving full transparency of model results. Due to the lack of open licenses [65] of original data, publishing input data is a general challenge to open energy model applications.
For lowering entry barriers, the development of an additional user interface as well as online courses for new users are planned.

Challenges of the open source character
Balmorel began at a time when version control was not common and code hosting platforms like GitHub and Bitbucket did not exist. Since there was no central organisation and no obligation to return developments by users to the original author, different model versions exist in different institutions today. Even if further developments are returned to the author, the challenge of adapting it to the common structure remains. The original 1999e2000 development had funding. Since there has been no basic funding focused on maintaining the model code, Balmorel has been evolving with application type project funding since 2001.
The need for user-specific modifications invariably implies a proliferation of different ad hoc versions. This in turn implies a challenge to having a well tested and documented common multiuser version of the model.
Thanks to the long-lasting commitment of the original project manager and main author Hans Ravn to further develop and publish a generally accessible version of Balmorel, the model is nevertheless maintained and improvements from various contributors are included. The high number of users is an advantage for finding bugs, inconsistencies and checking applicability, but managing this is time-consuming and can only be realised if it is well organised.
This also led to different forks of the model existing in parallel. There are ongoing efforts to increase and structure the collaborative development of Balmorel by different research institutions and make them directly comparable in different branches. The model continues to be used by the individual institutions while most will gradually shift to a common version, with new branches being integrated when reviewed. Insights from closed fork developments are derived by model run comparisons.
The process of defining coding guidelines, naming conventions and standards for addon structure are ongoing. This in combination with a growing community and the utilisation of respective tools that enable version control, review process and issue tracking will facilitate an open collaborative future of Balmorel.

Conclusion
This paper presents Balmorel, which is a flexible open source energy system model. Balmorel has been used by researchers, consultants, public agencies and TSOs since 2001. Its open source character has been a precondition for the widespread use it has today. The number of open source energy system models increases steadily, but the generic and flexible structure makes Balmorel a useful tool, suitable for continuous development required along with the challenges of the ongoing energy transition. It has been widely used to analyse integration of variable renewable energy in the energy system since its offset and has already been applied in a variety of other energy systems than the Baltic, for which it was originally developed. The main strengths of the model when contributing to analyses of future energy challenges is that it is flexible both in terms of aggregation of time and space and also in terms of representation of technologies and policy measures. In the future the main challenges will be to ensure continued good coordination of the joint community development of the model as well as facilitating increased transparency, accessibility and widespread use of the model in other parts of the world where optimisation of energy systems with detailed time series becomes increasingly important.