Next Article in Journal
Robust Optimization for IRS-Assisted SAGIN Under Channel Uncertainty
Previous Article in Journal
Trustworthy Face Recognition as a Service: A Multi-Layered Approach for Mitigating Spoofing and Ensuring System Integrity
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

TwinP2G: A Software Application for Optimal Power-to-Gas Planning

by
Eugenia Skepetari
*,
Sotiris Pelekis
*,
Hercules Koutalidis
,
Alexandros Menelaos Tzortzis
,
Georgios Kormpakis
,
Christos Ntanos
and
Dimitris Askounis
Institute of Communication and Computer Systems, National Technical University of Athens, Patission 42, 10682 Athens, Greece
*
Authors to whom correspondence should be addressed.
Future Internet 2025, 17(10), 451; https://doi.org/10.3390/fi17100451
Submission received: 25 July 2025 / Revised: 23 September 2025 / Accepted: 26 September 2025 / Published: 30 September 2025

Abstract

This paper presents TwinP2G, a software application for optimal planning of investments in power-to-gas (PtG) systems. TwinP2G provides simulation and optimization services for the techno-economic analysis of user-customized energy networks. The core of TwinP2G is based on power flow simulation; however it supports energy sector coupling, including electricity, green hydrogen, natural gas, and synthetic methane. The framework provides a user-friendly user interface (UI) suitable for various user roles, including data scientists and energy experts, using visualizations and metrics on the assessed investments. An identity and access management mechanism also serves the security and authorization needs of the framework. Finally, TwinP2G revolutionizes the concept of data availability and data sharing by granting its users access to distributed energy datasets available in the EnerShare Data Space. These data are available to TwinP2G users for conducting their experiments and extracting useful insights on optimal PtG investments for the energy grid.

1. Introduction

Climate change represents one of the most urgent challenges in the global energy landscape. Actions like the Paris Agreement [1] and the REPowerEU Plan [2] have been undertaken by the European Union (EU) to address global warming, support decarbonization targets, and increase the utilization of renewable energy sources (RESs) and their energy mix penetration. In this context, energy storage systems play a crucial role in the energy transition, enabling effective RES integration into the power grid, ensuring system reliability, addressing the energy demand fluctuations, and reducing the imbalances between supply and demand.
Among these energy storage solutions, PtG technologies are increasingly recognized as a promising contributor to the energy transition. PtG is an energy conversion technology that captures excess renewable energy by transforming it into hydrogen via water electrolysis and storing the latter for future use [3,4]. This green hydrogen can then be used by hydrogen fuel cells (FCs) to generate electricity during peak demand periods [5,6,7], integrated into natural gas infrastructure [8,9,10,11], and processed further to produce synthetic natural gas (SNG), methanol, ammonia, or other sustainable fuels [6,12,13]. These applications not only enhance cross-sectoral integration but also reform the energy landscape, integrate different energy sectors, and contribute significantly to reducing greenhouse gas (GHG) emissions across various energy-intensive industries.
Recent work has emphasized the role of digital twins in energy systems [14] and advanced network-level optimization methods [15], underscoring the value of data-driven, model-based planning. Several studies have also proposed optimization models for PtG applications, while others have focused on simulation. For real-time simulation, eMEGASIM and RT-LAB are used, making them valuable for validating control strategies in power electronics and smart grids [16]. These tools provide high-fidelity simulations of power systems but are primarily designed for hardware-in-the-loop (HIL) testing rather than PtG investment optimization. Meanwhile, simulation-based energy system modeling is provided by Apros, which has been used to study PtG integration [9], while EnergyPro has been designed for the simulation and optimization of energy projects and was employed by research to examine PtG system efficiency [13]. In addition, MATLAB/Simulink is a widely used platform for dynamic system modeling and control design utilized in many PtG studies [6,7,11,17]; however as a general-utility platform, it does not include ready-to-use modules for PtG investment optimization and techno-economic analysis.
Despite these advances, a literature gap remains: there is no widely available, open-access platform that simultaneously (i) provides ready-to-use PtG components for modeling multi-carrier systems; (ii) performs integrated techno-economic optimization for investment planning,; (iii) integrates secure, real-world datasets for scenario analysis; and (iv) presents a user-friendly interface designed to serve various stakeholders. Table 1 summarizes representative tools highlighting how TwinP2G addresses this gap.
In this paper, we present TwinP2G, a software application for optimal PtG planning that provides simulation and optimization services for PtG [18]. Its initial architecture was first presented in [19]. TwinP2G provides a user-friendly platform for complex energy modeling, allowing users to model, simulate, and optimize various user-customized data-driven PtG integration scenarios involving hydrogen production, storage, and utilization in electrical and gas networks. It can leverage real data ingestion from EnerShare Data Space and deliver detailed techno-economic reporting concerning the energy network’s performance, such as the optimal energy generation and usage time series, transmission and storage; network metrics for each network component, such as CAPEX and OPEX; optimally installed PtG components’ capacities; and RES curtailment.
The main contributions of TwinP2G are described as follows:
  • Techno-economic analysis of PtG systems: Compared to generic tools such as MATLAB/Simulink, RT-LAB, eMEGASIM, EnergyPro, and Apros, TwinP2G offers simulation, optimization, and techno-economic analysis in multi-carrier energy systems. Specifically, TwinP2G provides ready-to-use components for electrolysis, fuel cells, methanation, and hydrogen storage, allowing direct techno-economic analysis of PtG integration into power and gas networks without requiring users to build these processes from scratch, thereby facilitating the evaluation of their economic and operational feasibility.
    Its optimization framework aims to minimize total system costs, respecting technical and operational constraints, offering a more tailored and investment-oriented approach than the aforementioned simulation platforms.
  • Open-source: Unlike prior studies and general-purpose tools such as MATLAB/Simulink, EnergyPro, and Apros, TwinP2G offers an open-access, Docker-based PtG simulation and optimization platform, which can model highly customizable PtG use case scenarios. This containerized approach ensures seamless development, scalability, and compatibility across different platforms, allowing its users to develop and use the software in an open-source environment efficiently.
  • User-friendly, multi-role user interface (UI): In contrast with previous tools such as MATLAB/Simulink, RT-LAB, eMEGASIM, and Apros, targeted primarily at developers, TwinP2G has a user-friendly UI, serving multiple user roles based on their expertise. This includes data scientists who are skilled in programming and modeling, energy engineers, and investors with limited programming skills, as well as researchers. Users can interact with TwinP2G and extract valuable results for their customized simulations through its easy-to-use interface, which provides a range of evaluation tools, including tables, charts, and graphs, to facilitate the evaluation and decision-making process.
  • Integration with Energy Data Spaces: TwinP2G is seamlessly integrated with Enershare Energy Data Space through International Data Space (IDS) connectors [20,21], enabling secure, standardized, and interoperable data exchange, enhancing collaboration across energy stakeholders, and supporting advanced analytics for optimizing PtG systems. In particular, TwinP2G provides automated and secure access to datasets from TSOs such as DESFA [22] and IPTO [23], minimizing manual collection or intermediate transactions, reducing inconsistencies, and enhancing the accuracy and reliability of the simulations. This allows users to perform optimizations on realistic, continuously updated energy data, a functionality not available in comparable frameworks.
