‘The aim of FLEXINet is a system that accelerates the energy transition. We hope to make a substantial contribution to reaching climate targets by cleverly combining various techniques – think of blending recycled batteries with flexible heat pumps and the charging of electric cars.’
The code implements the Energy Management System (EMS), of Results 5 and 6 of the project. The EMS is a software that controls the energy flows in the building, in order to minimize the energy costs. The EMS is implemented in Julia, and it is based on JuMP.jl and InfiniteOpt.jl. The EMS is an optimization based controller and it sends the optimal setpoints to the different devices.
The workflow is the following:
PENDING
The common installation is followed. If necessary, add directly this repository to the Julia environment.
julia> ]
Pkg> add https://https://github.com/DarioSlaifsteinSk/EMSmodule.git # main
using EMSmoduleIf you have any issues with the installation, please contact the developers.
The functions that compose the EMS Library are in the files:
makeEMSobjs.jl # creates the mutable structs/objects
EMSfns.jl # functions to create the optimization model
ESSfns.jl # functions to add the ESS to the optimization models
EMSrfofns.jl # functions for RFO (Random Field Optimization)
thermfns.jl # thermal devices functions
makeEMSplots.jl # plotting functions
makeForecasts.jl # forecasting functions
simEMS.jl # simulation functions
testEMS.jl # testing functions UNDER DEVELOPMENTExamples on how to use the package are under development.
Following the Universal Modelling Framework (UMF) this library implements Direct Lookahead (DLA) Policies. The DLA is a model-based policy that uses a model of the system to predict the future and optimize the control actions. The available DLAs are a day-ahead (DA) planner and a Model Predictive Controller (MPC). The basic algorithm is depicted in the following figure:
The DA planner uses a model of the system to predict the future and optimize the control actions for the next 24 hours. The MPC uses a model of the system to predict the future and optimize the control actions for the next 24 hours, but it also uses the actual measurements to update the model and the optimization problem every hour. The MPC is an economic non-linear MPC (NLP-eMPC) receding horizon controller.
The forecasts can either be provided to the optimization model as input data, or they can be simulated by adding noise to the deterministic inputs.
A native Julia forecast package is under development.
For bugs or feature requests, please open an issue. For usage questions or extensions please refer to the discussion section.
This repository contains the work produced for the FLEXINET project by the DCE&S group, Electrical Sustainable Energy Dept. of the TU Delft. The work belongs to Dario Slaifstein, Gautam Rituraj, and Joel Alpizar.
For open source projects, say how it is licensed. PENDING
This library is based and used in the following publications:
[1] D. Slaifstein, G. R. Chandra Mouli, L. Ramirez-Elizondo, and P. Bauer, “Sequential operation of residential energy hubs using physics-based economic nonlinear MPC,” Appl Energy, vol. 408, p. 127402, Apr. 2026, doi: 10.1016/J.APENERGY.2026.127402.
[2] D. Slaifstein, G. R. C. Mouli, L. Ramirez-Elizondo, and P. Bauer, “Aging-aware Energy Management for Residential Multi-Carrier Energy Systems,” Aug. 2025, Accessed: Mar. 22, 2025. [Online]. Available: http://arxiv.org/abs/2503.16139 Under Review in Journal of Energy Storage
[3] D. Slaifstein, A. M. Agudin, G. R. C. Mouli, L. Ramírez-Elizondo, and P. Bauer, “Stochastic Mobility Integration into Residential Energy Hubs,” in 2024 IEEE International Conference on Electrical Systems for Aircraft, Railway, Ship Propulsion and Road Vehicles & International Transportation Electrification Conference (ESARS-ITEC), IEEE, Nov. 2024, pp. 1–7. doi: 10.1109/ESARS-ITEC60450.2024.10819794.
Cite as:
@article{Slaifstein2026,
author = {Darío Slaifstein and Gautham Ram Chandra Mouli and Laura Ramirez-Elizondo and Pavol Bauer},
doi = {10.1016/J.APENERGY.2026.127402},
issn = {0306-2619},
journal = {Applied Energy},
month = {4},
pages = {127402},
publisher = {Elsevier},
title = {Sequential operation of residential energy hubs using physics-based economic nonlinear MPC},
volume = {408},
url = {https://linkinghub.elsevier.com/retrieve/pii/S0306261926000541},
year = {2026}
}

