# Strategic Resource Planning for Sustainable Biogas Integration in Hybrid Renewable Energy Systems
## 2 Materials and Methods
### Biomass Logistics and Transportation  
Another key aspect of this research is the examination of the economic factors involved in biomass logistics. The cost model accounts for various expenses, including the cost of the biomass itself and the transportation costs associated with moving the biomass from local farms to the biogas reactor. These costs are critical in assessing the overall feasibility and efficiency of the system, as both the availability and cost of biomass and transportation logistics directly impact the sustainability and economic viability of the biogas production process. All cost calculations are directly linked to the biomass input, incorporating both the cost of the biomass and the transportation expenses required for its delivery, as outlined in Equation (12):  
\[Total\ Cost=\sum\text{{Biomass}}\ Amount\times\text{{Biomass}}\ Cost+\sum \left[\frac{\text{{Biomass}}\ Amount}{\text{{Truck}}\ Capacity}\right]\times \text{{Trip}}\ Cost \tag{12}\]  
where Biomass Amount refers to the total biomass delivered to the reactor in each entry and Biomass Cost reflects the local availability of agricultural by-products, such as animal waste from nearby farms. It is set at USD 0.033 per kg due to its low market value. This cost is based on inquiries from local farmers, which aligns with other references [29]. Truck Capacity is the maximum amount of biomass a truck can transport per trip, and Trip Cost covers transportation expenses per trip, including fuel, labor, etc. To simplify calculations and reduce computational load, the biomass input amounts are discretized to match standard truck capacities of 5, 10, 15, 20, and 25 tons. This ensures the model is easier to manage and simulates realistic logistics more accurately. The approach reflects practical transportation from farms to the reactor by aligning biomass inputs with full truckloads. It prevents the added cost of making trips for loads smaller than the truck's capacity, optimizing transportation efficiency and reducing unnecessary costs. In this case, Equation (12) is modified to Equation (13), which is now based on truck capacity. This equation also allows combining different truck types for a single biomass input, optimizing transportation by incorporating trucks with various capacities:  
\[Total\ Cost=\sum\text{{T}}\text{{T}}\text{{T}}\text{{T}}\text{{T}}\text{{T}} \text{{T}}\text{{T}}\text{{T}}\text{{T}}\text{{T}}\  
\(O.F.=Min(Total\ Cost)\): The goal is to minimize the total cost, including the cost of biomass and transportation. \(Q_{Total}\leq Q_{Cumulative}\): The constraint should ensure that the total biogas produced equals the required gas demand for the year. This guarantees that the cumulative biogas production meets or exceeds the energy needs, ensuring no shortfall in supply over the annual period. Naturally, the closer the total output is to the total demand, the less waste or gas will be released, minimizing losses and improving overall efficiency. To address the potential gaps in the production schedule, it is essential to highlight that the first condition does not fully cover all the technical requirements. This is because, while the total biogas produced over the year might be more than the total demand, there could still be shortfalls during specific periods where production does not align with immediate demand. Therefore, another condition is necessary to ensure the energy demand is fully met without any unmet need. \(UDR=0\): This condition ensures that all energy demand is fully met without a shortfall. Essentially, this aligns with the first condition, which guarantees that the total biogas produced is sufficient to meet the annual gas demand. \(\sum_{i=1}^{N}m_{i}\leq M_{Available}\): This constraint represents the limitation on biomass availability. The total biomass used cannot exceed the available biomass defined by the municipality's resources. \(\frac{\sum_{i=1}^{N}m_{i}}{\rho}\leq V_{Reactor}\): This constraint refers to the reactor's volume limitation.