The paper is structured as follows: Section 2 provides an overview of the software architecture and functionalities; Section 3 presents two illustrative examples demonstrating the interaction with TwinP2G; Section 4 discusses the impact of the software application; Section 5 presents the limitations of the tool; and finally Section 6 summarizes the paper.

2. Software Description

TwinP2G is an open-source, user-friendly software application that provides simulation and optimization services for data-driven, user-customized energy networks with energy sector coupling across electricity, green hydrogen, natural gas, and synthetic methane [18]. Its framework consists of several ready-to-use components of an integrated energy system: buses, generators, lines, energy loads, energy conversion units, and storage, allowing detailed modeling of multivariable interactions. It offers comprehensive techno-economic analysis of PtG investments, enabling stakeholders to evaluate the impact of various PtG integration scenarios on system performance, operational efficiency, and overall feasibility. The software is also fully integrated with the Enershare Data Space, offering access to energy datasets from TSOs such as DESFA and IPTO.

2.1. Software Architecture

TwinP2G has been developed using a variety of Python (v3.11.3) programming modules along with Docker [24] to facilitate the efficient deployment of the application. Its software architecture, as illustrated in Figure 1 consists of various subcomponents of state-of-the-art technology, serving multiple user roles, namely, researchers, data scientists, energy experts, and investors.
TwinP2G’s architecture (Figure 1) can be broken down into four pillars, as follows:

2.1.1. Identity and Access Management (Optional)

Identity and access management has been achieved via Keycloak [25], using OAuth 2.0 and OpenID Connect for secure authentication and authorization. Keycloak provides centralized user management, single sign-on (SSO), and integration with identity providers, ensuring robust security and seamless access control.

2.1.2. User Interface

TwinP2G’s user interface has been developed using Streamlit [26], an open-source Python-based framework for interactive web application development. It is responsible for (a) handling user inputs, (b) passing them to the backend to execute the simulation and optimization processes, and (c) visualizing the resulting outputs in an interactive and user-friendly way.
Its advantages include its easy-to-use interface with reactive and interactive components, seamless integration with Python libraries, and rapid prototyping capabilities. Moreover, Streamlit supports real-time data visualization and requires minimal front-end coding, thus being an efficient option for the development of data-driven applications’ UIs.

2.1.3. Simulation and Optimization

TwinP2G’s back-end is responsible for (a) fetching data from the TimescaleDB database; (b) simulating a user-customized network, (c) optimizing the energy network; and (d) storing simulation results in the database.
The energy network system is optimized for each simulation snapshot using PyPSA [27], a Python-based energy system modeling library, based on the power flow equation. In this framework, buses, which represent the nodes of the network, serve to enforce energy conservation across all components entering and leaving them. The electricity demand d n , t in each bus n must be met at each time t either by the generators and storage or by the flows f l , t from the branches l as in Equation (1). Variables are described in Table 2.
r g n , r , t + s e n , s , t + l a l , n , t f l , t = d n , t w t λ n , t
where
a l , n , t = 1 , if branch l ( line or link ) starts from bus n 1 , if branch l is a line and ends at n η l , t , if branch l is a link ( electrolysis , fuel cell , methanation ) and ends at n
The optimization seeks to minimize overall system costs based on user input parameters, comprising factors such as generation, transmission, and storage capital expenditures (CAPEX) as well as operational expenditures (OPEX), whilst respecting the network components’ constraints such as nominal power and nominal energy capacity as in Equation (2). RES curtailment (which is not a direct cost) is modeled as the difference between the potential and the actual RES production and occurs when it is more economically or technically efficient to waste the surplus power rather than store or use it, often due to a lack of demand, grid constraints, or the high cost of new PtG investments. Ultimately, the solver trades off these factors to determine the most cost-effective long-term plan for the energy system. Variables are described in Table 2:
min n , r c n , r g ¯ n , r + n , s c ^ n , s e ¯ n , s + l c l F l + t w t n , r o n , r , t g n , r , t + n , s o n , s , t e n , s , t

