Evaluation of Biogas and Solar Energy Coupling on Phase-Change Energy-Storage Heating Systems: Optimization of Supply and Demand Coordination

: Biogas heating plays a crucial role in the transition to clean energy and the mitigation of agricultural pollution. To address the issue of low biogas production during winter, the implementation of a multi-energy complementary system has become essential for ensuring heating stability. To guarantee the economy, stability, and energy-saving operation of the heating system, this study proposes coupling biogas and solar energy with a phase-change energy-storage heating system. The mathematical model of the heating system was developed, taking an ofﬁce building in Xilin Hot, Inner Mongolia (43.96000 ◦ N, 116.03000 ◦ E) as a case study. Additionally, the Sparrow Search Algorithm (SSA) was employed to determine equipment selection and optimize the dynamic operation strategy, considering the minimum cost and the balance between the supply and demand of the building load. The operating economy was evaluated using metrics such as payback period, load ratio, and daily rate of return. The results demonstrate that the multi-energy complementary heating system, with a balanced supply and demand, yields signiﬁcant economic beneﬁts compared to the central heating system, with a payback period of 4.15 years and a daily return rate of 32.97% under the most unfavorable working conditions. Moreover, the development of a daily optimization strategy holds practical engineering signiﬁcance, and the optimal scheduling of the multi-energy complementary system, with a balance of supply and demand, is realized.


Introduction
With the advancement of society, there is a growing demand for energy, leading to the continuous transformation of the energy structure.Currently, fossil energy constitutes the largest proportion of the overall energy structure [1].However, due to the non-renewable nature of fossil energy and its detrimental impact on the environment, it has become a bottleneck for economic and social development [2][3][4].As a major energy consumer, the building sector urgently requires the coordinated development of energy, the economy, and environmental protection.In this context, sustainable energy development becomes an inevitable choice, with renewable energy being the only path towards achieving sustainability in the building sector.
Winter heating is of great importance to residents in northern China [5].The utilization of clean and efficient renewable energy heating technology not only contributes to the energy transformation of buildings, but also plays a crucial role in creating a healthy and comfortable living environment [6].As China is a country with a significant agricultural sector, the application of biomass energy in building heating is a valuable approach to realizing the transformation and upgrading of the energy system [7,8].In recent years, the breeding industry has witnessed large-scale and concentrated operations, and the utilization of farm manure as a raw material for biogas production has effectively improved the efficiency of biomass energy utilization while addressing agricultural pollution [9,10].Picardo et al. [11] integrated a sewage treatment plant with a district heating system, demonstrating an annual reduction potential of 1.8 MtCO2e through the operation of the sewage-biogas heating system.Xu et al. [12] designed a biogas building energy supply system, considering variations in outdoor temperature and humidity.This research revealed that lower outdoor temperatures resulted in better energy conservation, with an energy conservation rate of 37% during winter.
However, due to the low outdoor temperatures in winter, biogas production is insufficient to meet the thermal demands of individual users.Therefore, the integration of other renewable energy systems for auxiliary heating becomes necessary [13][14][15].Alkhamis et al. [16] coupled solar energy with biogas reactors to provide the necessary heat for biogas production, achieving an internal rate of return (IRR) of 32.7% on the investment in the solar system.Tiwari et al. [17] conducted research on photovoltaic thermal integration systems for biogas heating, demonstrating that the addition of solar energy increased biogas production.Xue et al. [18] integrated a biogas power generation system with an energy-storage system, resulting in a payback time of 4.35 years, which is a reduction compared to traditional systems.In this context, the design of a multi-energy complementary system coupled with biogas and incorporating a heat-storage device becomes a promising approach to ensure system stability.
Given the complex structure and various operating conditions of heating systems, optimizing the configuration and scheduling strategy is crucial to ensuring system economy and stability [19,20].Cao et al. [21] developed a novel biogas-cogeneration system and utilized genetic algorithms to optimize significant design parameters, achieving a winwin situation in terms of economy and energy efficiency.Arslan et al. [22] modeled a combined heat, electricity, and gas supply system for a biogas power plant, analyzing the distribution of electricity, heating, and cooling load at optimal cost.The results presented a 39.5% increase in the overall energy efficiency of the plant.Castley et al. [23] proposed an integrated energy-supply system consisting of an anaerobic tank and a biogas boiler, optimizing the scheduling of eight working conditions and reducing system emissions by as much as 93.7%.However, many studies have neglected the dynamic performance of the relationship between supply and demand, as modeling each component of the system poses significant challenges [24][25][26].Therefore, achieving a balance between supply and demand scheduling under all working conditions is crucial for a multi-energy coupled phase-change heat-storage heating system.
In summary, to address the research challenges related to low biogas production in winter, the imbalance between supply and demand in heating systems, and the dynamic coordination of a multi-energy complementary system, we propose a comprehensive heating system that couples biogas and solar energy.We dynamically simulate the user-side demand load and establish a mathematical model for all working conditions of the heating system.The SSA algorithm is employed to optimize the cost and operation scheduling of the multi-energy complementary heat-storage system, enhancing the balance between supply and demand while improving the system's economy and the energy-supply distribution of solar energy and biogas.This approach facilitates the green transformation of building heating, achieves high economic efficiency and zero energy waste, and guides practical projects.

