DOI: 10.3303/CET25117104 Paper Received: 8 December 2024; Revised: 7 February 2025; Accepted: 23 April 2025 Please cite this article as: Cosenza B., Pannocchia G., Vaccari M., 2025, Optimizing Hybrid Renewable Energy Systems for Enhanced Sustainability and Efficiency in Rural Communities, Chemical Engineering Transactions, 117, 619-624 DOI:10.3303/CET25117104 CHEMICAL ENGINEERING TRANSACTIONS VOL. 117, 2025 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Fabrizio Bezzo, Flavio Manenti, Gabriele Pannocchia, Almerinda di Benedetto Copyright © 2025, AIDIC Servizi S.r.l. ISBN 979-12-81206-17-5; ISSN 2283-9216 Optimizing Hybrid Renewable Energy Systems for Enhanced Sustainability and Efficiency in Rural Communities Bartolomeo Cosenza, Gabriele Pannocchia, Marco Vaccari Dipartimento di Ingegneria Civile e Industriale, Università di Pisa, Largo Lucio Lazzarino, 56122 Pisa (PI), Italy, bartolomeo.cosenza@unipi.it This research examines a Hybrid Renewable Energy System (HRES) that integrates different renewable and conventional energy sources, specifically combining photovoltaic, wind and fuel generators. The main objective is to optimize energy supply while minimizing fuel consumption through dynamic management of these different sources. Nonlinear optimization techniques, implemented through the CasADi library, effectively manage the intricate interactions between various energy sources. The developed algorithm determines optimal operating setpoints for each generator, carefully balancing system constraints while ensuring uninterrupted power delivery to meet load demands. The importance of this work lies in its practical applications, particularly for remote areas and islands with limited access to traditional electricity grids. The system demonstrates how HRES can effectively reduce dependence on fossil fuels, improve environmental sustainability, provide continuous and reliable energy supply, support local development in rural communities and promote energy independence. 1. Introduction The global energy landscape faces significant challenges with diminishing traditional resources, volatile fuel prices, and environmental concerns from emissions, highlighting the unsustainability of conventional power generation. Renewable energy sources emerge as a compelling solution, offering environmental benefits and reduced fossil fuel dependence. However, their intermittent nature necessitates innovative approaches to ensure reliable power supply. HRES address these challenges by integrating multiple renewable sources like solar, wind, hydroelectric, and geothermal power, often combined with energy storage solutions (Natividad and Benalcazar, 2023) or more traditional non-renewable energy sources (as fuel generators). This integration creates a robust framework that compensates for individual source limitations while maximizing overall system efficiency. The optimization of HRES demands sophisticated management strategies to balance various energy sources and storage systems effectively (Ansari et al., 2023). Such optimization encompasses multiple objectives: maximizing renewable resource utilization, minimizing operational costs, ensuring supply reliability, and managing energy storage efficiently. The development of HRES has seen significant evolution through recent research: Nova et al. (2023) conducted a technical, environmental, and economic evaluation of various hybrid energy generation alternatives for rational energy use scenarios at the Santander Technological Units using HOMER Pro software; San Juan and Sy (2023) introduced a target-oriented robust optimization model for scheduling the production and distribution of power through a HRES capturing uncertainties in energy source availabilities; Huang et al. (2024) proposed a hybrid version of golden search algorithm for off-grid systems; Ramos-Marin et al. (2024) explored optimization strategies for the Canary Islands; more recently Silinto et al. (2025) contributed to future developments by examining spatial explicit modeling tools for rural electrification in developing countries, highlighting the continued evolution of HRES technology and implementation strategies. In Italy, HRES implementations are revolutionizing energy infrastructure, particularly in rural and island communities (Hoseinzadeh and Garcia, 2022). These systems enhance local energy security while driving sustainable development, notably in isolated territories. Island settings serve as exemplary cases of successful HRES adoption, where integrated renewable sources promote energy independence and environmental conservation (Marocco et al., 2023). This comprehensive approach to energy generation and management establishes HRES as a key enabler in the sustainable energy transition, offering reliable solutions for both immediate and long-term environmental objectives. The ambitious goal of transitioning the Aeolian Islands to 619 100% renewable energy by 2030 represents a significant application of HRES principles in a real-world context. This initiative, part of the "Energy Transition Agenda for European Minor Islands" (https://clean-energy- islands.ec.europa.eu/assistance/clean-energy-transition-agenda) promoted by the "Clean Energy for EU Islands" Secretariat, aligns perfectly with the growing emphasis on sustainable energy solutions in isolated territories. The Aeolian archipelago presents an ideal case study for HRES implementation, where the integration of multiple renewable sources can effectively address the unique energy challenges faced by island communities. 2. HRES Device model The analyzed HRES employs a sophisticated control system based on device setpoints, as outlined by Vaccari et al. (2019). This architecture encompasses electrical generators, storage units, and loads, where operational parameters are provided as input data, eliminating the need for specific sizing calculations. Figure 1 shows the schematic diagram of the HRES considered by the authors with three power sources feeding electrical loads. Figure 1: Schematic diagram of the Hybrid Renewable Energy System (HRES) showing the integration of three power sources: a fuel generator (PN = 15 kWe, Pmin = 1.5 kWe), a photovoltaic array (PN = 10 kWe, DNIr = 800 W/m², η = 90%), and a wind turbine (PN = 3.5 kWe, v = 3-16 m/s) connected to supply the electrical load. The HRES model is designed for small rural community applications with the following specifications: a 10 kWe photovoltaic array, a 3.5 kWe wind turbine, and a 15 kWe fuel generator are integrated within the system. This configuration accommodates a base load of 1.8–2.0 kW during nighttime and peaks of up to 4 kW during daytime, with renewable sources typically contributing a significant portion of the daily energy demand. Consequently, the combined renewable sources effectively support the community's energy needs, while the fuel generator provides reliable backup to maintain a continuous power supply during periods of low renewable resource availability. The system employs established optimization techniques to determine appropriate setpoint configurations for each component, aiming to maximize overall system efficiency while meeting operational constraints and power demand requirements. The core control mechanism, in fact, operates through normalized setpoints between 0 and 1, establishing a direct relationship between actual and nominal power output. Within the generation portfolio, photovoltaic, wind turbine (aeolian), and fuel-based generators operate under distinct parameters. The renewable sources function with zero fuel costs, providing clean energy from natural resources, while conventional generators require specific fuel inputs like biomass, diesel, or natural gas. Throughout operation, the system continuously monitors and optimizes both power generation (kilowatts) and fuel consumption (kilograms per hour) across the defined operational horizon. This setpoint-based framework enables dynamic system adaptation to fluctuating conditions. The control system responds to variations in load demands and environmental factors, maintaining optimal resource utilization while ensuring reliable power supply. Through continuous analysis of input parameters and strategic adjustment of component setpoints, the optimization algorithm determines efficient operational strategies that balance power demands with minimal operational costs. 3. HRES Optimization problem An off-grid HRES integrates multiple energy sources, like solar panels, wind turbines, to provide electricity without relying on the main power grid. It is designed to supply power to remote or isolated areas where grid connection is impractical or too expensive. The system must be sized to meet the local energy demand (load) consistently. As above referred, the load represents the base electrical demand that must be continuously 620 satisfied by the HRES, characterized by a moderate base demand during nighttime hours to maintain essential services, increasing to higher peaks during daytime periods to support community activities including residential consumption, critical infrastructure, and local services. A description of how the optimization problem is set up for this type of system will now follow: from the objective function to the constraints acting on the process and on the optimization variables. The minimization of the objective function can be expressed as follows: 𝑚𝑖𝑛 𝛼𝑥,𝛼𝑦,𝛼𝑒 𝑓 = ∑ 𝑦𝑖 𝐹𝑁 𝑖=1 + 𝐶1 ∑ (𝛼𝑥,𝑖 + 𝛼𝑦,𝑖 + 𝛼𝑒,𝑖) 𝑁 𝑖=1 (1) The objective function is composed of two main terms: • The first term represents the total fuel consumption (by fuel generator) summed over all time steps N. This is the primary aspect to minimize, as fuel usage directly impacts both operational costs and environmental impact. • The second term represents the sum of all control actions (setpoints) for each generator, multiplied by a penalty constant C1. This term helps prevent excessive adjustments to the generators' outputs that could cause unnecessary wear. Specifically, there is: 𝑦𝑖 𝐹 the amount of fuel; The objective function to be minimized is represented by the amount of fuel in the generator. 𝛼𝑥,𝑖 , 𝛼𝑦,𝑖 , 𝛼𝑒,𝑖 device setpoints (optimization variables) at the i-th step; 𝐶1 = penalty constant relating to device setpoints; 𝑁 = total number of time steps considered. The optimization problem incorporates multiple operational constraints that govern the system's behavior. The primary constraint ensures energy balance, requiring that the combined power output from all three generators (photovoltaic, wind, and fuel) must precisely match the L1 energy load demand at every time step. 𝑥𝑖 𝐺 + 𝑦𝑖 𝐺 + 𝑒𝑖 𝐺 = 𝑧𝑖 𝐶 ∀𝑖 ∈ {1, . . . , 𝑁} (2) with: 𝑥𝑖 𝐺: power generated by the photovoltaic generator at the i-th step; 𝑦𝑖 𝐺 : power generated by the fuel generator at the i-th step; 𝑒𝑖 𝐺: power generated by the wind generator at the i-th step; 𝑧𝑖 𝐶 : energetic load required at the i-th step. The equation states that at every time step i, the total power produced by all generators (solar, fuel, and wind) must equal the required energy load (𝑧𝑖 𝐶). Additionally, each generator operates within specific setpoint boundaries, where the renewable sources (photovoltaic and wind) function between zero and maximum capacity. Therefore, the variable optimization constraints for the solar and wind generator are respectively: 0 ≤ 𝛼𝑥,𝑖 ≤ 1 ∀𝑖 ∈ {1, . . . , 𝑁} (3) 0 ≤ 𝛼𝑒,𝑖 ≤ 1 ∀𝑖 ∈ {1, . . . , 𝑁} (4) While the fuel generator must maintain operation above a maximum capacity and a minimum technical threshold when active. The fuel generator's output is determined by two interrelated variables: • a continuous setpoint 𝛼𝑦,𝑖 between 0 and 1 for each time step i; • an operational state θi which is automatically determined as: - θi = 0 when 𝛼𝑦,𝑖 < 𝛼𝑚𝑖𝑛 ; - θi = 1 when 𝛼𝑦,𝑖 ≥ 𝛼𝑚𝑖𝑛 where 𝛼𝑚𝑖𝑛 = 𝑃𝑚𝑖𝑛/𝑃𝑁 The actual power output is calculated as: yi G = 𝑃𝑁 * θi * 𝛼𝑦,𝑖 (5) This formulation ensures that: • when 𝛼𝑦,𝑖 < 𝛼𝑚𝑖𝑛, θi becomes 0, forcing the generator to be completely “off”; • when 𝛼𝑦,𝑖 ≥ 𝛼𝑚𝑖𝑛, θi becomes 1, allowing the generator to be “on” and to operate between its minimum technical power (𝑃𝑚𝑖𝑛) and nominal power (𝑃𝑁). 621 While θi effectively acts as a binary indicator, it is not an optimization variable but rather a consequence of the setpoint α, maintaining the problem as a nonlinear programming (NLP) formulation. The system also monitors and limits the fuel generator's ignition cycles to prevent excessive wear and ensure efficient operation, particularly restricting its use when renewable sources can adequately meet the demand. These interrelated constraints work together to maintain reliable power supply while ensuring all devices operate within their designed specifications. The formulation of the nonlinear programming (NLP) problem becomes: NLP = minimize 𝑓(𝛼𝑥, 𝛼𝑦 , 𝛼𝑒) (6) subject to: 𝑔1(𝛼𝑥, 𝛼𝑦 , 𝛼𝑒) = 0; (7a) 𝛼𝑦,𝑖 = 0 when renewable power ≥ load demand; (7b) 𝛼𝑚𝑖𝑛 ≤ 𝛼𝑦,𝑖 ≤ 1 when renewable power < load demand; (7c) 0 ≤ 𝛼𝑥𝑖 , 𝛼𝑒𝑖 ≤ 1 ∀𝑖 ∈ {1, . . . , 𝑁} (7d) where 𝑔1(𝛼𝑥, 𝛼𝑦 , 𝛼𝑒) = 0 represents the power balance constraint (2). These constraints ensure both energy balance and proper device operation within their physical limitations, forming the foundation for the nonlinear optimization framework. 3.1 HRES algorithm implementation The algorithm implementation leverages the capabilities of Python, version 3.11.3, with Spyder chosen as the development environment for its comprehensive functionality and integrated IPython console. The foundation of the optimization program rests on three primary libraries: NumPy for efficient matrix operations and numerical calculations, Pandas for managing structured data primarily from Excel files, and CasADi (Andersson et al., 2019) which, combined with the IpOpt solver, provides the framework for symbolic optimization and numerical of nonlinear problems. Device properties within the hybrid system are efficiently organized using Python dictionaries, providing a flexible key-based structure that simplifies access to device-specific information throughout the optimization process. 4. Results As previously mentioned, this study examines energy management in an isolated microgrid system designed for island or rural contexts where main grid connection is unfeasible. The system combines three power sources (photovoltaic, wind, and fuel generators) optimized to meet 24-hour load demands while minimizing fuel consumption. Two simulation cases were analyzed to demonstrate the system's performance under different operational conditions. Both simulations utilize environmental data collected through an Excel file containing solar irradiance and wind speed measurements. These meteorological conditions (of the place considered) vary during the day, and the determination of the optimal available renewable energy profile depends on them. The key challenge lies in efficiently managing these demands within the generation limits, particularly during morning and evening peaks, while maximizing renewable resource utilization. For larger communities, multiple HRES units could be deployed in parallel to serve the total load requirements. Case Study 1 (First Simulation): The first simulation represents typical clear-sky conditions with predictable solar radiation patterns and intermittent wind availability. Weather conditions include: • Solar radiation: consistent availability from early morning until late afternoon with direct and constant radiation; • Wind patterns: no wind during night hours, variable intensity during the day with peaks in the evening (around hour 20), followed by complete calm; • Load profile: base demand of 1.8-2.0 kW during nighttime hours (accounting for critical continuous operations such as household refrigeration systems and essential public lighting) increasing to peaks of up to 4 kW during daytime to accommodate various community activities including: residential units with basic consumption (cooking, lighting, appliances); minimal community infrastructure (small medical point, water pumping station); location-specific needs (as modest irrigation systems agricultural regions or small cold storage facilities in coastal areas). The diagram presented in Figure 2 (left) depicts the optimization algorithm's performance in managing energy distribution within an isolated microgrid over a 24-hour cycle. The graph, displaying the combined power profile, shows how the load demand (black dashed line) is continuously met through the optimal combination of available power sources. The contribution of each generator is clearly visible through the stacked coloured areas, with the fuel generator (red), photovoltaic generator (green), and wind generator (orange) working in concert to ensure reliable power supply. 622 Figure 2 (Left): The combined energy profiles over a 24-hour period for the first simulation; (Right): Control variable (setpoint) evolution of each device over the same period for the first simulation. The stacked graph reveals the algorithm's intelligent prioritization of renewable resources, particularly evident in harnessing photovoltaic generation during daylight hours, with fuel generation strategically distributed to maintain supply reliability when renewables are in short supply. The right portion of the power profile (after hour 15) illustrates the dynamic interplay between different power sources in response to changing conditions. As photovoltaic generation decreases with sunset, the fuel generator activates to maintain power supply. A significant wind power contribution appears around hour 20, temporarily reducing fuel generation needs, followed by a return to fuel-based generation as wind power diminishes. This sequence demonstrates the system's adaptation to renewable resource intermittency while consistently meeting the required load demand through appropriate source switching. The setpoint dynamics over 24 hours for the same simulation are shown in Figure 2 (right). During daytime hours, the photovoltaic setpoint (green) gradually increases to track solar availability. The wind generator setpoint (orange) exhibits two distinct periods of full utilization (setpoint = 1) after hour 15, coinciding with periods of high wind availability. The fuel generator setpoint (red) remains at a low value (~0.1) during the initial hours then it drops to zero during the period of high photovoltaic generation. After sunset (around hour 17), the setpoint increases to approximately 0.25 to compensate for the loss of solar power, with brief adjustments occurring during periods of wind availability. These setpoint patterns reflect the optimization strategy of maximizing renewable resource utilization while minimizing fuel consumption, subject to operational constraints. Case Study 2 (Second Simulation): The second simulation examines system response under partially cloudy conditions with similar wind patterns: • Solar radiation: similar to Case 1 but with a significant reduction from 13:30 to 15:30 due to cloud coverage; • Wind patterns: comparable to Case 1 with two distinct high-availability periods after sunset; • Load profile: maintains the base load of 1.8-2.0 kW during nighttime, but shows different daytime dynamics with higher peak demand around 3.5 kW occurring in the late afternoon. Figure 3 (Left): The combined energy profiles over a 24-hour period for the second simulation. (Right): Control variable (setpoint) evolution of each device over the same period for the second simulation. The wind generator's contribution is particularly significant during two distinct periods after sunset, effectively reducing fuel consumption during these intervals. Figure 3 (right) reveals the control strategy through setpoint manipulation for the same simulation. When daylight becomes available, the PV generator's setpoint rises sharply to about 0.55 and then gradually increases further, showing how the system maximizes solar power 623 utilization. There are two notable periods where the wind generator setpoint reaches its maximum value of 1.0: one brief period around hour 15 and another longer period around hour 17-18. The PV setpoint drops to zero at sunset, at which point the fuel generator's setpoint slightly increases to maintain power balance in the system. Also in this case, the direct relationship between control variables and power generation demonstrates how the implemented control strategy effectively manages resource utilization while ensuring reliable power supply. 5. Conclusions The study demonstrates the successful implementation of a nonlinear optimization approach for power management in hybrid renewable energy systems. The algorithm effectively handles the integration of multiple power sources while maintaining continuous load satisfaction. The results show how the system balances renewable and conventional energy sources through appropriate setpoint control, adapting to varying resource availability and load demands. This robustness in handling different load conditions demonstrates the algorithm's ability to find effective setpoint configurations that maximize the use of renewable resources while minimizing fuel consumption. The research opens several avenues for future developments. A primary improvement will be the integration of energy storage capabilities, which would be particularly useful for managing observed intermittent loads and easing the transition between photovoltaic and fuel energy production. This addition would allow excess energy to be captured during peak production periods for use during phases of high demand or low generation. Acknowledgments Project funded under the National Recovery and Resilience Plan (NRRP), Mission 4 Component 2 Investment 1.3 - Call for tender No. 1561 of 11.10.2022 of Ministero dell’Università e della Ricerca (MUR); funded by the European Union – NextGenerationEU: Award Number: Project code PE0000021, Concession Decree No. 1561 of 11.10.2022 adopted by Ministero dell’Università e della Ricerca (MUR), CUP - I53C22001450006, Project title “Network 4 Energy Sustainable Transition – NEST”. References Andersson, J. A., Gillis, J., Horn, G., Rawlings, J. B., & Diehl, M. (2019). CasADi: a software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11, 1-36. Ansari, M. S., Jalil, M. F., & Bansal, R. C. (2023). A review of optimization techniques for hybrid renewable energy systems. International Journal of Modelling and Simulation, 43(5), 722-735. Hoseinzadeh, S., & Garcia, D. A. (2022). Techno-economic assessment of hybrid energy flexibility systems for islands’ decarbonization: A case study in Italy. Sustainable Energy Technologies and Assessments, 51, 101929. Huang, G., Gan, J., Huang, Y., & Ebrahimian, H. (2024). Optimization of off-grid renewable energy systems using a hybrid version of golden search algorithm. Heliyon, 10(10), e30990. Marocco, P., Novo, R., Lanzini, A., Mattiazzo, G., & Santarelli, M. (2023). Towards 100% renewable energy systems: The role of hydrogen and batteries. Journal of Energy Storage, 57, 106306. Natividad, L. E., & Benalcazar, P. (2023). Hybrid renewable energy systems for sustainable rural development: Perspectives and challenges in energy systems modeling. Energies, 16(3), 1328. Nova, D. D. J. L., Ardila, D. V. G., Villabona, J. A., & Ceron, A. M. R. (2023). Technical, Environmental, and Economic Evaluation of Alternatives for Hybrid Energy Generation for Rational Energy Use Scenarios at the Santander Technological Units Using HOMER Pro Software. Chemical Engineering Transactions, 105, 493- 498. Ramos-Marin, S., Caio, A., & Soares, C. G. (2024). Optimization of a hybrid electricity system in the Canary Islands including marine renewable energies. In Proceedings of the 8th International Hybrid Power Plants & Systems Workshop (HYB 2024), London, UK, May 15-17, 2024, pp. 337-353. IET. San Juan, J. L., & Sy, C. (2023). Target-oriented robust optimization of hybrid energy systems under uncertainty. Chemical Engineering Transactions, 103, 373-378. Silinto, B. F., van der Laag Yamu, C., Zuidema, C., & Faaij, A. P. (2025). Hybrid renewable energy systems for rural electrification in developing countries: A review on energy system models and spatial explicit modelling tools. Renewable and Sustainable Energy Reviews, 207, 114916. Vaccari, M., Mancuso, G. M., Riccardi, J., Cantù, M., & Pannocchia, G. (2019). A sequential linear programming algorithm for economic optimization of hybrid renewable energy systems. Journal of Process Control, 74, 189-201. 624 CET-vol117-b.pdf Optimizing Hybrid Renewable Energy Systems for Enhanced Sustainability and Efficiency in Rural Communities