Full text
The Future Energy Market Model (FEM): A Mathematical Description David Holmer∗1,2 and Ali Darudi1,3 1ZHAW School of Management and Law, Center for Energy and Environment, Gertrudstrasse 8, 8400 Winterthur, Switzerland 2 University of Basel, Faculty of Business and Economics, Peter Merian-Weg 6, 4002 Basel, Switzerland 3ETHZ, Energy Science Center (ESC), Sonneggstrasse 28, SOI C 1, 8006 Z¨urich, Switzerland November 18, 2025 Model version: 1.0.0 Abstract This document provides a comprehensive mathematical formulation of the Future Energy Market (FEM) model, a multi-period, multi-scenario energy system optimization model for coupled electricity and district heating systems. The model is formulated as a linear program that minimizes total system costs including investment and operational expenditures, while ensuring energy balance, technical constraints, fuel limitations, etc. The model incorporates detailed representations of generation technologies including renewables, conventional thermal plants, and combined heat and power; storage systems such as batteries, pumped hydro, heat storages, fossil methane and hydrogen; demand-side flexibility from electric vehicles, heat pumps, and demand-side response; as well as transmission networks. This documentation focuses on the essential mathematical structure and is designed to be accessible to energy system modelers and researchers. Contents 1 Introduction 4 1.1 Overview ........................................ 4 1.2 Model Scope and Applications ............................ 4 1.3 Model History and Development ........................... 4 1.4 License .......................................... 4 1.5 Software Availability .................................. 4 1.6 Model Data and Approach ............................... 5 2 Mathematical Formulation 5 2.1 Model Structure and Notation ............................ 5 2.1.1 Notation Convention .............................. 5 2.1.2 Stochastic Programming Structure ...................... 5 2.2 Set Definitions ..................................... 5 ∗Corresponding author: [email protected] 1
FEM Model Description 2 2.3 Parameters ....................................... 6 2.4 Decision Variables ................................... 8 2.5 Objective Function ................................... 9 2.5.1 Electricity Side Investment Costs ....................... 9 2.5.2 Electricity Side Operation Costs ....................... 10 2.5.3 Lost Load Costs ................................ 10 2.5.4 Slack Costs (disabled by default) ....................... 10 2.5.5 District Heating Investment Costs ...................... 10 2.5.6 District Heating Operation Costs ....................... 10 2.5.7 Fuel Storage Investment Costs ........................ 10 2.5.8 Thermal Curtailment Penalty ......................... 10 2.6 Energy Balance Constraints .............................. 11 2.6.1 Electricity Energy Balance .......................... 11 2.6.2 District Heating Energy Balance ....................... 11 2.6.3 Storage Balance Constraints .......................... 11 2.6.4 Generation and Capacity Constraints .................... 11 2.7 Investment Limit Constraints ............................. 12 2.7.1 Generation Capacity Investment Limits ................... 12 2.7.2 Energy Capacity Investment Limits ..................... 12 2.7.3 Thermal Generation Capacity Investment Limits .............. 12 2.7.4 Thermal Energy Capacity Investment Limits ................ 13 2.8 Energy Production Limit Constraints ........................ 13 2.8.1 Total Energy Production Limit ........................ 13 2.8.2 Storage Fuel Limit ............................... 13 2.9 Transmission Line Constraints ............................. 13 2.10 Lost Load Constraints ................................. 13 2.11 District Heating Technology Constraints ....................... 13 2.11.1 Resistive Heater ................................ 13 2.11.2 Heat Pump (District Heating) ........................ 13 2.11.3 Combined Heat and Power (CHP) ...................... 13 2.12 Fuel Tracking and Limitation Constraints ...................... 14 2.12.1 Fuel Consumption Tracking (Electric Plants) ................ 14 2.12.2 Fuel Consumption Tracking (DH Plants) .................. 14 2.12.3 Total Fuel Consumption ............................ 14 2.12.4 Annual Fuel Limit ............................... 14 2.12.5 Fuel Storage Investment Limit ........................ 14 2.13 Demand Side Response (DSR) Constraints ...................... 14 2.13.1 Daily Energy Shift Limit ........................... 14 2.13.2 Daily Energy Balance ............................. 15 2.14 Electric Vehicle (EV) Constraints ........................... 15 2.14.1 Weekly EV Energy Consumption ....................... 15 2.14.2 Hourly EV Charging Rate ........................... 15 2.15 Vehicle-to-Grid (V2G) Constraints .......................... 15 2.15.1 V2G Charging Rate .............................. 15 2.15.2 V2G Discharging Rate ............................. 15 2.16 Building Heat Pump Flexibility Constraints ..................... 15 2.16.1 Building Thermal Storage Balance ...................... 15 2.16.2 Thermal Storage Limits ............................ 15 2.16.3 Weekly Average Temperature ......................... 16 2.16.4 Maximum Heating Capacity .......................... 16 2.17 District Heating DSR Constraints ........................... 16
FEM Model Description 3 2.17.1 Thermal Energy Deviation Tracking ..................... 16 2.17.2 Deviation Limits ................................ 16 2.17.3 Weekly Start/End Conditions ......................... 16 2.17.4 Weekly Average Temperature ......................... 16 2.17.5 Inflexible Demand Share ............................ 16 2.18 Additional Technology-Specific Constraints ..................... 17 2.18.1 PTES Storage-to-Charge Ratio Constraint .................. 17 2.18.2 DH Pump Capacity Constraint ........................ 17 2.18.3 RES Generation Fixing Constraint ...................... 17 3 Model Characteristics 17 3.1 Model Type ....................................... 17 3.2 Temporal Resolution .................................. 17 3.3 Spatial Coverage .................................... 17 3.4 Technology Coverage .................................. 18 4 Conclusion 18 5 Acknowledgments 18
FEM Model Description 4 1 Introduction 1.1 Overview This document describes a multi-period, multi-scenario energy system optimization model for electricity and district heating systems. The model minimizes total system costs (investment and operation) while ensuring energy balance, technical constraints, and fuel limitations. 1.2 Model Scope and Applications The FEM model is designed to analyze long-term energy system planning questions, including: •Optimal investment in generation and storage capacity •Integration of variable renewable energy sources •Coupling of electricity and district heating sectors •Role of flexibility options (storage, demand-side response, sector coupling) •Multi-scenario robust planning under uncertainty •Sensitivity analysis of transmission capacity assumptions •Impact of fuel availability constraints 1.3 Model History and Development The FEM model builds on the Swissmod electricity market model [ 6 ]. A previous version of the FEM model focused primarily on the electricity sector [ 2 ]. The current version has been enhanced with the addition of the district heating sector, various sector coupling technologies, and additional flexibility options. 1.4 License The FEM model is open-source software licensed under the GNU General Public License v3.0 (GNU GPLv3). This allows users to freely use, modify, and distribute the model, provided that any derivative works are also licensed under the same terms. For more details, see https: //www.gnu.org/licenses/gpl-3.0.html. 1.5 Software Availability This document describes features and assumptions of the FEM model corresponding to the public release v1.0.0 of the software. The code for the model is publicly available at the following locations: •Release (v1.0.0): https://github.com/DerDavidZHAW/FEM_public/tree/v1.0.0 • General repository (main): https://github.com/DerDavidZHAW/FEM_public/tree/main Users should cite the specific release tag (v1.0.0) when referencing the model implementation described in this document. How to Cite If you use this model or its description, please cite as follows: Holmer, D., & Darudi, A. (2025). The Future Energy Market Model (FEM): A Mathematical Description (v1.0.0). Zenodo. https://doi.org/10.5281/zenodo.17722336
FEM Model Description 5 1.6 Model Data and Approach The FEM model operates mainly with data from the Ten-Year Network Development Plan 2022 (TYNDP22) [ 3 ] for European electricity system characteristics and the Swiss Energy Perspectives 2050+ [7] for Switzerland-specific energy system data. The model can be configured for target years 2035 and 2050, which determines the installed capacities of various technologies, demand levels, and other system characteristics. For weatherdependent inputs (renewable generation profiles, temperature-dependent demands), the model uses historical weather data from the years 1995, 2008, and 2009, which can be used to represent different climate conditions and variability. The FEM model employs different modeling approaches for the electricity and district heating sectors: • Electricity sector (brownfield): The model includes existing generation capacity as fixed infeed (represented by Tinf ) that is available without requiring investment decisions. Additional capacity can be invested in through the optimization. • District heating sector (greenfield): Most of the thermal generation and storage capacity must be determined through investment decisions by the optimization model, representing a complete system build-out. 2 Mathematical Formulation 2.1 Model Structure and Notation 2.1.1 Notation Convention For clarity and readability, this document uses simplified mathematical notation. When constraints are defined for a specific node n (or week w , day d , etc.), summations over plants or transmission lines are implicitly restricted to those located at or connected to that node. For example, Pp∈Pgen gp,t,s in the energy balance constraint for node n represents the sum over all generating plants at node n . The full implementation includes explicit spatial and temporal mapping sets, but these are omitted here to focus on the essential model structure. 2.1.2 Stochastic Programming Structure This model follows a two-stage stochastic programming framework: • First-stage decisions (here-and-now): Investment variables ( gp , ep , chp , gDH p , eDH p , chDH p , efuel f ) are made before uncertainty is revealed and are therefore independent of scenarios. These represent strategic capacity expansion decisions. • Second-stage decisions (wait-and-see): Operational variables ( gp,t,s , chp,t,s , socp,t,s , etc.) are indexed by scenario s and represent operational decisions made after observing the realized scenario (demand, renewable availability, fuel prices, etc.). Note on implementation: In the Python/Pyomo implementation, investment variables are technically indexed by scenario, but explicit constraints enforce their equality across all scenarios. This mathematical description adopts the more intuitive scenario-independent notation to emphasize their role as first-stage decisions in the stochastic program. 2.2 Set Definitions
FEM Model Description 6 Set Description TTime steps (hours) in the model DDays in the model WWeeks in the model NElectricity nodes (regions) NDH District heating nodes LTransmission lines (NTC interconnections) Limp Transmission lines for import to a node Lexp Transmission lines for export from a node PAll plants (including DH plants connected to electric grid) Pgen Plants that can generate electricity Pstorage Storage plants (batteries, pumped hydro, etc.) Pstorage,noSOC Liquid fuel storage plants (no state-of-charge dynamics) Ppump Plants that can pump/charge (not only hydro anymore) Pequal Storage plants with equal charge/discharge capacity Pv2g Vehicle-to-grid capable EVs (one aggregated V2G plant representing all V2G capacity) Pdsr Demand-side response assets (one plant per node representing all DSR at that node) PRES Renewable energy source plants Pinv Plants that can be invested in Pfuel,lim Plants with limited fuel availability in CH Penergymax Plants with energy capacity limits Penergylim Plants with total energy production limits PDH District heating plants PDH,storage DH storage plants (same as PDH,T ES) PDH,res Resistive heating plants PDH,hp Heat pump plants (DH) PDH,T ES Thermal energy storage plants PDH,CHP CHP plants in district heating PDH,dsr Demand-side response in DH (one plant per DH node representing all thermal DSR at that node) PDH,fuel lim DH plants with fuel limits PDH,inv DH plants that can be invested in PDH,cost,th DH plants with costs on thermal side only Tinf Infeed technologies (existing capacity without investment requirements) Tdemand,inflex Inflexible demand technologies Flim Fuels with limited availability BA Building archetypes Mfuel pMapping: Fuel type of plant p Mt dMapping: Set of time steps in day d Mt wMapping: Set of time steps in week w Mw tMapping: Week corresponding to time step t SScenarios LL Lost load cost steps 2.3 Parameters
FEM Model Description 7 Parameter Description cop,slp p,s Operation cost slope for plant p in scenario s [CHF/MWh] cop,qdr p,s Operation cost quadratic coefficient for plant p in scenario s[CHF/MWh2] cinv,gen p Investment cost for generation capacity for plant p [CHF/MW] cinv,e p Investment cost for energy capacity for plant p [CHF/MWh] cinv,discharge p Investment cost for discharge capacity for plant p [CHF/MW] cinv,fuel fInvestment cost for fuel fstorage [CHF/MWh] clostload k,s Cost of lost load for cost step k∈ LL in scenario s [CHF/MWh] wsWeight of scenario sin objective function [-] Dn,tech,t,s Demand of node n for technology tech at time t in scenario s[MWh] DDH n,t,s District heating demand at node n at time t in scenario s[MWh] In,tech,t,s Infeed from technology tech to node n at time t in scenario s[MWh] IKV A n,s Infeed from waste incineration at DH node n in scenario s[MWh] ηin p,s Charging efficiency of storage plant pin scenario s[-] ηout p,s Discharging efficiency of storage plant p in scenario s [-] ηgen p,s Generation efficiency of plant p in scenario s for fuel tracking [-] ηDH p,s Efficiency of DH plant p in scenario s (resistive, heat pump) [-] ρCHP p,s Power-to-heat ratio of CHP plant pin scenario s[-] SOCinit p,s Initial state of charge for storage plant p in scenario s [-] δTES pDecay rate for thermal energy storage plant p[-] Ap,t,s Availability factor of plant p at time t in scenario s [-] Fin p,t,s Inflow to storage plant p at time t in scenario s [MWh] Fout p,t,s Outflow from storage plant p at time t in scenario s [MWh] Gp Maximum generation capacity limit for plant p [MW] EpMaximum energy capacity limit for plant p[MWh] GDH p Maximum thermal generation capacity limit for plant p[MWth] EDH p Maximum thermal energy capacity limit for plant p [MWhth] Etotal p,s Total energy production limit for plant p in scenario s [MWh] LLk,s Lost load capacity for cost step k∈ LL in scenario s [MWh]
FEM Model Description 8 Parameter Description DSRDH p,s Maximum deviation for demand-side response for DH DSR at node/region p∈ PDH,dsr in scenario s [MWh th ] NTCexp l,t,s Export limit on line lat time tin scenario s[MWh] NTCimp l,t,s Import limit on line lat time tin scenario s[MWh] Fimport f,s Annual fuel import capacity for fuel f in scenario s [MWh] Fprod,CH f,s Annual fuel production capacity in CH for fuel f in scenario s[MWh] Fstorage,inv f,s Maximum fuel storage investment capacity for fuel f in scenario s[MWh] PEV,charge t,s EV charging power rate at time tin scenario s[MW] EEV w,s Weekly EV electricity consumption for week w in scenario s[MWh] PV2G,charge p,t,s V2G charging power rate at time t in scenario s [MW] EV2G p,s V2G battery capacity in scenario s[MWh] Qba,t,s Thermal consumption of building archetype ba at time tin scenario s[MWhth] COPba,t,s Coefficient of performance of heat pump for building archetype ba at time tin scenario s[-] Qba,s Maximum heating capacity for building archetype ba in scenario s[MW] TH+ ba,s Positive thermal storage limit for building archetype ba in scenario s[MWhth] TH− ba,s Negative thermal storage limit for building archetype ba in scenario s[MWhth] rstorage/charge Storage to charge ratio for PTES (e.g., 168 hours) [-] αflex Share of households that heat flexibly [-] βshift dsr Daily energy shift limit factor for DSR [-] 2.4 Decision Variables Variable Description gp,t,s Generation (discharge) from plant p at time t in scenario s[MWh] socp,t,s State of charge of storage plant p at time t in scenario s[MWh] chp,t,s Charging (pumping) of storage plant p at time t in scenario s[MWh] LLn,t,k,s Lost load for node n at time t for cost step k∈ LL in scenario s[MWh] curtn,t,s Curtailment of RES at node n at time t in scenario s [MWh] spillp,t,s Spilled water from hydro plant p at time t in scenario s[MWh] Exl,t,s Export on transmission line l at time t in scenario s (+ export, - import) [MWh]
FEM Model Description 9 Variable Description gDH p,t,s Thermal generation from DH plant p at time t in scenario s[MWhth] chDH p,t,s Thermal charging of DH storage plant p at time t in scenario s[MWhth] socDH p,t,s Thermal state of charge of TES plant p at time t in scenario s[MWhth] curtDH n,t,s Thermal curtailment at DH node n at time t in scenario s[MWhth] devDSR,DH p,t,s Thermal energy deviation for DH DSR at node/region p∈ PDH,dsr at time tin scenario s[MWhth] gpInvested generation capacity for plant p[MW] chp Invested pumping/charging capacity for plant p [MW] epInvested energy storage capacity for plant p[MWh] gDH p Invested thermal generation capacity for plant p [MWth] chDH p Invested thermal pumping capacity for plant p [MW th ] eDH p Invested thermal energy capacity for plant p [MWh th ] efuel fInvested fuel storage capacity for fuel f[MWh] FCplant p,t,s Fuel consumption of plant p at time t in scenario s [MWhfuel] FCfuel f,t,s Total fuel consumption of fuel type f at time t in scenario s[MWhfuel] thba,t,s Thermal storage level of building archetype ba at time tin scenario s[MWhth] slackSOC,+ p,t,s Positive slack for SOC constraint for plant p at time t in scenario s[MWh] slackSOC,− p,t,s Negative slack for SOC constraint for plant p at time tin scenario s[MWh] 2.5 Objective Function The model minimizes the total system costs across all scenarios: min Cinv,el +Cinv,DH +Cinv,fuel +X s∈S Cop,el s+Clostload s+Cslack s+Cop,DH s+Ccurt,DH,penalty (1) where the cost components are defined as follows: 2.5.1 Electricity Side Investment Costs Cinv,el =X p∈Pinv cinv,gen p·gp+cinv,gen p 106·g2 p! +X p∈Penergymax∩Pinv cinv,e p·ep +X p∈Pv2g cinv,discharge p·chp(2)
FEM Model Description 16 2.16.3 Weekly Average Temperature For each building archetype ba ∈ BA, week w∈ W, scenario s∈ S: X t∈Mt w thba,t,s = 0 (46) 2.16.4 Maximum Heating Capacity For each building archetype ba ∈ BA, time t∈ T , scenario s∈ S: chba,t,s ≤Qba,s (47) 2.17 District Heating DSR Constraints Note: Each element p∈ PDH,dsr represents one aggregated DSR plant per DH node, capturing all thermal demand-side response capacity at that node. 2.17.1 Thermal Energy Deviation Tracking For p∈ PDH,dsr, time t∈ T , scenario s∈ S: devDSR,DH p,t,s =X t′∈Mt Mw t:t′≤tchDH p,t′,s −gDH p,t′,s(48) where Mw tgives the week of time step t. 2.17.2 Deviation Limits For p∈ PDH,dsr, time t∈ T , scenario s∈ S: −DSRDH p,s ≤devDSR,DH p,t,s ≤DSRDH p,s (49) 2.17.3 Weekly Start/End Conditions For p∈ PDH,dsr, week w∈ W, scenario s∈ S: devDSR,DH p,tfirst(w),s = 0 (50) devDSR,DH p,tlast(w),s = 0 (51) 2.17.4 Weekly Average Temperature For p∈ PDH,dsr, week w∈ W, scenario s∈ S: X t∈Mt w devDSR,DH p,t,s = 0 (52) 2.17.5 Inflexible Demand Share For each DH node n∈ N DH, time t∈ T , scenario s∈ S: X p∈PDH \PDH,dsr gDH p,t,s ≥(1 −αflex)·DDH n,t,s (53) This ensures a minimum share of demand is met inflexibly because a certain amount of consumption is expected to remain inflexible.
FEM Model Description 17 2.18 Additional Technology-Specific Constraints 2.18.1 PTES Storage-to-Charge Ratio Constraint For PTES (Pit Thermal Energy Storage) plants p∈ PDH,TES with tech type ”PTES”: eDH p≥24 ·rstorage/charge ·gDH p(54) This enforces that PTES takes approximately at least one week (168 hours) to fill at full capacity. 2.18.2 DH Pump Capacity Constraint For PTES and TTES plants p∈ {PTES, TTES}: chDH p≤gDH p(55) As only the generation has allocated costs, the charging capacity is expected to be set equal to the generation capacity by the model. 2.18.3 RES Generation Fixing Constraint For new RES investment plants p∈ Pinv ∩ PRES: gp,t,s =Ap,t,s ·gp(56) This forces RES plants to generate at maximum available capacity. 3 Model Characteristics 3.1 Model Type This is a linear program (LP). The model is implemented in Python using the Pyomo optimization modeling framework [1,5] and solved using Gurobi [4]. The model uses: •Continuous variables for generation, storage, and flows •Quadratic terms in the objective function (can be linearized) •Multi-period optimization with hourly resolution •Multi-scenario stochastic optimization with scenario weights 3.2 Temporal Resolution •Hourly time steps (t∈ T ) •Weekly aggregation for certain constraints (EV, heat pumps, DSR) •Daily aggregation for DSR balance •Annual limits for fuel consumption 3.3 Spatial Coverage •Multiple electricity nodes (European countries/regions) •Transmission lines with NTC limits •District heating nodes (city-level) •No explicit network modeling (DC power flow not included)
FEM Model Description 18 3.4 Technology Coverage Electricity: Hydro (reservoir, run-of-river, pumped storage), conventional (coal, gas, nuclear, oil), renewables (PV, wind onshore/offshore), batteries, hydrogen storage, EVs (V1G, V2G), demand-side response District Heating: CHP plants, heat pumps, resistive heaters, thermal energy storage (PTES, TTES), biomass boilers, building thermal mass flexibility 4 Conclusion This document provides a comprehensive mathematical description of the Future Energy Market (FEM) model. The formulation balances model complexity with computational tractability, enabling detailed analysis of future energy systems while maintaining reasonable solution times. The simplified notation employed in this document focuses on the essential mathematical structure, making the model accessible to researchers and practitioners in energy system modeling. 5 Acknowledgments Data and Expertise: We thank the competence centre ”HSLU - CC Thermal Energy Storage” for providing the expertise and heat data that enabled the implementation of the district heating sector in the FEM model (see [8]). To clarify, the provided heat data includes: •heat demand time series (households and district heating), •flexibility potentials (households and district heating), and •heat potentials from natural resources. Funding: The authors wish to acknowledge funding by the Swiss Federal Office of Energy’s ”Energy-Economics-Society” programme as part of the STORSUPPORT project (grant number SI/502888). Within this grant, the FEM model was substantially further developed. References [1] Bynum, Michael L.; Hackebeil, Gabriel A.; Hart, William E.; Laird, Carl D.; Nicholson, Bethany L.; Siirola, John D.; Watson, Jean-Paul; Woodruff, David L. Pyomo–Optimization Modeling in Python. Third edition, Volume 67. Springer Science & Business Media, 2021. [2] Darudi, Ali. The Future Electricity Market Model - FEM: Model Description. EconStor Preprints 306396, ZBW - Leibniz Information Centre for Economics, 2024. [3] ENTSO-E & ENTSOG. Methodology for ∆NTC Calculations. March 2022. Available at: https://eepublicdownloads.blob.core.windows.net/public-cdn-container/ tyndp-documents/TYNDP2022/public/CBA-IG.pdf. [4] Gurobi Optimization, LLC. Gurobi Optimizer Reference Manual. 2024. Available at: https: //www.gurobi.com. [5] Hart, William E.; Watson, Jean-Paul; Woodruff, David L. Pyomo: Modeling and Solving Mathematical Programs in Python. Mathematical Programming Computation, 3(3):219–260, 2011. [6] Schlecht, Ingmar; Weigt, Hannes. Swissmod - A Model of the Swiss Electricity Market. June 6, 2014. Available at: https://ssrn.com/abstract=2446807.
FEM Model Description 19 [7] Swiss Federal Office of Energy. Energy Perspectives 2050+: Technical Report. 2022. Available at: https://www.bfe.admin.ch/bfe/de/home/politik/ energieperspektiven-2050-plus.html. [8] Schneeberger, Sarah; Meister, Curtis; Schuetz, Philipp. Estimating the heating energy demand of residential buildings in Switzerland using only public data. Energy and Buildings, Volume 347, Part B, 2025, 116371. ISSN 0378-7788. Available at: https://doi.org/10. 1016/j.enbuild.2025.116371.