2.1.4. Data Sources and Enershare Data Space Integration

TwinP2G is integrated with the Enershare Data Space, as illustrated in Figure 2, through the Data Marketplace and the data acquisition process, in which data from DESFA [22], IPTO [23], as well as from TSOs, ENTSO-E [28], and ENTSO-G [29] are retrieved through Data Space connectors. Data from DESFA include natural gas flows at entry and exit points, natural gas grid topologies, and natural gas quality indicators, while data from IPTO include RES generation, electrical power demand, and electrical grid topologies. These data are supplied to the TwinP2G backend to run the desired simulations.
Integrating real-time data from multiple TSOs into the EnerShare Data Space has several practical challenges. These arise from heterogeneous data formats, as each TSO provides data in different formats (APIs, Excel), semantic interoperability, and data quality issues such as missing values. TwinP2G overcomes these challenges using standardized adapters, ontology-based semantic mapping, and automated validation routines, implemented in complex Dagster pipelines and diverse ingestion workflows. This ensures robust ingestion, harmonization, and reliable use of real-world TSO data.

2.1.5. Technologies

The main technologies employed to develop TwinP2G are the following:
  • Streamlit [26]: A Python framework used for developing the TwinP2G UI.
  • PyPSA [27]: The main module for energy system modeling, simulation, and optimization. PyPSA leverages Linopy [30], a built-in optimization framework that uses the Simplex algorithm, while the GNU linear programming kit (GLPK) [31] serves as the optimization solver, which is designed to solve large-scale linear programming (LP) and mixed-integer programming (MILP) problems. While commercial solvers may provide faster runtimes, GLPK offers an open-source, license-free alternative that ensures reproducibility across all environments.
  • PVLib [32]: A Python library for solar plant simulation that uses data from the Photovoltaic Geographical Information System (PVGIS) [33].
  • Data Space Connector [20]: The ENERSHARE architecture employs the TNO Security Gateway (TSG) connector [34] to enable secure data acquisition from the Data Space. Its security architecture prioritizes data sovereignty and trust, aligning with IDSA/GAIA-X principles. The connector integrates identity and policy enforcement mechanisms, provenance logging, NGSI-LD brokers, and data transformation/compliance services to strictly regulate data access and usage. To reduce latency, processing is pushed towards the edge, with transformations executed at connectors. Compliance with GDPR is ensured through consent and role-based models, audit logging, pseudonymization, and privacy-preserving approaches such as federated learning.
  • FastAPI [35]: Used to build the API endpoint to communicate with the DeepTSF forecasting tool [36], within a Dagster-based data pipeline for time series forecasting and TwinP2G API integration [37].

2.2. Software Functionalities

TwinP2G software functionalities are detailed in the following sections. The software is designed to serve three types of users: energy engineers or investors, data scientists, as well as researchers.

2.2.1. User Roles

TwinP2G can be used by energy engineers and investors who have expertise in the energy sector but have limited programming skills. These users can evaluate an investment through metrics and visualizations by accessing the Visualization Engine [38] via TwinP2G. Data scientists who have strong modeling and programming skills can directly use TwinP2G to simulate their own highly customized energy networks, inserting system parameters—such as costs, efficiency, and nominal power—for network components, including buses, generators, lines, loads, energy conversion units (links), and storage systems, and analyze the results. Lastly, researchers who want to extract data to conduct research and run experiments can access the Data Marketplace via TwinP2G to acquire real data from the EnerShare Data Space.

2.2.2. Simulation and Optimization

TwinP2G provides simulation and optimization functionalities for data-driven energy systems and PtG integration, focusing on the techno-economic analysis of investments. By minimizing total systems costs, including CAPEX and OPEX of network components, it offers detailed techno-economic analysis of system’s performance. This includes optimal time series for generation, energy conversion, and storage at each time snapshot, along with key evaluation metrics for assessed investment scenarios, including CAPEX, OPEX, RES curtailment, optimal installed capacities, dispatch, energy supply, and withdrawal of each component. Through this analysis, TwinP2G enables data-driven decision-making to support the efficient and sustainable deployment of PtG technologies.

2.2.3. Enershare Visualization Engine

Visualization Engine is an interactive platform designed for data visualization and analysis. TwinP2G users can access the Visualization Engine to create dynamic dashboards and charts based on the TwinP2G simulation results, providing valuable insights into various investment scenarios [38]. The platform supports real data exploration, enabling users to analyze key performance indicators, compare alternative configurations, and identify optimization opportunities. By turning complex simulation results into intuitive visualizations, the Visualization Engine enhances the decision-making process.

2.2.4. User Interface

TwinP2G offers a user-friendly interface designed to provide a smooth experience to users. It involves the following components:
  • Homepage: The main home page of TwinP2G, where users can access the TwinP2G platform, the EnerShare Visualization Engine, or the EnerShare Data Marketplace (Figure 3a).
  • Sign-in and Sign-up: Secure user identification, authentication, and account management (Figure 3b).
  • Customized simulations: Page for configuring and executing customized PtG simulations and visualizing simulation results (Figure 3c).
  • Simulation history: Page to review previous experiments’ simulation runs and their results (Figure 3d).
  • EnerShare Visualization Engine: An interactive tool for data visualization and analysis on TwinP2G experiments’ simulation results.
  • EnerShare Data Marketplace: Platform for energy-sharing transactions.