Case Study
In this study, we selected an office building in Xilin Hot, Inner Mongolia (43.96000 • N, 116.03000 • E) as the research subject.The building consists of three stories with floor heights of 3.9 m.The total heating area of the building is 6836 m 2 , with a physical coefficient of 0.40 and a ratio of transparent area with respect to the total of 0.28.The architectural model is depicted in Figure 1.The parameters of the envelope structure are presented in Table 1.Furthermore, the three-dimensional measurements of the building model are summarized in Table 2.

Case Study
In this study, we selected an office building in Xilin Hot, Inner Mongolia (43.96000°N, 116.03000°E) as the research subject.The building consists of three stories with floor heights of 3.9 m.The total heating area of the building is 6836 m 2 , with a physical coefficient of 0.40 and a ratio of transparent area with respect to the total of 0.28.The architectural model is depicted in Figure 1.The parameters of the envelope structure are presented in Table 1.Furthermore, the three-dimensional measurements of the building model are summarized in Table 2.

Paramerters Se ing
The design parameters were determined based on the design specifications and heating drawings.The design temperature for the Xilin Hot heating building is −27 °C outside and 18 °C inside.Additionally, the parameters for personnel, electrical equipment, lighting equipment, and other factors are provided in Table 3, which is from the public building energy-saving design standards and the actual situation of the office building.The per capita office area and the power density of the electrical and lighting equipment are 12 m 2 , 14 W•m −2 , and 220 lx, respectively.The building ventilation frequency was set at 0.5 ac•h −1 .To simulate the hourly heating load, we used EnergyPlus 9.3.0software.

Paramerters Setting
The design parameters were determined based on the design specifications and heating drawings.The design temperature for the Xilin Hot heating building is −27 • C outside and 18 • C inside.Additionally, the parameters for personnel, electrical equipment, lighting equipment, and other factors are provided in Table 3, which is from the public building energy-saving design standards and the actual situation of the office building.The per capita office area and the power density of the electrical and lighting equipment are 12 m 2 , 14 W•m −2 , and 220 lx, respectively.The building ventilation frequency was set at 0.5 ac•h −1 .To simulate the hourly heating load, we used EnergyPlus 9.3.0software.

