Conference paper
Cite …

The Model-Build-Manifest: A Dependency Injection pattern for Structural Coupling in Sector-Coupled Energy Systems

Xuanhao Mu  ORCID iD icon 1, Jianlei Liu 1, Gökhan Demirel ORCID iD icon 1, Thorsten Schlachter ORCID iD icon 1 and Veit Hagenmeyer ORCID iD icon 1
1 Institute for Automation and Applied Informatics (IAI), Karlsruhe Institute of Technology (KIT)
Abstract

In sector-coupled energy systems, integrating physical models from multiple domains into a unified optimization problem typically requires tight coupling between simulation and control logic, which violates the separation of concerns principle and limits modularity. This paper proposes the Model-Build-Manifest, a decoupling mechanism based on the dependency injection (DI) design pattern. Each physical simulator publishes a standardized JSON manifest that declares its mathematical constraints, decision variables, and parameters. A generic controller reads these manifests at runtime and dynamically assembles a complete Model Predictive Control (MPC) optimization problem without domain-specific knowledge or code modifications. The controller can thereby be reused across different physical domains without requiring domain-specific code modifications. The mechanism is validated on a 14-node low-voltage power–gas coupled system within the open-source PROcess Orchestration Framework (PROOF), where a Power-to-Gas (P2G) unit is integrated by adding its manifest and reusing the existing constraint library, without modifying the controller code. Results confirm that the assembled coupled optimization problem is solved correctly and that the P2G flexibility mitigates battery state-of-charge oscillations. The implementation is publicly available at https://github.com/KIT-IAI/Model-Build-Manifest and the PROOF framework is publicly available at https://github.com/KIT-IAI-PROOF.