# Strategic Resource Planning for Sustainable Biogas Integration in Hybrid Renewable Energy Systems
## 2 Materials and Methods
### Considered Scenarios  
Two scenarios have been considered to thoroughly examine the system's performance, governing conditions, and equations. The first represents normal conditions, where the system supplies a fixed daily power demand. The second scenario addresses an emergency condition, simulating a situation where, for one month, other renewable sources are offline, leaving biogas as the only energy provider. This setup allows for a comprehensive evaluation of the system's resilience under both standard and high-demand conditions.  
Scenario 1: As mentioned, a 200 kW generator has been designated to produce biogas electrical energy. It has been planned for this generator to operate at its maximum capacity for 12 h each day, specifically during solar energy production from PV panels, which is not available due to the absence of sunlight. This ensures a continuous energy supply even during non-sunlight hours. In this situation, the needed electrical energy is calculated using Equation (14):  
\[E_{Electrical}=P_{Electrical}\times t=200\text{ kW}\times 12\frac{\text{h}}{ \text{day}}=2400\frac{\text{kWh}}{\text{day}} \tag{14}\]  
This is the total electrical energy needed per day. However, the generator's efficiency requires more biogas energy input than electrical output. With an internal combustion engine coupled to a generator with an efficiency of 29%, the energy of biogas needed is calculated using Equation (15):  
\[E_{Biogas}=\frac{E_{Electrical}}{\eta_{Engine}}=\frac{2400\frac{\text{kWh}}{ \text{day}}}{0.29}=8276\frac{\text{kWh}}{\text{day}} \tag{15}\]  
This is the actual energy that needs to be produced from biogas to supply the daily 2400 kWh of electrical energy. To calculate how much biogas is needed, it has been assumed that the biogas contains 60% methane and has a lower heating value (LHV) of 5.6 kWh per normal cubic meter \(\left(\text{Nm}^{3}\right)\). The total biogas volume required is calculated using Equation (16):  
\[Q_{Daily}=\frac{\text{\%}CH_{4}\times E_{Biogas}}{LHV}=\frac{0.6\times 8276 \frac{\text{kWh}}{\text{day}}}{5.6\frac{\text{kWh}}{\text{Nm}^{3}}}=887\frac{ \text{Nm}^{3}}{\text{day}} \tag{16}\]  
This means that the system needs to produce 887 cubic meters of biogas per day to meet the energy demand. Based on this daily biogas requirement, all the requirements for optimizing the problem will be met.  
Scenario 2: In the second scenario, it is assumed that other energy generators will be out of service in July, and the biogas system must operate continuously for 24 h a day to meet the energy demand. This scenario represents a significant increase in biogas consumption compared to the standard operation, where biogas only requires 12 h daily. The additional demand necessitates adjusting the system to maintain a constant energy supply.  
The electrical energy required per day under this condition is calculated using Equation (17):  
\[E_{Electrical}=P_{Electrical}\times t=200\text{ kW}\times 24\frac{\text{h}}{\text{day}}=4800\frac{\text{kWh}}{ \text{day}} \tag{17}\]  
To generate this amount of electricity, the required biogas energy, considering the generator efficiency of 29%, is calculated using Equation (18):  
\[E_{Biogas}=\frac{E_{Electrical}}{\eta_{Engine}}=\frac{4800\frac{\text{kWh}}{ \text{day}}}{0.29}=16552\frac{\text{kWh}}{\text{day}} \tag{18}\]Considering that biogas contains 60% methane and has an LHV of 5.6 kWh/Nm\({}^{3}\), the daily biogas volume required is calculated using Equation (19):  
\[Q_{Daily}=\frac{\%CH_{4}\times E_{Biogas}}{LHV}=\frac{0.6\times 16552\frac{ \text{kWh}}{\text{day}}}{5.6\frac{\text{kWh}}{\text{Nm}^{3}}}=1774\frac{\text{ Nm}^{3}}{\text{day}} \tag{19}\]