Heating System
In this study, a phase-change energy-storage heating system coupled with biogas and solar energy is proposed, and the municipal central heating system is taken as the benchmark against which to compare the cost and energy saving.During the biogas production process, the fermentation temperature is significantly affected by the cold winter environment, which poses challenges to the stability of the biogas system.However, Xilin Hot benefits from abundant solar-energy resources, and coupling with the solarenergy system optimizes the efficiency of biogas production.Moreover, solar energy is subject to time and weather limitations, necessitating the use of phase-change heat-storage devices to address intermittency and discontinuity issues.Additionally, electricity is employed as an auxiliary heat source to cope with extreme weather conditions.Therefore, this study proposes a biogas and solar energy coupling and complementary phase-change energy-storage heating system, as illustrated in Figure 2. A portion of the solar energy and electricity is distributed to the building, while another portion is used to heat the biogas digester to enhance biogas production.Simultaneously, the phase-change heat-storage system ensures the stability of renewable energy and the utilization of off-peak electricity.The generated biogas is converted into heat energy through biogas boilers to provide thermal energy to users, thereby increasing the proportion of renewable energy in heating the building.The main components of the system include a solar collector, electric boiler, phase-change accumulator, heat collecting water tank, biogas digester, heating coil, biogas boiler, biogas purification device, water pump, and other accessories.
The energy flow process of the system is depicted in Figure 3, which is divided into four layers: energy input, transformation, storage, and utilization.The energy input layer comprises solar energy, biomass energy, and electric energy, which are converted into heat energy by the solar collector, biogas boiler, and electric boiler, respectively.The thermal energy generated by the biogas boiler is directly transmitted to the thermal users, while the solar and electric boilers convert a portion of the thermal energy to provide building heating.The remaining thermal energy is stored in a phase-change accumulator to heat the biogas coils.The energy flow process of the system is depicted in Figure 3, which is divided into four layers: energy input, transformation, storage, and utilization.The energy input layer comprises solar energy, biomass energy, and electric energy, which are converted into heat energy by the solar collector, biogas boiler, and electric boiler, respectively.The thermal energy generated by the biogas boiler is directly transmi ed to the thermal users, while the solar and electric boilers convert a portion of the thermal energy to provide building heating.The remaining thermal energy is stored in a phase-change accumulator to heat the biogas coils.

System Model
Based on the biogas and solar coupled heating system, we established a mathematical model consisting of the biogas production, solar collector, biogas boiler, electric boiler and phase-change heat accumulator models [27].
Biogas production model: Biogas production is influenced by various factors, including feed amount, fermentation temperature, and external environmental temperature.Fei et al. investigated the gas production process of biogas in livestock farms and found a significant linear relationship between biogas production and feed volume [28], which can be represented as follows:  The energy flow process of the system is depicted in Figure 3, which is divided into four layers: energy input, transformation, storage, and utilization.The energy input layer comprises solar energy, biomass energy, and electric energy, which are converted into heat energy by the solar collector, biogas boiler, and electric boiler, respectively.The thermal energy generated by the biogas boiler is directly transmi ed to the thermal users, while the solar and electric boilers convert a portion of the thermal energy to provide building heating.The remaining thermal energy is stored in a phase-change accumulator to heat the biogas coils.

System Model
Based on the biogas and solar coupled heating system, we established a mathematical model consisting of the biogas production, solar collector, biogas boiler, electric boiler and phase-change heat accumulator models [27].
Biogas production model: Biogas production is influenced by various factors, including feed amount, fermentation temperature, and external environmental temperature.Fei et al. investigated the gas production process of biogas in livestock farms and found a significant linear relationship between biogas production and feed volume [28], which can be represented as follows:

System Model
Based on the biogas and solar coupled heating system, we established a mathematical model consisting of the biogas production, solar collector, biogas boiler, electric boiler and phase-change heat accumulator models [27].
Biogas production model: Biogas production is influenced by various factors, including feed amount, fermentation temperature, and external environmental temperature.Fei et al. investigated the gas production process of biogas in livestock farms and found a significant linear relationship between biogas production and feed volume [28], which can be represented as follows: where V m represents the biogas output, a and b are the fitting coefficients (14.24 and 772.42, respectively), and m represents the feed amount.
To ensure biogas production, a spiral coil is used to heat the biogas slurry.The heat (Q heating ) required by the biogas project includes the heat needed for heating the feed (Q 1 ), the heat dissipated by the fermentation tank (Q 2 ), the heat carried away by the discharged water vapor (Q 3 ), and the heat carried away by the discharged biogas (Q 4 ): where c represents the specific heat capacity of the biogas slurry, T m represents the production temperature (35 • C), and T s represents the feed temperature (10 • C).
Here, K represents the heat-transfer coefficient, S represents the area, and T e is the ambient temperature.
The heat dissipated by the fermentation tank includes the bottom, wall, and top of the tank, taking the expressions as follows: where W w represents the mass flow of water vapor carried by biogas flow, calculated using Equation ( 6); H w represents the latent heat value of the vaporization of water vapor at fermentation temperature (2.42 MJ/kg at 35 • C); c w is the specific heat capacity of water vapor (1.886 kJ/(kg• • C)); t a represents the outside air temperature; V represents the effective volume of the fermenter; and f represents the proportion of biogas volume relative to the volume of discharged biogas (65% in this case).
Biogas boiler model: where Q biogas represents the amount of biogas provided for building heating, (1 )V m represents the amount of biogas after purification, q m represents the calorific value of biogas (20,514 kJ/m 3 ), and η b represents the efficiency of the biogas boiler (90% in this case).Electric boiler model: where Q valley and Q flat represent the amount of valley and flat electricity provided for building heating and biogas production, E valley and E flat are the consumption of valley electricity and flat electricity, and η e and η w represent the energy efficiency of the electric boiler and heat-storage device (92% and 90%, respectively).Solar energy collector model: where Q solar presents the amount of solar energy provided for building heating and biogas production, η s represents the comprehensive operating efficiency of the solar collector heating season (49.8%),A is the area of the solar collector, I s represents the solar radiation intensity, and t s represents the direct solar time.According to the geographical location of Xilin Hot, the tilt angle of the solar collector installation is 35 • and the azimuth is 0 • (due south).
Phase-change accumulator model: Paraffin is utilized as PCM and heat transfer is enhanced by heat pipes, where Q pcm represents the heat-storage capacity of the phase-change accumulator, Q sensible represents the sensible heat, Q latent represents the latent heat, c P , m, ∆T p , ∆H and f represent the specific heat, mass, variation temperature, unit mass latent heat, and liquid phase rate of the paraffin, respectively.
The thermal balance of the building: where Q building represents the heat load of the building.

Minimum Cost Optimization
The objective of system optimization is to efficiently allocate daily energy distribution to minimize heating system costs.The objective function, denoted as F min , is the sum of the initial investment (F invest ) and operating cost (F operation ), and the optimal design parameter of the system is determined by minimizing this objective function.
where n represents the number of operating days, calculated as the product of heating days and operating years (183 × 15).The initial investment for the system includes the costs of the biogas boiler (F biogas ), electric boiler (F electric ), solar collector (F solar ), phase-change heat accumulator (F pcm ), and other attachments (F at ). Considering the heating demand in rainy weather, the biogas boiler and electric boiler need to meet the most unfavorable heating conditions, and the size and capacity of the fixed cost of each component are determined accordingly.The operating cost of the system includes the cost of biogas purification (F b ), peak and valley electricity costs, maintenance cost (F main ), and labor cost (F labor ), as shown in Table 4.In summary, the objective function F min can be expressed as a function of the variable Q solar , Q pcm , Q biomas , Q valley , and Q flat : Additionally, the following constraints apply: Building thermal balance constraint: Solar heat collection area constraint: Phase-change heat-storage constraint: Biogas production constraint: Once the equipment selection and initial investment are determined, the minimum daily costs of biogas heat production, solar heat production, and peak-valley electricity for heat production are given by the following: (18) Subject to the following constraint conditions:

Optimization Algorithm
The sparrow search algorithm (SSA) is a swarm optimization method [29].It simulates the foraging and anti-predation behaviors of sparrow groups.The population consists of three types of sparrows: producers, scroungers, and afraid sparrows.Producers provide food sources and foraging directions, accounting for approximately 10-20% of the population.Scroungers, comprising about 80-90% of the population, compete for food resources and have a high feed intake.During foraging, producers and scroungers remain vigilant against predators.When danger arises, 10-20% of sparrows become afraid sparrows, sounding the alarm, and quickly move to safe areas to secure better positions.
To begin, a sparrow matrix is established: where d represents the issue dimension and n represents the number of sparrows.Meanwhile, population fitness is determined using Equation ( 21): In SSA, priority is given to the best individuals within the group during the search process.As producers, they have access to a larger foraging search area compared to scroungers.During each iteration, the position of the producer is updated as follows: where X t i,j represents the position of the i-th sparrow; α represents a random number distributed in range (0, 1]; R 2 represents an alarm value in range [0, 1]; ST is the care threshold within a smaller range of [0.5, 1]; Q is a random number from a normal distribution; and L is a 1 × d matrix of size d with entries of 1.If the alarm value exceeds the safety threshold, all sparrows move to a safe area.Scroungers keep an eye on the producers and immediately leave their current positions to compete for better food when producers find it.The rules for updating scroungers are as follows: where β represents the step size; K represents a random number between [−1, 1]; f i , f g and f w represent the fitness value of the present individual, the present optimum fitness value, and the worst globally observed fitness value, respectively; and ε is a constant that approaches 0. The flowchart for SSA is shown in Figure 4.
Buildings 2023, 13, 2712 10 of 17 fitness value, and the worst globally observed fitness value, respectively; and  is a constant that approaches 0. The flowchart for SSA is shown in Figure 4.