3. Results

In this section, two illustrative examples of how users can interact with TwinP2G are presented. These examples are illustrative only; however, the software can be adapted to more realistic configurations and handle larger and more diverse energy systems.
Data scientists can interact with the TwinP2G app, first by cloning the repository available in [18], configuring the environment variables, and running it via Docker. The application can then be accessed by navigating to localhost port 8501 (e.g., URL https://localhost:8501 (accessed on 19 September 2025)) (Figure 3a). After signing in as shown in Figure 3b, in the customized simulations page (illustrated in Figure 3c) they must create a unique use case name for their simulation scenario and start inserting system parameters as follows:
  • For buses, they should specify the number of network buses and their energy carrier type: AC, DC, natural gas, or hydrogen (Figure 4a).
  • For generators, they must be assigned to one of the network’s buses and one of the supported generator types: diesel, coal, natural gas, hydro, solar, or wind.
    Additionally, generator nominal power in MW must be specified, as well as capital and marginal production costs, in EUR/MW and EUR/MWh, respectively.
    If the generation type is wind or solar, users must insert their preferred RES generation data. They can select ‘pvlib’, which is used for PV plant simulation; upload their own data from their file system; or access data from the Data Space as in as shown in Figure 4b.
  • For transmission lines (if applicable), they must select the two buses that they want to connect and insert the lines’ characteristics (as in Figure 4c).
  • For loads, which represent the energy demand, users are prompted to select the desired load data time series. They have the option to upload their own data from their file system or use data from the Data Space (Figure 4d).
  • For links, which represent energy conversion between two buses (e.g., from electrical energy to hydrogen via electrolysis and vice versa via fuel cells or energy conversion from hydrogen to SNG via methanation), users have to select the energy conversion type along with its parameters as in Figure 4e.
  • For the energy storage, which represents the hydrogen storage system, users need to complete the hydrogen storage requirements as in Figure 4f.
After the desired energy system has been set up, users must click the ‘Submit’ button, as in Figure 4f, to run the simulation. Once the optimization is complete, simulation results such as optimal time series graph and network components’ metrics are visible in the TwinP2G UI, as shown in Figure 5a and Figure 5b, respectively.
Energy experts and investors can interact with the TwinP2G app by accessing TwinP2G and being redirected to the EnerShare Visualization Engine. They can access TwinP2G simulation results stored in the Data Space, create dashboards and charts, and use these insights to evaluate and make decisions about PtG investment scenarios as in Figure 5c.

4. Discussion

TwinP2G is an open-source, user-friendly software application developed for the simulation, optimization, and visualization of energy networks, offering comprehensive techno-economic analyses of user-customized, data-driven PtG integration scenarios into energy networks. It is tailor-made for wider energy sector stakeholders, including data scientists, energy system planners, investors, and researchers who are interested in PtG systems’ optimal integration into existing energy systems’ infrastructure, strategic planning, operational efficiency, as well as PtG systems’ investment feasibility and performance.
TwinP2G has been developed for and used in the EU Horizon project EnerShare as a solution for optimal, data-driven PtG planning, focusing on energy transition and decarbonization. It is seamlessly integrated with the Enershare Data Space through IDS connectors. This integration ensures secure, standardized, and interoperable data exchange and enables real-time data sharing among multiple energy stakeholders, assuring compliance with data governance regulations while enhancing transparency and accessibility. With this integration, TwinP2G accesses up-to-date datasets from various energy sources, such as transmission system operators for electricity and natural gas, enabling customized data-driven simulation scenarios that reflect real-world energy conditions. Consequently, TwinP2G is well suited for experimental validation within the EnergyGuard Testing and Experimentation Facility (TEF) project [39], which provides digital twins and hydrogen testing platforms for evaluating AI-based energy solutions.
The service has been used by organizations such as the National Technical University of Athens (NTUA) and DEPA Commercial to model, optimize, and analyze multiple PtG use case scenarios for various energy demand profiles, as described in [40]. A first energy system was simulated to evaluate PtG and fuel cell system integration in a solar/diesel power grid supplying a small community in Greece. Three scenarios were simulated using the TwinP2G app (v2.1.0), utilizing energy datasets from the Data Space: a baseline with no PtG and fuel cell integration and two PtG and fuel cell integration scenarios reflecting 2023 and 2030 costs. The results indicated that in the second scenario (PtG 2023), the solar plant production increased by 55%, significantly reducing RES curtailment from 38% to 3.5%, while total costs reduced by 2.78%. In the third scenario (PtG 2030), the solar plant production increased by 57%, reducing RES curtailment from 38% to 2.2%, while the optimal installed capacities of the PtG and fuel cell systems increased compared to the second scenario, driven by projected cost reductions. A second type of TwinP2G implementation was the investigation of two different competing renewable hydrogen production strategies as analyzed in [41]: one in which the investor invests in RES generation and uses this to produce renewable hydrogen and a second one where they procure the necessary RES energy from third-party producers via Power Purchase Agreements (PPAs). The results indicated 14% cheaper Levelized Cost of Hydrogen (LCOH) for the former production method on average. Roughly 40% of the LCOH was related to the electrolysis process, 55% was related to RES energy generation or procurement, and another 5% was attributed to hydrogen storage costs. Under that study, renewable hydrogen was still economically not viable, with prices in the 2.14–5 EUR/kg range. However, it could become economically feasible in the following decades in the case of typical carbon emission cost increases, for example, in the EU’s ETS.
TwinP2G contributes significantly to EU’s climate goals under the European Green Deal [42], supporting the transition to decarbonization by providing simulation and optimization services that enable efficient RES and hydrogen storage integration through PtG and fuel cell technologies into power grids. It aligns with the Sustainable Development Goals (SDGs) [43] by promoting RES and hydrogen storage integration while reducing GHG emissions. At a larger scale, it can also accelerate the development of a circular economy while promoting the utilization of surplus renewable energy to produce green hydrogen, improving the efficiency of resources, and minimizing renewable energy curtailment.

Scalability and Computational Performance

TwinP2G uses LP formulation solved with GLPK (see Section 2.1.5). The complexity grows polynomially based on system size, such as the number of network components (buses, generators, lines, PtG links, storage) and the number of time snapshots. To quantify memory usage and runtime, we executed three benchmark cases (Table 3) on an NTUA workstation (Intel Xeon Gold 6244 @ 3.60 GHz, 26 GB RAM).
The results indicate that memory usage increases approximately linearly with the number of decision variables (Figure 6a), while the runtime grows superlinearly, as shown in Figure 6b. Across the three cases, the memory cost per value is roughly ≈1.72 × 10−3 MB/decision variable. Extending the small case A optimization horizon from 1 year to 5 years increased decision variables by ≈5 times, while runtime increased by ≈50 times, whereas case C required ≈824 times more runtime than case A.
The presented benchmarks demonstrate predictable, linear memory usage growth and superlinear solve-time growth. TwinP2G is tractable for single- and multi-year simulations of small to medium systems on a standard workstation. For large-scale systems, adopting a faster solver and temporal or system aggregation can further reduce complexity.

5. Limitations

While TwinP2G provides a flexible and transparent platform for optimal power-to-gas planning, several limitations of the current implementation must be acknowledged. The current optimization relies on a linear programming (LP) formulation, which does not explicitly capture non-linear dynamics such as AC power flow constraints, part-load efficiencies, ramping behavior, thermal cycling, and electrolyzer degradation. These effects can only be approximated indirectly (for example, by adjusting efficiency parameters in the UI). Moreover, extensions toward mixed-integer linear programming (MILP), stochastic optimization, and non-linear formulations are required to represent operational complexities more accurately. Finally, the platform has not yet been validated against plant-level operational data, though such validation is planned for future work.

6. Conclusions and Future Work

In this paper, we introduced TwinP2G, an open-source software application designed for data-driven PtG system modeling, simulation, and optimization within energy networks. Through its intuitive and easy-to-use UI, users are able to simulate and optimize their customized energy networks, incorporating PtG and fuel cell system integrations and ingesting real data and time series for both short- and long-term simulations. Using detailed visualizations and metrics, users can extract valuable network performance insights and assess system efficiency and techno-economic feasibility. TwinP2G is designed to serve various types of users based on their area of expertise, such as data scientists, energy engineers, investors, and researchers who seek to model energy networks and analyze and evaluate PtG integration strategies. By providing a flexible and scalable platform for simulation, optimization, and analysis, TwinP2G provides sophisticated data-driven decision-making support for stakeholders who are engaged in sustainable energy transition and decarbonization.
Future work will focus on benchmarking TwinP2G results against measured operation from PtG pilot projects and commercial tools, using validated plant-level datasets, in order to assess the gap between cost-optimal solutions and real-world operation and to support comprehensive economic feasibility case studies. A key priority is the incorporation of ramping dynamics, component degradation, and other non-linear constraints through extensions such as MILP or non-linear formulations while optionally evaluating integration with commercial solvers. Finally, sensitivity analyses on CAPEX, OPEX, or efficiency will be performed to assess the robustness of the results.

Author Contributions

Conceptualization, E.S. and S.P.; methodology, E.S. and S.P.; software, E.S., S.P., A.M.T., and G.K.; validation, E.S., S.P., and H.K.; formal analysis, E.S. and S.P.; investigation, E.S., S.P., and H.K.; resources, E.S. and S.P.; data curation, E.S.; writing—original draft preparation, E.S., S.P., H.K., and A.M.T.; writing—review and editing, E.S., S.P., H.K., and A.M.T.; supervision, C.N. and D.A.; project administration, C.N.; funding acquisition, C.N. and D.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research has received funding from the European Union’s Horizon Europe research and innovation program EnergyGuard under grant agreement No. 101172705. The sole responsibility for the content of this paper lies with the authors; the paper does not necessarily reflect the opinion of the European Commission.

Data Availability Statement

The original data presented in the study are openly available in [enershare-twinp2g] at [URL https://github.com/epu-ntua/enershare-twinp2g (accessed on 19 September 2025)].

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. United Nations Framework Convention on Climate Change. Paris Agreement; United Nations Framework Convention on Climate Change: Bonn, Germany, 2015. [Google Scholar]
  2. European Commission. REPowerEU; European Commission: Brussel, Belgium, 2022. [Google Scholar]
  3. IRENA. Green Hydrogen Cost Reduction: Scaling up Electrolysers to Meet the 1.5 °C Climate Goal, International Renewable Energy Agency; Technical Report; International Renewable Energy Agency: Abu Dhabi, United Arab Emirates, 2020. [Google Scholar]
  4. UNIDO; IRENA; IDOS. Green Hydrogen for Sustainable Industrial Development: A Policy Toolkit for Developing Countries; Technical Report; United Nations Industrial Development Organization: Vienna, Austria; International Renewable Energy Agency: Abu Dhabi, United Arab Emirates; Institute of Development and Sustainability (IDOS): Bonn, Germany, 2023. [Google Scholar]
  5. Li, Z.; Zheng, Z.; Xu, L.; Lu, X. A review of the applications of fuel cells in microgrids: Opportunities and challenges. BMC Energy 2019, 1, 8. [Google Scholar] [CrossRef]
  6. Ding, X.; Sun, W.; Harrison, G.P.; Lv, X.; Weng, Y. Multi-objective optimization for an integrated renewable, power-to-gas and solid oxide fuel cell/gas turbine hybrid system in microgrid. Energy 2020, 213, 118804. [Google Scholar] [CrossRef]
  7. Wang, C.; Nehrir, M.H. Power management of a stand-alone wind/photovoltaic/fuel cell energy system. IEEE Trans. Energy Convers. 2008, 23, 957–967. [Google Scholar] [CrossRef]
  8. Abe, J.; Popoola, A.; Ajenifuja, E.; Popoola, O. Hydrogen energy, economy and storage: Review and recommendation. Int. J. Hydrogen Energy 2019, 44, 15072–15086. [Google Scholar] [CrossRef]
  9. Fambri, G.; Diaz-Londono, C.; Mazza, A.; Badami, M.; Sihvonen, T.; Weiss, R. Techno-economic analysis of Power-to-Gas plants in a gas and electricity distribution network system with high renewable energy penetration. Appl. Energy 2022, 312, 118743. [Google Scholar] [CrossRef]
  10. Hassan, I.; Ramadan, H.S.; Saleh, M.A.; Hissel, D. Hydrogen storage technologies for stationary and mobile applications: Review, analysis and perspectives. Renew. Sustain. Energy Rev. 2021, 149, 111311. [Google Scholar] [CrossRef]
  11. Fragiacomo, P.; Genovese, M. Technical-economic analysis of a hydrogen production facility for power-to-gas and hydrogen mobility under different renewable sources in Southern Italy. Energy Convers. Manag. 2020, 223, 113332. [Google Scholar] [CrossRef]
  12. IRENA; WTO. International Trade and Green Hydrogen: Supporting the Global Transition to a Low-Carbon Economy; Technical Report; International Renewable Energy Agency: Abu Dhabi, United Arab Emirates, 2023. [Google Scholar]
  13. Moradpoor, I.; Syri, S.; Santasalo-Aarnio, A. Green hydrogen production for oil refining—Finnish case. Renew. Sustain. Energy Rev. 2023, 175, 113159. [Google Scholar] [CrossRef]
  14. Mbasso, W.F.; Harrison, A.; Dagal, I.; Jangir, P.; Khishe, M.; Kotb, H.; Shaikh, M.S.; Smerat, A.; Donfack, E.F.; Kumar, R. Digital twins in renewable energy systems: A comprehensive review of concepts, applications, and future directions. Energy Strategy Rev. 2025, 61, 101814. [Google Scholar] [CrossRef]
  15. Shaikh, M.S.; Wang, C.; Xie, S.; Zheng, G.; Dong, X.; Qiu, S.; Ahmad, M.A.; Raj, S. Coverage and connectivity maximization for wireless sensor networks using improved chaotic grey wolf optimization. Sci. Rep. 2025, 15, 15706. [Google Scholar] [CrossRef] [PubMed]
  16. Diaz-Londono, C.; Fambri, G.; Mazza, A.; Badami, M.; Bompard, E. A Real-Time Based Platform for Integrating Power-to-Gas in Electrical Distribution Grids. In Proceedings of the UPEC 2020—2020 55th International Universities Power Engineering Conference, Proceedings, Turin, Italy, 1–4 September 2020; Institute of Electrical and Electronics Engineers Inc.: Piscataway, NJ, USA, 2020; pp. 1–6. [Google Scholar] [CrossRef]
  17. Petkov, I.; Gabrielli, P. Power-to-hydrogen as seasonal energy storage: An uncertainty analysis for optimal design of low-carbon multi-energy systems. Appl. Energy 2020, 274, 115197. [Google Scholar] [CrossRef]
  18. Skepetari, E.; Pelekis, S. epu-ntua/enershare-twinp2g: Version 2.1.0. Zenodo, 2025. Available online: https://doi.org/10.5281/zenodo.15528018 (accessed on 25 September 2025).
  19. Pelekis, S.; Sarmas, E.; Georgiadou, A.; Karakolis, E.; Ntanos, C.; Dimitropoulos, N.; Kormpakis, G.; Doukas, H. Twinp2g: A Digital Twin Architecture for Optimal Power-To-Gas Planning. In Proceedings of the 21st International Conference e-Society 2023, Lisbon, Portugal, 11–13 March 2023; pp. 119–126. [Google Scholar]
  20. IDSA. IDSA Data Connector Report; Infectious Diseases Society of America: Arlington, VA, USA, 2022. [Google Scholar]
  21. EnerShare. European Common Energy Dataspace Framework Enabling Data Sharing-Driven Across- And Beyond-Energy. 2022. Available online: https://cordis.europa.eu/project/id/101069831 (accessed on 25 September 2025).
  22. Desfa. DESFA S.A.-desfa.gr. 2025. Available online: https://www.desfa.gr/en/our-services/market-test/%CE%B5%CE%BD%CE%B5%CF%81%CE%B3%CE%AD%CF%82/incremental-capacity-process-2025-2/ (accessed on 25 September 2025).
  23. IPTO. Independent Power Transmission Operator|IPTO. 2025. Available online: https://www.admie.gr/en (accessed on 25 September 2025).
  24. Docker. Docker: Accelerated Container Application Development. 2025. Available online: https://www.docker.com/ (accessed on 25 September 2025).
  25. Keycloak. Keycloak: Open Source Identity and Access Management. 2025. Available online: https://www.keycloak.org/ (accessed on 25 September 2025).
  26. Streamlit. Streamlit • A Faster Way To Build and Share Data Apps. 2025. Available online: https://streamlit.io/ (accessed on 25 September 2025).
  27. Brown, T.; Hörsch, J.; Schlachtberger, D. PyPSA: Python for Power System Analysis. J. Open Res. Softw. 2018, 6, 4. [Google Scholar] [CrossRef]
  28. ENTSO-E. ENTSO-E|European Network of Transmission System Operators for Electricity. 2025. Available online: https://www.entsoe.eu/ (accessed on 25 September 2025).
  29. ENTSO-G. ENTSOG|European Network of Transmission System Operators for Gas. 2025. Available online: https://www.entsog.eu/ (accessed on 25 September 2025).
  30. Hofmann, F. Linopy: Linear optimization with n-dimensional labeled variables. J. Open Source Softw. 2023, 8, 4823. [Google Scholar] [CrossRef]
  31. GLPK. GLPK-GNU Project-Free Software Foundation (FSF). 2024. Available online: https://www.gnu.org/software/glpk/ (accessed on 25 September 2025).
  32. Anderson, K.S.; Hansen, C.W.; Holmgren, W.F.; Jensen, A.R.; Mikofski, M.A.; Driesse, A. pvlib python: 2023 project update. J. Open Source Softw. 2023, 8, 5994. [Google Scholar] [CrossRef]
  33. Photovoltaic Geographical Information System (PVGIS); European Commission: Brussels, Belgium, 2024.
  34. TNO. TNO Security Gateway; TNO: The Hague, The Netherlands, 2025. [Google Scholar]
  35. FastAPI. FastAPI, 2025. Available online: https://fastapi.tiangolo.com/ (accessed on 25 September 2025).
  36. Pelekis, S.; Pountridis, T.; Kormpakis, G.; Lampropoulos, G.; Karakolis, E.; Mouzakitis, S.; Askounis, D. DeepTSF: Codeless machine learning operations for time series forecasting. SoftwareX 2024, 27, 101758. [Google Scholar] [CrossRef]
  37. Tzortzis, A.M.; Koutalidis, H.; Skepetari, E.; Pelekis, S.; Ntanos, C. Enershare Workflow Orchestration (TSF-P2G) Version 1.0. Zenodo, 2025. Available online: https://doi.org/10.5281/zenodo.15538130 (accessed on 25 September 2025).
  38. Kormpakis, G.; Kapsalis, P.; Alexakis, K.; Pelekis, S.; Karakolis, E.; Doukas, H. An Advanced Visualisation Engine with Role-Based Access Control for Building Energy Visual Analytics. In Proceedings of the 13th International Conference on Information, Intelligence, Systems and Applications, IISA 2022, Corfu, Greece, 18–20 July 2022. [Google Scholar] [CrossRef]
  39. EnergyGuard. Large-Scale Testing and Experimentation Facility (TEF) for Assessing, Validating, and Enhancing AI-Powered Next-Generation Energy Solutions; EnergyGuard: Fort Lauderdale, FL, USA, 2025. [Google Scholar] [CrossRef]
  40. Koutalidis, H.; Pelekis, S.; Skepetari, E.; Ntanos, C.; Karakolis, E.; Tzortzis, A.M.; Kormpakis, G.; Michalitsi-Psarrou, A.; Papagiannopoulos, I.; Blika, A.; et al. Towards Innovative Power-to-Gas Investments in Greece: Novel Simulation Scenarios and Assessment Framework. In Proceedings of the 2024 15th International Conference on Information, Intelligence, Systems & Applications (IISA), Chania Crete, Greece, 17–19 July 2024; pp. 1–8. [Google Scholar] [CrossRef]
  41. Koutalidis, H.; Pelekis, S.; Skepetari, E.; Ntanos, C.; Karakolis, E.; Michalitsi-Psarrou, A.; Blika, A.; Askounis, D. Renewable hydrogen blending into urban natural gas grids with power-to-gas: A techno-economic assessment for Greece. Int. J. Hydrogen Energy 2025, 139, 380–395. [Google Scholar] [CrossRef]
  42. European Commission. The European Green Deal; European Commission: Brussels, Belgium, 2019. [Google Scholar]
  43. United Nations. Transforming Our World: The 2030 Agenda for Sustainable Development; United Nations: New York, NY, USA, 2015. [Google Scholar]
Figure 1. TwinP2G architecture: (i) identity and access management (Keycloak), (ii) Streamlit-based UI for scenario configuration and visualization, (iii) PyPSA optimization for techno-economic planning, and (iv) Enershare Data Space integration (TSO datasets, Dagster ingestion, TimescaleDB, and Data Marketplace).
Figure 1. TwinP2G architecture: (i) identity and access management (Keycloak), (ii) Streamlit-based UI for scenario configuration and visualization, (iii) PyPSA optimization for techno-economic planning, and (iv) Enershare Data Space integration (TSO datasets, Dagster ingestion, TimescaleDB, and Data Marketplace).
Futureinternet 17 00451 g001
Figure 2. Data Space integration.
Figure 2. Data Space integration.
Futureinternet 17 00451 g002
Figure 3. TwinP2G user interface.
Figure 3. TwinP2G user interface.
Futureinternet 17 00451 g003aFutureinternet 17 00451 g003b
Figure 4. TwinP2G system parameters. (a) Bus parameters: number of buses and energy carrier (AC, DC, natural gas, or hydrogen). (b) Generator parameters: generator type, nominal power, capital and marginal costs, and solar production data retrieval from the Data Space. (c) Line parameters: start and ending bus and series resistance and reactance. (d) Load parameters: load type and energy demand time series retrieval from the Data Space. (e) Link parameters: start and ending bus, nominal power, capital and marginal costs, and efficiency. (f) Energy storage parameters: hydrogen bus, nominal energy capacity, and capital and marginal costs.
Figure 4. TwinP2G system parameters. (a) Bus parameters: number of buses and energy carrier (AC, DC, natural gas, or hydrogen). (b) Generator parameters: generator type, nominal power, capital and marginal costs, and solar production data retrieval from the Data Space. (c) Line parameters: start and ending bus and series resistance and reactance. (d) Load parameters: load type and energy demand time series retrieval from the Data Space. (e) Link parameters: start and ending bus, nominal power, capital and marginal costs, and efficiency. (f) Energy storage parameters: hydrogen bus, nominal energy capacity, and capital and marginal costs.
Futureinternet 17 00451 g004aFutureinternet 17 00451 g004bFutureinternet 17 00451 g004c
Figure 5. TwinP2G output results.
Figure 5. TwinP2G output results.
Futureinternet 17 00451 g005aFutureinternet 17 00451 g005b
Figure 6. TwinP2G performance evaluation: (a) memory usage and (b) runtime.
Figure 6. TwinP2G performance evaluation: (a) memory usage and (b) runtime.
Futureinternet 17 00451 g006
Table 1. Comparative overview of existing tools for PtG applications.
Table 1. Comparative overview of existing tools for PtG applications.
ToolTwinP2GeMEGASIM/
RT-LAB
AprosEnergyProMATLAB/
Simulink
System simulation
PtG-specific components
Techno-economic optimization✓ 1
Open-source
User-friendly UI
Integration with Data Spaces
1 Techno-economic investment optimization must be implemented by the user or performed via external solvers.
Table 2. Definitions of simulation and optimization variables.
Table 2. Definitions of simulation and optimization variables.
SymbolUnitDescription
n Label the buses
t Label the snapshots
l Label the branches
s Label the storage types at each bus
r Label the generation types at each bus
w t Weighting of time t in the objective function
g n , r , t MWDispatch of generator r at bus n at time t
g ¯ n , r MWNominal power of generator r at bus n
c n , r EUR/MWCapital cost of extending generator nominal power by one MW
c ^ n , s EUR/MWhCapital cost of extending store nominal energy by one MWh
c l EUR/MWCapital cost of extending branch power by one MW
o n , s , t EUR/MWhStore operational cost
o n , r , t EUR/MWhGenerator operational cost
f l , t MWFlow of power in branch l at time t
F l MWCapacity of branch l
e ¯ n , s MWhStore nominal energy
e n , s , t MWhStore dispatch
η l , t Efficiency
d n , t MWhElectricity demand
λ n , t EUR/MWhMarginal cost
Table 3. Benchmark cases: system configuration, decision variables, memory, and runtime.
Table 3. Benchmark cases: system configuration, decision variables, memory, and runtime.
CaseSystem DescriptionHorizonDecision VariablesMemory (MB)Runtime (hh:mm:ss)
ASmall: 3 buses (2 AC, 1 H2),
2 generators, 1 line, 1 electrical load, 1 PtG unit
1 year
(8784 timestamps)
61,493 (N)105.800:00:32.6
BSame as A5 years
(43,848 timestamps)
306,941 (5 N)525.200:27:20.7
CMedium: 6 buses (5 AC,
1 H2), 9 generators, 4 lines,
5 loads, 1 PtG unit
5 years
(43,848 timestamps)
745,424 (12.1 N)1304.907:34:22.6
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Skepetari, E.; Pelekis, S.; Koutalidis, H.; Tzortzis, A.M.; Kormpakis, G.; Ntanos, C.; Askounis, D. TwinP2G: A Software Application for Optimal Power-to-Gas Planning. Future Internet 2025, 17, 451. https://doi.org/10.3390/fi17100451

AMA Style

Skepetari E, Pelekis S, Koutalidis H, Tzortzis AM, Kormpakis G, Ntanos C, Askounis D. TwinP2G: A Software Application for Optimal Power-to-Gas Planning. Future Internet. 2025; 17(10):451. https://doi.org/10.3390/fi17100451

Chicago/Turabian Style

Skepetari, Eugenia, Sotiris Pelekis, Hercules Koutalidis, Alexandros Menelaos Tzortzis, Georgios Kormpakis, Christos Ntanos, and Dimitris Askounis. 2025. "TwinP2G: A Software Application for Optimal Power-to-Gas Planning" Future Internet 17, no. 10: 451. https://doi.org/10.3390/fi17100451

APA Style

Skepetari, E., Pelekis, S., Koutalidis, H., Tzortzis, A. M., Kormpakis, G., Ntanos, C., & Askounis, D. (2025). TwinP2G: A Software Application for Optimal Power-to-Gas Planning. Future Internet, 17(10), 451. https://doi.org/10.3390/fi17100451

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop