Tutorial 1: Operational Multi-Node Example

This example analyzes the energy system of a hypothetical region (Utopia) which is divided into two locations: Utopia-north and Utopia-south.

The Reference Energy System of the northern region includes a natural gas extraction technology, two renewable power supply technologies (Wind and Hydro), and one conventional power plant (Combined Heat and Power) which converts the natural gas fuel to both heat and electricity. Moreover, two types of transmission (Electricity Transmission and Distribution and Gas Pipelines) are considered for transporting the electricity and gas to the demand side. The transmitted electricity is directly entered into the final electricity demand technology, while the transmitted gas is converted by gas boilers to heat which ultimately enters the final heat demand technology.

On the other hand, the Reference Energy System of the southern region consists of only two renewable power supply technologies (Geothermal and Solar). The produced electricity from these power plants is then delivered to the Final Electricity Demand technology after passing through the local Electricity Transmission and Distribution.

The two locations can do a bilateral electricity trade through the installed Cross Border Transmission Link.

1. Building the excel-based structural input (set) files:

Considering that there are two locations in the Utopia region, three excel files are required:

  • “global.xlsx”: indicating the technologies and carriers within the global (whole Utopia) energy system, the locations, the modelling years, and the time steps within each year
  • “reg1.xlsx”: indicating the Reference Energy System of the northern region
  • “reg2.xlsx”: indicating the Reference Energy System of the northern region
  • Note: The name of the excel files must be determined as above. It is not possible to include arbitrary file names

    1.1“global” excel file:

    As it is described in the building model documentation, the structural input excels consists of several tables for different sets of the model. The first table in the global file is “Regions” including the locations of the study and the name of each location as below:

    The second table is “Technologies_glob” which includes all the technologies within the Utopia regardless of the location, their name, and categories as shown below. Please note that the technology categories must be chosen from Supply, Conversion, Conversion_plus, Transmission, and Storage categories and can not be anything different from the mentioned names.

    After global technologies, global carriers must be indicated in the table “Carriers_glob”. In this table, all the carriers with their names and types must be included as below. The allowed carrier types are Resource, Intermediate, and Demand.

    Ultimately, the time horizon and temporal resolution of the model must be determined by “Years” and “Timesteps” tables respectively.

    Considering that in this case study, the temporal resolution is hourly (8760 hours within the year), we avoided bringing the full table in this tutorial. The “Timesteps” table must include the intra-year time slices, their names, and their length fraction compared to the whole year which is 1/8760 in this case.

    1.2 “reg1” excel file:

    The regional excel files consist of regional technologies, carriers, and the interconnections among them based on the Reference Energy System. The first table of regional files is named “Technologies” where the user must indicate all the technologies within the specific location (Utopia-north) as shown below:

    The second table is named “Carriers” which is dedicated to determining all the carriers within the Utopia-north.

    The connections among the technologies and carriers within the reference energy system are determined by “Carrier-input” and “Carrier_output” tables. In the former, the input carriers of the technologies, and in the latter, the output carriers of technologies are represented. Please note that the “Supply” technologies and “Demand” technologies should not be included in “Carrier-input” and “Carrier-output” tables respectively because the “Supply” category of technologies just provide energy carrier to the system without any conversion process and the “Demand” category just sinks and removes the demand energy carriers from the system.

    Carrier Input

    Carrier Output

    There are a few important things to note about the structural input files:

  • The name of the tables are fixed and cannot be chosen at will by the user. All the table names must be indicated as mentioned above. However, in case of any potential error, the Hypatia model delivers proper warnings to the user after reading the set files. The table names can be fixed in the excel files through the following path as shown in the following figure.
  • Formulas tab of the ribbon > Name Manager > Edit > Name

  • The name of the columns in each table must be exactly as the indicated names in this tutorial. There are also warning and exception errors for the possible mistakes in the column names.

  • If there are similar technologies in various regions, their names must be identical in different “reg” set files and therefore, only one name as the representative of that technology in all the regions must be included in the “Technologies_glob” in the “global” set file. For example, if there is a Hydropower plant in all the considered locations within the geographical coverage of the model, one single name such as “Hydro PP” must be considered in all the regional set files and this name should be brought only once in the “global” set file.
  • 2. Initializing the Hypatia model by reading the excel-based set files

    After specifying all the sets of the model, it is time to initialize the Hypatia model and read the structural input files.

    Importing the hypatia model
    Intializing the hypatia model by passing the optimization mode and the path of the structural input files (sets of the model)

    3. Creating the excel-based parameter files

    Now the model can create the parameter files with their default values through running the following commands.
    After running this command line, we are going to open the created parameter files and fill them with the model data.

    In this case, as we have a multi-node approach, it is expected to see the following files in the given path:

  • Two files for regional parameters named “parameters_reg1.xlsx” and “parameters_reg2.xlsx”
  • One file for global parameter and constraints named “parameters_global.xlsx”
  • One file for parameters related to the possible connections among the regions which is named “parameter_connections.xlsx”.
  • 4. Filling the parameter files with the input data

    Now it is time to insert the input data in their related parameter files.

    4.1 Regional parameter files:

    In this case study, we are focusing on the operational mode of the energy system. Therefore, the following sheets can be found in the excel files:

  • Specific fixed and variable operation and maintenance costs: These costs must be defined on an annual basis for each technology within each category. Different units can be considered for different technologies. In this case, the variable cost of all technologies is defined in USD/MWh except for Natural Gas Extraction variable cost which is based on USD/BOE (dollars per barrel of oil equivalent). All the fixed costs are assumed to be equal to zero as they are not going to affect the optimization process.
  • Fixed taxes and subsidies: Annual taxes and subsidies per unit fixed cost of a technology which are considered equal to zero in this case
  • Carbon tax: Apart from the above mentioned costs, carbon tax can be also defined in the Hypatia model for different fossil fuel based technologies. It must be indicated per unit of produced CO2-equivalent emissions from each technology. In this specific case, this parameter has been left with its defaukt value which is equal to zero.
  • Residual capacity: The total installed capacity of each technology before starting the modelling horizon. In the operational mode, the total capacity of technologies in the specific modelling year must be given exogenously and only the hourly dispatch of technologies are going to be optimized. The residual capacity sheet is exactly where the user must indicate the exogenous capacity of each technology within the energy system. Again, the unit of capacity can differ from one technology to another. In this case, all the units are based on MW except for the Natural Gas Extraction and Boiler which are based on the number of installed extraction units.
  • Max/Min production: These parameters are useful when the user aims to do scenario analysis and provide an upper and lower limit for the annual production of each technology. In this case, the Business as Usual (BAU) scenario is considered, and therefore, no limits are applied on the production.
  • Technology capacity factor: This parameter allows to consider the planned outages or operation and maintenance time of each technology. It is the average capacity of a plant divided by its nominal total capacity. In this case, it is assumed that the capacity factor of all the technologies is equal to 1.
  • Resource capacity factor: This parameter allows us to consider the availability of resources (especially for renewable technologies) in each time slice of the year. It is the max production of one unit capacity of each technology in each time slice based on the variable resource availability. In this case, the full 8760 hours of the modelling year has been considered, therefore, the resource capacity factors must be given in the time-series format. The values for the first 24 hours of the year are shown in the following. It is assumed that all the resources in Utopia-north are fully available except for the wind and hydro power plants. These parameter are taken from the renewable.ninja website (Renewables.Ninja, n.d.) for a hypothetical location in northern Europe.
  • Technology efficiency: The technical efficiency in the Hypatia model is basically the ratio between the output carrier to the input carrier of a conversion, conversion-plus or a transmission technology. Considering the fact that the units of the carrier production and carrier consumption of each technology can be different in this model, the technology efficiency (output/input activity ratio) can be higher or lower than one. In this case study, the input energy carrier of both CHP plant and boiler is natural gas in the unit of barrels of oil equivalent (BOE) and their output is either heat or electricity in MWh. The efficiency of these technologies is around 0.8 based on the IEA ETSAP dataset if the input and output activities hold the same unit. However, considering the converting ratio of MWh to BOE, it can be said that for each BOE natural gas, these technologies can provide around 1.3024 MWh output. Moreover, in this case, the efficiency of all the transmission technologies has been considered equal to 0.9 (assuming 10% within the links).
  • Specific emission: In the Hypatia model the GHG emissions in terms of CO2 equivalent values can be considered. In this case, 0.305 ton/boe of production has been considered for Natural Gas Extraction technology.
  • Annual emission limit: Allows to put an upper limit for thetotal annual emission of each region. This case study follows a BAU logic, therefore, no annual emission cap has been defined
  • Annual production per unit of capacity: The amounts of output activity per each unit of installed capacity of each technology in each year of the modelling horizon. In this case study, each unit of Natural Gas extraction is assumed to produce 1320000 BOE of natural gas, each boiler unit can produce 44 MWh and each MW capacity of the power generation and transmission technologies can produce 8760 MWh per year.
  • Demand: In this case, the time series demand for both final electricity demand and final heat demand has been given to the model for 8760 hours of the year. Only 24 hours of the data is shown in the following figure.
  • It should be noted that the data for the Utopia-south region can be inserted following the same instruction of Utopia-north parameter file. The data in “parameters_global.xlsx” are all based on the default values as no global scenarios are considered for this specific case study.

    4.2. “parameters-connections” file:

    The cross-border links have almost the same techno-economic parameters as the regional technologies including fixed and variable costs, residual capacity, capacity factor, efficiency, and annual production per each unit of capacity. In this case study, among all the possible connections for all the global carriers considered within Utopia, it is assumed that the northern and southern regions have only the bilateral trade of electricity. Therefore, the residual capacity of all the links for all the carriers except the electricity must be indicated equal to zero, and consequently, the user must be only concerned with the parameters that are related to this link and can leave the others with their default values. The capacity unit of the electricity cross-border link is based on MW in the case study.

    5. Reading the input data

    After filling out the parameter files, it is time to ask the model to read the input data following the below command line.

    6. Running the model

    Now we can run the model by giving the preferred solver, verbosity and the force_rewrite parameter which avoids overwriting the output results when it is equal to False and allows to overwrite them by taking a backuo from the previous results when it is equal to True.

    7. Exporting the raw results to csv files

    There is the possibility to export the raw results into the csv files by passing the arbitary folder path and force_rewrite parameter which avoids to overwrite the results when it is equal to False.

    8. Visualizing the raw results

    After solving the model, we can visualize the raw results by importing the plotting tool of the Hypatia model but before that, we need to ask the model to create the configuration excel file for indicating the desired information on technologies, fuels and regions.

    Now, it is the time to initiallize the plotter class by passing the model's name, the created config file for the plots and the hourly resolution boolean parameter. The latter is True when the model has a hourly stepwise resolution and False when the timesteps are not in a hourly basis.