Building Heat Load and Initial Investment
Figure 5 illustrates the hourly and daily heat load during the 2022-2023 heating season in Xilin Hot.The heating period in Xilin Hot spans from October 15th to April 15th, totaling 183 days.The data demonstrate that the overall heat load exhibits a peak over time, with the highest load occurring in January, reaching a maximum of 8567.37 kWh on January 11th.Additionally, the load during the initial and final heating periods is significantly smaller.The simulation results reveal that there are 15 days with a heat load exceeding 6000 kWh, 105 days with a load ranging between 2000 kWh and 6000 kWh, and 60 days with a load below 2000 kWh.This highlights the potential of the load distribution in a multi-energy complementary system with coordinated supply and demand to meet building heat-load requirements and reduce heating energy consumption.To meet the design requirement of at least 70% biogas heating for the building under the most unfavorable working conditions, the initial investment is considered in the selection of minimum daily operating costs, as summarized in Table 5. design requirement of at least 70% biogas heating for the building under the most unfavorable working conditions, the initial investment is considered in the selection of minimum daily operating costs, as summarized in Table 5.Based on the heating cost of public buildings in Xilin Hot, which is CNY 5.5/m 2 per month, the estimated annual heating cost of the office building amounts to approximately CNY 22,588.The equipment selection was carried out based on the optimization algorithm for solar-energy heating and phase-change heat storage, in order to obtain the initial investment under various working conditions.Subsequently, the annual operating cost of optimal scheduling for the balance of supply and demand was calculated under each working condition selection, and the investment payback periods are presented in Figure 6.
The results indicate that the initial investment gradually decreases with the considered daily thermal load, while the operating cost decreases due to the utilization of solar-energy collectors and phase-change devices.The payback period of the six working conditions exhibits a tendency of initially declining and then rising.Notably, under working condition D, the investment recovery period is the shortest.In this case, the solar-heating panel covers an area of 677 m 2 , the investment in the phase-change heat accumulator amounts to CNY 352.64 thousand, and the cost is recovered in just 4.15 years.These results strongly demonstrate the crucial role of considering the balance between supply and demand in reducing initial investment and operating costs.working condition selection, and the investment payback periods are presented in Figure 6.The results indicate that the initial investment gradually decreases with the considered daily thermal load, while the operating cost decreases due to the utilization of solar-energy collectors and phase-change devices.The payback period of the six working conditions exhibits a tendency of initially declining and then rising.Notably, under working condition D, the investment recovery period is the shortest.In this case, the solar-heating panel covers an area of 677 m 2 , the investment in the phase-change heat accumulator amounts to CNY 352.64 thousand, and the cost is recovered in just 4.15 years.These results strongly demonstrate the crucial role of considering the balance between supply and demand in reducing initial investment and operating costs.

Energy Distribution under the Coordination of Supply and Demand
To visualize the energy distribution of a multi-energy complementary heating system, Figure 7 displays the daily amounts of biogas, solar, and electricity used in heating.Additionally, the thermal production above the heat-load curve represents the heat used for biogas production.During the first and last heating months, when there is less heatload demand, solar energy predominantly provides the heat.This is due to the combination of solar energy and phase-change heat-storage devices, which can meet the building's heat load throughout the day.In the remaining four heating months, with a thermal load ranging between 2000 kWh and 7000 kWh, most of the solar energy is utilized for biogas production, with a small portion used for building heating.The optimization algorithm is employed to achieve the minimum cost of energy consumption ratio.Under working conditions exceeding 7000 kWh, the amount of biogas heated using solar energy needs to be combined with valley power heat storage and peak power direct supply to meet the requirements of biogas heating and building heat load.In rainy weather, when the work of solar collectors is not considered, valley electric heat storage is used for heating biogas.By considering the coordination of supply and demand, the heat-supply system achieves a rational distribution and optimal operation under multiple working conditions.

