Mathematical model
The algorithm is formulated as a modular optimization model based on Linear Programming (LP). The dimensionality of the model—i.e., the number of decision variables and constraints—adapts dynamically according to the set of technologies selected for deployment. Its modular architecture allows for the selective activation or deactivation of entire technology blocks (modules), enabling flexible configuration beyond simple parameter tuning. Each module encapsulates its own constraints and cost formulations, contributing to the overall objective function and system behaviour. The LP-based model is applied to key infrastructure components such as wind turbines (onshore and offshore), energy storage systems (lithium-ion and hydrogen), electrical interconnections, prosumer units, and photovoltaic systems. A separate optimization module is used for electric vehicle (EV) infrastructure, and its resulting outputs—primarily cost metrics—are integrated into the cost function of the main model to ensure holistic system-level optimization.
Cost expressions (Cost function) are very typical of LP optimization, used in many problems in which expenses are being minimized, including energy hubs models6,7.
The installation costs multiply the sizing variables, whereas the O&M costs multiply the sum of all the energy either generated or flowing through the module.
This formula is structured as follows:
Where P is the sizing variable of each installation (generally a power value [kW]).
In addition to the cost function, there is a similar approach for a constraint at a general level (for all the modules): there is an expression that is the difference between the expected consumption and the sum of the total installed power between all the elements. The objective of the restriction is to reduce this difference to 0.
where
C → Consumption expression
Pinstalled → Installed power
All the modules have information about costs and space limitations that are used in the model constraints. For example, in the case of the onshore turbines: The installed power, that is computed through the product of a generation coefficient and the wind speed, should be greater than what exists initially:
The space occupied by turbines should be lower than available:
Sonshore → Onshore installation space
STonshore → Total onshore space
Ponshore → Onshore installed power
P0onshore → Initial onshore installed power
In the case of the solar parks, the generation is calculated using the irradiance and the guaranteed minimum performance. The space limitation, like in the case of the turbines, is related to the initial installed power in the lower bound and to the available space in the upper. The prosumers, in addition to the space limitations, include other restrictions like the battery capacity:
Ebattery → Battery capacity
E0prosumer → Prosumer initial stored energy
ϵprosumer → Battery prosumer efficiency
Eprosumer → Prosumer net energy
Or the energy flow (the energy leaving should be less than that entering):
Similar expressions appear for lithium batteries, regarding the battery capacity:
Elithiumcap → Lithium battery capacity
E0lithium → Lithium initial stored energy
ϵlithium → Lithium battery efficiency
Elithium → Lithium battery net energy
The charging and discharging power limits:
Or the energy flow:
Hydrogen batteries have very similar expressions, also regarding space constraints, battery capacity and charging limits.
Interconnexions are part of the complete installation, and there are two different modules for them: the existing ones, that have power limitation
Secable → Size of existing cable
Eeconn → Energy net of existing connection
and the new ones, for which there are also power restrictions:
Upper bound:
Enew → New interconnection net energy
Sncable → Size of new cable
In → New installed interconnections
Lower bound:
As commented before, there is an additional module that computes the costs and contributions to the consumption expression from the electrical vehicles. The restrictions related to this part of the installation are the following: The number of charging vehicles is lower than the number of slow and fast charging stations:
cpertour → ev_tourists_charging_percentage
vehtour → ev_tourists_vehicles
cperurban → ev_urban_services_charging_percentage
vehurban → ev_urban_services_vehicles
cpertour → ev_tourists_charging_percentage
cperinhab → ev_inhabitants_charging_percentage
cperveh → ev_tourists_charging_percentage
vehinhab → ev_urban_services_vehicles
The number of slow and fast charging stations Is lower than the total of each kind:
csslowactive → ev_active_slow_charge_stations
csslowtotal → ev_total_slow_charge_stations
csfastactive → ev_active_fast_charge_stations
csfasttotal → ev_total_fast_charge_stations
Space limitation for charging stations:
csslowspace → ev_slow_charge_station_installation_space
csfastspace → ev_fast_charge_station_installation_space
cstotalspace → ev_total_charging_station_space
The number of charging stations installed should be greater than the initial number:
Pslowinstalled → ev_already_installed_slow_charge_power
Pfastinstalled → ev_already_installed_fast_charge_power
The sum of the objective function corresponding to electric vehicles considers the installation and maintenance cost of the slow and fast charging stations:
ICslow → Slow charge station installation cost
ICfast → Fast charge station installation cost
MCslow → Slow charge station maintenance cost
MCfast → Fast charge station maintenance cost