Energy Distribution under the Coordination of Supply and Demand
To visualize the energy distribution of a multi-energy complementary heating system, Figure 7 displays the daily amounts of biogas, solar, and electricity used in heating.Additionally, the thermal production above the heat-load curve represents the heat used for biogas production.During the first and last heating months, when there is less heat-load demand, solar energy predominantly provides the heat.This is due to the combination of solar energy and phase-change heat-storage devices, which can meet the building's heat load throughout the day.In the remaining four heating months, with a thermal load ranging between 2000 kWh and 7000 kWh, most of the solar energy is utilized for biogas production, with a small portion used for building heating.The optimization algorithm is employed to achieve the minimum cost of energy consumption ratio.Under working conditions exceeding 7000 kWh, the amount of biogas heated using solar energy needs to be combined with valley power heat storage and peak power direct supply to meet the requirements of biogas heating and building heat load.In rainy weather, when the work of solar collectors is not considered, valley electric heat storage is used for heating biogas.By considering the coordination of supply and demand, the heat-supply system achieves a rational distribution and optimal operation under multiple working conditions.Figure 8 further illustrates the distribution of solar energy and electricity between biogas production and building heating.From the first heating month to the third heating month, the heat utilized for biogas production continues to increase.This is because the heating demand of the building increases as the weather gets colder, and solar energy alone cannot meet the heat demand of thermal users.The use of direct electricity for heating supply is not conducive to economical operation.From the fourth month until the end of the heating period, the amount of solar energy used for building heating gradually increases as the temperature rises.Moreover, in rainy weather, the highest benefit is achieved when electricity is used to fully heat the biogas without providing building heating.The coordinated operation of solar energy and electric power facilitates the formulation of daily operation strategies and improves the energy efficiency and economy of the heating system.Figure 8 further illustrates the distribution of solar energy and electricity between biogas production and building heating.From the first heating month to the third heating month, the heat utilized for biogas production continues to increase.This is because the heating demand of the building increases as the weather gets colder, and solar energy alone cannot meet the heat demand of thermal users.The use of direct electricity for heating supply is not conducive to economical operation.From the fourth month until the end of the heating period, the amount of solar energy used for building heating gradually increases as the temperature rises.Moreover, in rainy weather, the highest benefit is achieved when electricity is used to fully heat the biogas without providing building heating.The coordinated operation of solar energy and electric power facilitates the formulation of daily operation strategies and improves the energy efficiency and economy of the heating system.

System Benefit Analysis
Figure 9 presents the operation and maintenance costs and daily returns of the supply and demand coordination system.In general, the daily return rates exceed 30%, with the biogas purification cost being the main expense, accounting for 93.68% of the annual operating cost.Additionally, electricity consumption occurs when the load exceeds 7000 kWh.The cost of electricity is also taken into account during rainy weather.When the solar load meets the heating demand, the daily cost consists solely of the maintenance cost, resulting in a daily income of CNY 1219.06 and a return rate as high as 98.89%.As the temperature continues to decrease, the operating cost increases, reaching its highest point of CNY 826.28 on January 11th, with a return rate of 32.97%.In summary, the demand for heating directly determines the daily return, and the rational distribution of heating energy is crucial for improving the return rate.

System Benefit Analysis
Figure 9 presents the operation and maintenance costs and daily returns of the supply and demand coordination system.In general, the daily return rates exceed 30%, with the biogas purification cost being the main expense, accounting for 93.68% of the annual operating cost.Additionally, electricity consumption occurs when the load exceeds 7000 kWh.The cost of electricity is also taken into account during rainy weather.When the solar load meets the heating demand, the daily cost consists solely of the maintenance cost, resulting in a daily income of CNY 1219.06 and a return rate as high as 98.89%.As the temperature continues to decrease, the operating cost increases, reaching its highest point of CNY 826.28 on January 11th, with a return rate of 32.97%.In summary, the demand for heating directly determines the daily return, and the rational distribution of heating energy is crucial for improving the return rate.

Conclusions
Based on an office building in Xilin Hot, this paper presents the establishment of a biogas and solar energy coupling and complementary phase-change energy-storage heating system and proposes operation optimization strategies based on balancing supply and demand.The main conclusions are as follows: (1) Utilizing the SSA algorithm, the minimum cost under six working conditions is determined.Combined with the annual operating cost of the heating season under different working conditions, it is found that, when the solar collector area is 677 m 2 and the capacity of the phase-change heat accumulator is 1900 kWh, the shortest payback period is 4.15 years.This system achieves remarkable economic benefits and zero waste of system energy at the same time.
(2) The daily return rate of the multi-energy complementary heating system exceeds 30%, with biogas purification accounting for 93.68% of the operating cost.When solar energy fully meets the heating demand, the daily return reaches as high as 98.89%.In addition, it can be seen that the optimal dispatch, under the coordination of supply

Conclusions
Based on an office building in Xilin Hot, this paper presents the establishment of a biogas and solar energy coupling and complementary phase-change energy-storage heating system and proposes operation optimization strategies based on balancing supply and demand.The main conclusions are as follows: (1) Utilizing the SSA algorithm, the minimum cost under six working conditions is determined.Combined with the annual operating cost of the heating season under different working conditions, it is found that, when the solar collector area is 677 m 2 and the capacity of the phase-change heat accumulator is 1900 kWh, the shortest payback period is 4.15 years.This system achieves remarkable economic benefits and zero waste of system energy at the same time.(2) The daily return rate of the multi-energy complementary heating system exceeds 30%, with biogas purification accounting for 93.68% of the operating cost.When solar energy fully meets the heating demand, the daily return reaches as high as 98.89%.In addition, it can be seen that the optimal dispatch, under the coordination of supply and demand, has significant economic and energy benefits compared with the benchmark municipal heating system.(3) The energy distribution strategy, which is based on the balance of supply and demand, ensures the production of biogas and the economic operation of the system.Meanwhile, the flexible scheduling of the system brings a large cost recovery rate for the building.This provides valuable guidance for practical projects.

Figure 2 .
Figure 2. Biogas and solar energy coupling and complementary phase-change energy-storage heating system.

Figure 2 .
Figure 2. Biogas and solar energy coupling and complementary phase-change energy-storage heating system.

Figure 2 .
Figure 2. Biogas and solar energy coupling and complementary phase-change energy-storage heating system.

Figure 4 .Figure 5
Figure 4.The flow diagram of SSA. 4. Results and Discussion 4.1.Building Heat Load and Initial Investment Figure 5 illustrates the hourly and daily heat load during the 2022-2023 heating season in Xilin Hot.The heating period in Xilin Hot spans from October 15th to April 15th, totaling 183 days.The data demonstrate that the overall heat load exhibits a peak over time, with the highest load occurring in January, reaching a maximum of 8567.37 kWh on January 11th.Additionally, the load during the initial and final heating periods is signifi-

Figure 4 .
Figure 4.The flow diagram of SSA.

Figure 6 .
Figure 6.Initial investment and payback period under different working conditions.

Figure 6 .
Figure 6.Initial investment and payback period under different working conditions.

Buildings 2023, 13 , 2712 13 of 17 Figure 7 .
Figure 7. Heat production of different energy sources under coordinated supply and demand scheduling.

Figure 7 .
Figure 7. Heat production of different energy sources under coordinated supply and demand scheduling.

Figure 8 .
Figure 8. Distribution of solar energy and electricity for biogas production and building heating.

Figure 8 .
Figure 8. Distribution of solar energy and electricity for biogas production and building heating.

Figure 9 .
Figure 9. Operation and maintenance cost and daily return of supply and demand coordination system.

Figure 9 .
Figure 9. Operation and maintenance cost and daily return of supply and demand coordination system.

Table 2 .
Three-dimensional measurements of the building model.

Table 2 .
Three-dimensional measurements of the building model.

Table 4 .
Initial investment and operating cost.