Analysis of the Day-ahead Deviation Plan and Research on the Real-time Scheduling of Photovoltaic Greenhouses Based on Exergy Theory

: For the correction problem of day-ahead plan deviation caused by energy prediction deviation in day-ahead scheduling stage of photovoltaic greenhouses, an exergy analysis method is used to propose the deviation model of heat required for photovoltaic greenhouses. Based on the deviation model, a real-time optimization scheduling model is established. The deviation model not only considers the non-negligible exergy loss during heating process of pipes, but also considers the di ﬀ erence between heat and thermal exergy a ﬀ ected by the actual indoor temperature. The goal of the real-time scheduling model is to minimize the absolute value of the di ﬀ erence between the energy supply and demand prediction deviation to be corrected and the adjustment of multi-form energy storage and electric loads, so that develop the real-time adjustment plan of energy storage and electric loads. The analysis results of the actual photovoltaic greenhouse show that of the heat required by a greenhouse based on the exergy theory calculation, the exergy loss of the heating process accounts for about 10%–20% of the total thermal exergy required and it cannot be ignored, so the calculation results can reﬂect the actual heat required more accurately and the greenhouse temperature is more suitable for plant growth. Moreover, the proposed real-time scheduling model can correct the deviation of the day-ahead plan and improve local consumption. The promotion ratio can reach 7%. Finally, the farmers’ electricity purchases cost is reduced. Thereby the e ﬀ ectiveness of the proposed heat deviation model and real-time scheduling model is veriﬁed. optimal scheduling method for microgrids in day-ahead plan following the energy storage state of charge (Soc).


Introduction
Integrated energy systems are an important development direction for future energy systems. They couple multiple energy sources such as electric energy and thermal energy to achieve synergy between the multiple sources [1]. At present, integrated energy systems are commonly used in park-type integrated energy systems, household-type micro-integrated energy systems, photovoltaic greenhouse micro-integrated energy systems derived from the background of poor photovoltaic alleviation [2][3][4] and so on. Generally, the photovoltaic greenhouse micro-integrated energy system includes electric energy, thermal energy, potential energy and so on. In some remote rural areas, solar energy resources are relatively abundant. However, due to the lack of long-distance transmission channels for electric energy and the saturation of the main network for new energy consumption, local consumption of photovoltaic power is particularly important [3,4]. Therefore, how to analyze the energy of micro-integrated energy systems to respond to the change rules of the output power of (10) where ε is the conversion factor of kJ to kWh, and it is 2.778 × 10 −4 ; c ρ is the specific heat capacity at constant pressure of working substance, kJ/(kg·K); T h is the initial thermodynamic temperature of working substance, K; T h,0 is the thermodynamic temperature of reference state. Generally, the average value of the ambient environment at which the system is located is selected as the reference temperature, K.
For working substance a, it has different enthalpy exergy values at two different temperatures. The enthalpy exergy change ∆Ex a of working substance a is the difference between the two different temperatures. Similarly, the enthalpy exergy change ∆Ex b of working substance b can be obtained. When working substance a transfers heat to working substance b, the enthalpy exergy reduction of the working substance a is greater than the enthalpy exergy increase of the working substance b, so there is a difference between the enthalpy exergy change of the two working substances. The difference is the exergy loss when the working substance a transfers heat to the working substance b [20], that is: It can be seen that the exergy loss E 1,t+1 when the working substance of heat source transfers heat to the water in the heating pipes is: (12) where ∆Ex L t+1 is the difference of enthalpy exergy before and after heat transfer of working substance in heat source, kWh; ∆Ex S t+1 is the difference of enthalpy exergy before and after heat transfer of water in heating pipes, kWh.
For the working substance in heat source, the enthalpy exergy difference before and after heat transfer is: where Ex L C,t+1 and Ex L M,t+1 are the enthalpy exergy of the working substance in heat source before and after heat transfer, kWh.
For the water in heating pipes, the enthalpy exergy difference before and after heat transfer is: where Ex S C,t+1 and Ex S M,t+1 are the enthalpy exergy of water before and after heat transfer, kWh. According to Equation (10): Ex L C,t+1 = εm L c L,ρ (T L C,t − T 0,t ) − T 0,t ln T L C,t /T 0,t Ex L M,t+1 = εm L c L,ρ (T L M,t − T 0,t ) − T 0,t ln T L M,t /T 0,t Ex S C,t+1 = εm S c S,ρ (T S C,t − T 0,t ) − T 0,t ln T S C,t /T 0,t Ex S M,t+1 = εm S c S,ρ (T S M,t − T 0,t ) − T 0,t ln T S M,t /T 0,t (15) where ε is same as in Equation (10); m L and m S are the mass of the working substance in the heat source and the water in heating pipes, kg; c L,ρ and c S,ρ are the specific heat capacity at constant pressure of the working substance in heat source and the water in heating pipes, kJ/(kg·K); T L C,t and T L M,t are the temperature of the working substance in heat source before and after heat transfer during t period, K; T S C,t and T S M,t are the temperature of the water in heating pipes before and after heat transfer during t period, K; T 0,t is the indoor temperature of greenhouse during the t period, K.

Exergy Loss Model of Water Friction in the Heating Pipes
The exergy loss E 2,t+1 of water friction in heating pipes is: where ε is that same as in Equation (10); c s,ρ is the same as in Equation (15); S is the cross-sectional area of the heating pipes in the greenhouse, m 2 ; ρ s is the density of the water, kg/m 3 ; ∆T t is the difference between the supply and return water temperature of the heating pipes, K; h f ,t+1 is the pressure drop along the heating pipes during t + 1 period, m. The calculation formula is [21]: where L is the length of the heating pipes, m; D is the inner diameter of the heating pipes, m; V t is the flow rate of the water in the heating pipes during t period, m/s; g is the gravitational acceleration, m/s 2 ; λ is the Darcy coefficient, λ = 64/Re, Re is the Reynolds number which is dimensionless.

The Demand Thermal Exergy Model of Photovoltaic Greenhouse Micro-Integrated Energy System
As shown in Equation (3), the demand heat Q xu,t+1 of the photovoltaic greenhouse micro-integrated energy system can be obtained from the demand thermal exergy E xu,t+1 of greenhouse with Equation (1). That is: where T 0,t is same as in Equation (6); T r2,t is the temperature of the HVAC pipes' water, K. The demand thermal exergy E xu,t+1 of photovoltaic greenhouse micro-integrated energy system is mainly composed of four parts. The first part E x 1,t+1 is the thermal exergy of natural heat dissipation from the greenhouse to the outside. The second part E x 2,t+1 is the increased thermal exergy in the greenhouse because of solar radiation. The third part E x 3,t+1 is the demand thermal exergy to warm the indoor air in the greenhouse to a temperature suitable for plant growth. The last part E x 4,t+1 is the thermal exergy that is to be provided for the reservoir and biogas digester so we can get irrigation water at a certain temperature and warm the biogas slurry in the biogas digester. That is: The thermal exergy model for each part is described below.

The Thermal Exergy Model of Natural Heat Dissipation from the Greenhouse to the Outside
The thermal exergy of natural heat dissipation from the greenhouse to the outside is composed of three parts. The first part E out1,t+1 is the thermal exergy loss caused by heat dissipation of the greenhouse enclosure structures. The second part E out2,t+1 is the thermal exergy loss of air infiltration. The last part E out3,t+1 is the thermal exergy loss of ground heat transfer. That is: 1 The thermal exergy loss caused by heat dissipation of greenhouse enclosure structures The thermal exergy loss caused by heat dissipation of greenhouse enclosure structures is mainly the exergy loss of the greenhouse cover, walls and other enclosure structures caused by indoor and outdoor temperature difference. That is: where n l is the number of layers of the enclosure structures; K str,l is the heat transfer coefficient of the l-th layer, W·m −2 · • C −1 ; A str,l is the enclosure structures' heat transfer area of the l-th layer, m 2 ; T in,t+1 is the design temperature of greenhouse that is suitable for plant growth during t + 1 scheduling period, • C; T out,t is the outdoor temperature during t period, • C; ∆t is the scheduling duration, h.
2 The thermal exergy loss of air infiltration The cold air outside the greenhouse will enter the greenhouse through the gaps of the structures and insulation materials or other opening and closing operations. It is necessary to heat the cold air from the outdoor temperature to the indoor temperature. This part of the thermal exergy is the thermal exergy loss of air infiltration. That is: where c air is the air specific heat capacity coefficient, kWh / (kg· • C); V is the internal volume of the greenhouse, m 3 ; N air is the number of air changes per hour; r air is the bulk density of air under outdoor temperature condition, kg/m 3 ; T in,t+1 and T out,t are same as (21). 3 The thermal exergy loss of ground heat transfer The thermal exergy loss of ground heat transfer is caused by the temperature difference between inside and outside the greenhouse. It is mainly the thermal exergy loss of indoor soil near the outer wall. As the temperature outside the greenhouse has different effects on ground heat transfer in the greenhouse, the ground inside the greenhouse is divided into different areas when calculating the exergy loss. The thermal exergy loss of ground heat transfer is: where K soil,z is the heat transfer coefficient of area z, W·m -2 · • C -1 ; A soil,z is the heat transfer area for area z, m 2 ; T in,t+1 and T out,t are same as in Equation (21).

The Increased Thermal Exergy in the Greenhouse Because of Solar Radiation
The increased thermal exergy in the greenhouse because of solar radiation is composed of two parts. One part is the thermal exergy E soil,t+1 of soil absorption in the greenhouse. The other part is the thermal exergy E wall,t+1 of wall absorption of the greenhouse. That is: 1 The thermal exergy of soil absorption in the greenhouse Assume that solar radiation is evenly distributed throughout the soil in the greenhouse: where η soil is the light absorption efficiency of soil; I soil,t is the solar radiation at the soil during t period, kW/m 2 ; A soil is the soil area in the greenhouse, m 2 .
2 The thermal exergy of wall absorption of the greenhouse Assume that solar radiation is evenly distributed throughout the greenhouse wall: where η wall is the light absorption efficiency of wall; I out w,t is the solar radiation at the outside wall of the greenhouse during t period, kW/m 2 ; A wall is the wall area of the greenhouse that receives solar radiation, m 2 . 3 The demand thermal exergy to warm the indoor air of greenhouse The demand thermal exergy caused by the difference between the actual air temperature of greenhouse and the target temperature for plant growth is: where c air is the same as (22);ρ air is the air density, kg/m 3 ; V is same as in Equation (22); T in,t+1 is the same as in Equation (21), T in,t is the actual indoor temperature of the greenhouse at current moment (t time period), • C. 4 The demand thermal exergy of the biogas digester and reservoir where E Z 4,t+1 is the demand thermal exergy for warming the biogas slurry in biogas digester, kWh; E X 4,t+1 is the demand thermal exergy for warming the water in the reservoir to the target temperature during the t + 1 scheduling period, kWh: where ε is same as in Equation (10); c Z,ρ is the specific heat capacity of biogas slurry in biogas digester, kJ /(kg· • C) ; c S,ρ is the specific heat capacity of water in the reservoir, kJ /(kg· • C) ; m Z,ρ is the mass of biogas slurry in biogas digester, kg; m S,ρ is the mass of water in the reservoir, kg; T Z,t+1 is the design target temperature of biogas slurry in biogas digester during t + 1 scheduling period, • C; T S,t+1 is the design target temperature of water in the reservoir during t + 1 scheduling period, • C; T Z,t is the temperature of biogas slurry in biogas digester during t period, • C; T S,t is the temperature of water in the reservoir during t period, • C.

Objective Function
Energy scheduling based on energy supply and demand forecast is greatly affected by the prediction accuracy. The prediction accuracy is inversely proportional to the time span. The prediction deviation of energy required in this paper mainly refers to the deviation of the heat required ∆Q t+1 for the greenhouse analyzed in Section 2. The prediction deviation of energy supply mainly refers to the difference between the day-ahead predicted value and the real-time predicted value of photovoltaic power generation during the t + 1 period. The real-time scheduling plan should be able to correct the deviation left by the day-ahead plan. This deviation is simply referred to as the day-ahead plan deviation. Therefore, this paper proposes a real-time scheduling model whose objective function is the minimum absolute value of the difference during the scheduling stage. The difference is between the energy supply and demand deviation and the adjustment of energy storage and electric loads: where ∆Q t+1 is the deviation of the heat required for the greenhouse analyzed in Section 2. The deviation is between the day-ahead plan and the real-time scheduling plan during the t + 1 period, which is expressed in formula (2); ∆L PV,t+1 is the difference between the real-time predicted value and the day-ahead predicted value of photovoltaic power generation during the t + 1 period, kWh ; ∆E t+1 is the adjustment of the multi-form energy storage during the t + 1 period. And the adjustment is for the day-ahead plan during the real-time scheduling stage. The increase is positive and the decrease is negative, kWh. ∆E e,t+1 is the adjustment of the electric loads during the t + 1 period aiming at the day-ahead plan. Similarly, the increase is positive and the decrease is negative, kWh.

Constraints
1 Multi-form energy storage adjustment constraint: where E ad_max,t+1 and E de_max,t+1 are the maximum input and output energy of the multi-form energy storage, kWh. The adjustable range of multi-form energy storage is composed of the maximum input energy and the maximum output energy during the t + 1 scheduling stage. It means the maximum allowable increased energy and decreased energy of the multi-form energy storage during the real-time scheduling stage based on the day-ahead plan. The calculation formula is as follows: where E It+1 and E Ot+1 are the input energy and output energy of multi-form energy storage in the day-ahead plan during the t + 1 period, kWh; E Imax and E Omax are got by the maximum input and output power of multi-form energy storage multiplied by the real-time scheduling duration ∆t, kWh. It means multi-form energy storage can be reached the input and output energy value after the real-time scheduling duration ∆t when working at the maximum input and output power; A is the energy storage space of multi-form energy storage; E t is the stored energy of multi-form energy storage during the t period (current time period), kWh. 2 Electric loads adjustment constraint where E de eload_max,t+1 and E ad eload_max,t+1 are the maximum decrease and the maximum increase of the electric loads, kWh.
The adjustable range of electric loads is composed of the maximum increased power consumption and the maximum decreased power consumption. In the photovoltaic greenhouse, the electric loads such as LED fill light, space electric field dehumidification and so on can be appropriately increased or decreased within a certain range. The increased or decreased electric loads have little negative impact on plant growth. Such electric loads are the increased or decreased electric loads. The adjustable range of electric loads means the maximum allowable increased power consumption and decreased power consumption during the real-time scheduling stage based on the day-ahead plan. That is: where m is the number of electric loads that can be increased or decreased in photovoltaic greenhouse; E ad ieload_max,t+1 and E de ieload_max,t+1 are the maximum increased power consumption and the maximum decreased power consumption of the i-th electric load, kWh.

Solution Flow Chart
The flow chart of the real-time scheduling plan is shown in Figure 2. The specific solution steps are as follows: 1 Input day-ahead and real-time solar irradiance, outdoor temperature, electric loads, thermal loads and other data, and input various parameters required in the calculation model; 2 Calculate the heat required deviation ∆Q t+1 , photovoltaic power generation deviation ∆L PV,t+1 and adjustable range of multi-form energy storage in the real-time stage; 3 Judge whether the heat required deviation and photovoltaic power generation deviation in the real-time stage can be offset through the electric-thermal link (the electric-thermal link is the far-infrared heating device by default in this paper). If the offset happens, the multi-form energy storage will not be adjusted. 4 If ∆Q t+1 + ∆L pv,t+1 > 0, it indicates that there is excess energy. The excess energy will be stored within the increased adjustable range of multi-form energy storage. If ∆Q t+1 + ∆L pv,t+1 < 0, it indicates that multi-form energy storage is required to provide the part of energy that is insufficient in the greenhouse. The insufficient energy will be provided within the decreased adjustable range of multi-form energy storage, so as to make the objective function as optimal as possible. 5 Output the adjustment of multi-form energy storage and electric loads.
Energies 2019, 9, x FOR PEER REVIEW 10 of 22 where m is the number of electric loads that can be increased or decreased in photovoltaic greenhouse; are the maximum increased power consumption and the maximum decreased power consumption of the i-th electric load, kWh.

Solution Flow Chart
The flow chart of the real-time scheduling plan is shown in Figure 2. The specific solution steps are as follows: 1 Input day-ahead and real-time solar irradiance, outdoor temperature, electric loads, thermal loads and other data, and input various parameters required in the calculation model; 2 Calculate the heat required deviation  +1 t Q , photovoltaic power generation deviation , +1 PV t L  and adjustable range of multi-form energy storage in the real-time stage; 3 Judge whether the heat required deviation and photovoltaic power generation deviation in the real-time stage can be offset through the electric-thermal link (the electric-thermal link is the farinfrared heating device by default in this paper). If the offset happens, the multi-form energy storage will not be adjusted.
, it indicates that there is excess energy. The excess energy will be stored within the increased adjustable range of multi-form energy storage. If indicates that multi-form energy storage is required to provide the part of energy that is insufficient in the greenhouse. The insufficient energy will be provided within the decreased adjustable range of multi-form energy storage, so as to make the objective function as optimal as possible. 5 Output the adjustment of multi-form energy storage and electric loads.

Begin
Enter original data, Real-time solar irradiance, outdoor temperature, electric loads data Indoor target temperature for each scheduling stage Necessary greenhouse calculation factors Day-ahead plan data on energy storage, electric loads, thermal loads and so on.
Calculate greenhouse data for each scheduling Stage, The deviation of the heat required The deviation of the photovoltaic output The adjustable range of energy s torage an d electric loads The increased energy range is The decreased energy range is Calculate the value of ( The excess heat is stored in multi-form energy storage, and the objective function reaches the optimal solution 0.
First, store the heat in one multi-form energy storage. Then store the remaining heat in other multi-form energy storage within the increased range, so that the objective function is optimal as much as possible.
The multi-form energy storage releases heat . so that the objective function reaches the optimal solution 0.
First, one multi-form energy storage releases heat . Then other multi-form energy storage can release the remaining heat within the decreased range, so that the objective function is optimal as much as possible.
Output the adjustment of multi-form energy storage and electric loads

Basic Data of System and Example Design
An actual photovoltaic greenhouse micro-integrated energy system in rural areas of western China is used as an example. The system structure is shown in Figure 3.

Basic Data of System and Example Design
An actual photovoltaic greenhouse micro-integrated energy system in rural areas of western China is used as an example. The system structure is shown in Figure 3.  For the photovoltaic greenhouse micro-integrated energy system, the external part is connected to the distribution network. The internal part is mainly composed of photovoltaic power, particle energy heat source, multi-form energy storage, heating radiator and various types of loads. The power of the system are photovoltaic power and external distribution network. It can provide the electric energy required by various electric loads of the system. The heat source of the system is mainly particle energy machine that consumes electric energy, so it is both heat source and electric load. It can provide the heat to heat up the greenhouse and store excess energy in the phase change thermal storage device.The multi-form energy storage includes reservoir, biogas digester, storage battery and phase change thermal storage device. The electric loads are mainly particle energy machine, water pump, physical insecticide, LED fill light, space electric field dehumidification, far infrared heating, water and fertilizer integrated fertilization and so on. The heat load is mainly the heat required to warm the greenhouse. The parameters of the main equipment are shown in table 1. In rural areas of western China, sunny days account for about two-thirds in winter. According to the historical weather conditions, the paper selects the actual production activities of photovoltaic greenhouse on a winter sunny day (November 10, 2018) as a typical example, so the selected data has a certain representativeness. For the typical day, the paper performs a two-part analysis: For the photovoltaic greenhouse micro-integrated energy system, the external part is connected to the distribution network. The internal part is mainly composed of photovoltaic power, particle energy heat source, multi-form energy storage, heating radiator and various types of loads. The power of the system are photovoltaic power and external distribution network. It can provide the electric energy required by various electric loads of the system. The heat source of the system is mainly particle energy machine that consumes electric energy, so it is both heat source and electric load. It can provide the heat to heat up the greenhouse and store excess energy in the phase change thermal storage device.The multi-form energy storage includes reservoir, biogas digester, storage battery and phase change thermal storage device. The electric loads are mainly particle energy machine, water pump, physical insecticide, LED fill light, space electric field dehumidification, far infrared heating, water and fertilizer integrated fertilization and so on. The heat load is mainly the heat required to warm the greenhouse. The parameters of the main equipment are shown in Table 1. In rural areas of western China, sunny days account for about two-thirds in winter. According to the historical weather conditions, the paper selects the actual production activities of photovoltaic greenhouse on a winter sunny day (November 10, 2018) as a typical example, so the selected data has a certain representativeness. For the typical day, the paper performs a two-part analysis: 1 The thermal exergy calculation and analysis of the photovoltaic greenhouse micro-integrated energy system is performed to verify the effectiveness of the deviation model for a photovoltaic greenhouse. 2 The paper selects one hour as the scheduling duration and performs the real-time scheduling analysis based on [2]. By doing these, the paper corrects the deviation of the day-ahead plan and verifies the effectiveness of the real-time scheduling model.

Basic Data of the Example
The example selects the actual production activities of a photovoltaic greenhouse on a winter sunny day. The solar irradiance curve obtained according to the historical weather data and the measured outdoor ambient temperature curve of the winter sunny day are shown in Figure 4. The thermal exergy calculation and analysis of the photovoltaic greenhouse micro-integrated energy system is performed to verify the effectiveness of the deviation model for a photovoltaic greenhouse. 2 The paper selects one hour as the scheduling duration and performs the real-time scheduling analysis based on [2]. By doing these, the paper corrects the deviation of the day-ahead plan and verifies the effectiveness of the real-time scheduling model.

Basic Data of the Example
The example selects the actual production activities of a photovoltaic greenhouse on a winter sunny day. The solar irradiance curve obtained according to the historical weather data and the measured outdoor ambient temperature curve of the winter sunny day are shown in Figure 4. It can be seen from Figure 4 that the solar irradiance on the winter sunny day has no obvious fluctuation, but has an obvious peak period. It reaches the peak at 12:00-13:00. Before 12:00, the solar irradiance increases hour by hour, and after 13:00, the solar irradiance decreases hour by hour. For the outdoor temperature on the winter sunny day, the temperature difference between day and night is relatively large. At around 14:00, the temperature reaches the highest value, while the temperature at night reaches below zero.
Based on the solar irradiance and outdoor temperature of the winter sunny day mentioned above, the comparison curves between the day-ahead stage and the real-time scheduling stage of photovoltaic power generation are shown in Figure 5.  It can be seen from Figure 4 that the solar irradiance on the winter sunny day has no obvious fluctuation, but has an obvious peak period. It reaches the peak at 12:00-13:00. Before 12:00, the solar irradiance increases hour by hour, and after 13:00, the solar irradiance decreases hour by hour. For the outdoor temperature on the winter sunny day, the temperature difference between day and night is relatively large. At around 14:00, the temperature reaches the highest value, while the temperature at night reaches below zero.
Based on the solar irradiance and outdoor temperature of the winter sunny day mentioned above, the comparison curves between the day-ahead stage and the real-time scheduling stage of photovoltaic power generation are shown in Figure 5. The thermal exergy calculation and analysis of the photovoltaic greenhouse micro-integrated energy system is performed to verify the effectiveness of the deviation model for a photovoltaic greenhouse. 2 The paper selects one hour as the scheduling duration and performs the real-time scheduling analysis based on [2]. By doing these, the paper corrects the deviation of the day-ahead plan and verifies the effectiveness of the real-time scheduling model.

Basic Data of the Example
The example selects the actual production activities of a photovoltaic greenhouse on a winter sunny day. The solar irradiance curve obtained according to the historical weather data and the measured outdoor ambient temperature curve of the winter sunny day are shown in Figure 4. It can be seen from Figure 4 that the solar irradiance on the winter sunny day has no obvious fluctuation, but has an obvious peak period. It reaches the peak at 12:00-13:00. Before 12:00, the solar irradiance increases hour by hour, and after 13:00, the solar irradiance decreases hour by hour. For the outdoor temperature on the winter sunny day, the temperature difference between day and night is relatively large. At around 14:00, the temperature reaches the highest value, while the temperature at night reaches below zero.
Based on the solar irradiance and outdoor temperature of the winter sunny day mentioned above, the comparison curves between the day-ahead stage and the real-time scheduling stage of photovoltaic power generation are shown in Figure 5.   It can be seen from the Figure 5 that the trend of photovoltaic power generation curve is basically consistent with the trend of the solar irradiance curve because there is a linear relationship between photovoltaic power generation and solar irradiance. On this winter sunny day, the deviation of photovoltaic prediction is mainly concentrated between 9:00-13:00. Because the predicted value of the day-ahead photovoltaic power generation is greater than the real-time predicted value during 9:00-10:00, the photovoltaic predicted deviation is negative. The photovoltaic predicted deviation is positive during 11:00-13:00. During the remainder of the period, the day-ahead photovoltaic prediction curve basically coincides with the real-time photovoltaic prediction curve. Overall, the trend of the real-time photovoltaic prediction curve is basically same as the day-ahead curve, and there is no significant fluctuation.

The Thermal Exergy Analysis of the Photovoltaic Greenhouse Micro-Integrated Energy System
According to the analysis in Section 2, the thermal exergy required for the photovoltaic greenhouse is composed of the thermal exergy loss during the heating process of pipes and the demand thermal exergy of the greenhouse. During the heating process of pipes, the exergy loss is related to the indoor temperature of the greenhouse. The suitable temperature for plant growth in the greenhouse is about between 20 • C-30 • C. Each part of the thermal exergy has different change under different indoor temperature. In order to analyze it, this paper selects three different indoor temperatures at three different moments. The three different moments are 10 o'clock (indoor temperature is 20 • C), 20 o'clock (indoor temperature is 25 • C) and 14 o'clock (indoor temperature is 30 • C) of the winter sunny day. Under the above conditions, it calculates the each part of the thermal exergy. The calculated results are shown in Table 2. It can be seen from the Table 2 that there are two types of loss during the heating process of the pipes. They are the exergy loss of the heat transfer between two working substances and the friction exergy loss of water in the heating pipes. The exergy values of heat transfer between the two working substances are different under different indoor temperatures. The higher the indoor temperature, the smaller the exergy loss of the heat transfer between the two working substances (such as E 1,t+1 , E 3,t+1 and E 4,t+1 ). This is determined by Equations (11) to (15). For one of the losses, the values are almost the same at different temperatures. For the three losses, the value of E 1,t+1 is relatively large, but the values are almost the same at the same temperature.The friction exergy loss of water E 2,t+1 in the heating pipes doesn't change with the indoor temperature. This is because it is mainly affected by the flow rate and the temperature difference between the supply water and return water. The friction exergy loss doesn't change when the two factors are certain. Therefore, the exergy loss during the heating process of the pipes will decrease as the indoor temperature increases of the greenhouse. During the whole heating process of the pipes, the exergy loss accounts for about 10%-20% of the total thermal exergy required. Apparently, this part of the exergy loss cannot be ignored.Among the demand thermal exergy of the greenhouse, the thermal exergy of natural radiating E x 1,t+1 from the greenhouse to the outside is the largest among the various components, accounting for the main part of the greenhouse demand thermal exergy. Since the thermal exergy of natural radiating is related to the indoor temperature and the outdoor temperature, the value is not significantly related to the indoor temperature change. Then it is the demand thermal exergy E x 4,t+1 of the biogas digester and reservoir to warm the biogas slurry and water to the target temperature. And it is also a major component of the greenhouse demand thermal exergy. The value is second only to the natural radiating. Since the E x 4,t+1 is related to the temperature of the liquids in the biogas digester and the reservoir during the t scheduling period and the t + 1 scheduling period, the value is not significantly related to the indoor temperature change. For the demand thermal exergy to warm the indoor air of the greenhouse E x 3,t+1 , its value is uncertain because it is affected by the current indoor temperature and design temperature of the next scheduling period (t + 1 period) (Equation (27)). It can be seen from the Table 2 that since the current temperature in the greenhouse is the same as the preset required temperature for the t+1 period, the E x 3,t+1 is zero at 14:00. The solar radiation belongs to the heat source for the greenhouse. So the thermal exergy value E x 2,t+1 of radiation should take a negative value. Because of relating to the solar irradiance, the thermal exergy of solar radiation is even more than E x 1,t+1 and E x 4,t+1 at 14:00 when the solar radiation is strong. The value is zero at 20:00 because the solar radiation is zero. Overall, at three indoor temperatures suitable for plant growth, the total demand thermal exergy of the greenhouse accounts for about 80%-90% of the total thermal exergy required. It is the main part of the thermal exergy required of the greenhouse. From the above analysis, it can be seen that the exergy loss during the heating process of the pipes accounts for 10%-20% of the total thermal exergy required for the greenhouse. This part of the exergy loss cannot be ignored and the analysis verifies the necessity of taking into account the exergy loss during the heating process of the pipes.
In order to obtain the heat required deviation of the greenhouse between the day-ahead plan and the real-time scheduling stage, the paper performs calculation of the day-ahead prediction and the real-time prediction aiming at the typical winter sunny day. Finally, the paper gets the heat required curve of the photovoltaic greenhouse during the day-ahead stage (referred to as the heat required of the day-ahead plan), the thermal exergy required curve during the real-time scheduling stage (referred to as the thermal exergy required of the real-time scheduling) and the corresponding heat curve (referred to as the heat required of the real-time scheduling). The compared curves are as shown in Figure 6. It can be seen from Figure 6 that the curve of the thermal exergy required of the real-time scheduling is lower than the curve of the heat required of the real-time scheduling. This is determined by Equation (1). Equation (1) expresses the relationship between the heat and the thermal exergy affected by the ambient temperature. Then due to the outdoor temperature decreases at night, the indoor temperature also decreases. The greenhouse must provide more thermal exergy to maintain the indoor temperature suitable for plant growth, so the heat required for the real-time scheduling stage of the greenhouse at night is more. In addition, the heat required of the day-ahead plan is lower than the heat required of the real-time scheduling even lower than the thermal exergy required of the real-time scheduling. The reason is that from the point of view of the exergy analysis of this paper, It can be seen from Figure 6 that the curve of the thermal exergy required of the real-time scheduling is lower than the curve of the heat required of the real-time scheduling. This is determined by Equation (1). Equation (1) expresses the relationship between the heat and the thermal exergy affected by the ambient temperature. Then due to the outdoor temperature decreases at night, the indoor temperature also decreases. The greenhouse must provide more thermal exergy to maintain the indoor temperature suitable for plant growth, so the heat required for the real-time scheduling stage of the greenhouse at night is more. In addition, the heat required of the day-ahead plan is lower than the heat required of the real-time scheduling even lower than the thermal exergy required of the real-time scheduling. The reason is that from the point of view of the exergy analysis of this paper, the heat required of the photovoltaic greenhouse during the day-ahead stage is the demand thermal exergy of the photovoltaic greenhouse. During the real-time scheduling stage, the thermal exergy required of the photovoltaic greenhouse not only includes demand thermal exergy of the photovoltaic greenhouse, it also takes into account the exergy loss that is not ignored during the heating process of the pipes. Therefore, the heat required during the day-ahead stage is lower than the thermal exergy required of greenhouse during the real-time scheduling stage. And the heat required of the greenhouse during the real-time scheduling stage based on the thermal exergy required takes into account the effect of the actual indoor temperature. In a word, the analysis of the heat deviation based on the exergy theory helps to calculate the heat required of the greenhouse more accurately and make the energy scheduling plan more accurately for the photovoltaic greenhouse micro-integrated energy system.

The Real-Time Scheduling Analysis of the Photovoltaic Greenhouse Micro-Integrated Energy System
In order to verify the correction effect during the real-time scheduling for the day-ahead plan deviation, the paper first takes a time section as an example to analyze the real-time scheduling of the typical winter sunny day.The time section selected in this paper is 11:00. The stored energy of the multi-form energy storage of the photovoltaic greenhouse micro-integrated energy system at 10:00 is shown in Table 3. The working status of the day-ahead multi-form energy storage and the far infrared heating device (electric heating device) at 11:00 are shown in Table 4. In addition, the deviation of the heat required ∆Q t+1 and the deviation of the photovoltaic power generation ∆L pv,t+1 are also shown in Table 4.   Table 3 lists the stored energy of multi-form energy storage in the last scheduling period. According to the stored energy, the adjustable range of multi-form energy storage can be obtained. Table 4 lists the working status of the multi-form energy storage in the day-ahead plan, the heat required deviation of the greenhouse and photovoltaic power generation deviation. It can be seen that the heat required deviation of the greenhouse is -21.8 kWh during the real-time scheduling period, indicating that it is necessary to provide 21.8 kWh of heat to the greenhouse to maintain the temperature suitable for plant growth at 11 o'clock. The photovoltaic prediction deviation is 20 kWh, indicating that the photovoltaic prediction is more 20 kWh than the day-ahead plan at 11:00.
According to the real-time scheduling model and the day-ahead plan, the adjustment during the real-time scheduling stage of the multi-form energy storage is shown in Table 5. It can be seen from Table 5 in combination with Table 4, that the real-time stage is 20 kWh more than the day-ahead plan at 11:00 of the photovoltaic power generation. The heat required of the greenhouse is more than 21.8 kWh. Firstly, from the perspective of the energy offset of electric heating, the excess photovoltaic power generation can offset a part of the heat required of the greenhouse. According to the control strategy, the energy offset link of electric heating is to turn on the far infrared heating device. The far infrared heating device is both the electric load and the heat source. The far infrared heating device converts the excess 20 kWh of photovoltaic power generation into heat for the greenhouse. Then the input energy of the biogas digester is reduced by 1.8 kWh to offset the remaining heat required of the greenhouse. Therefore, the input heat of the biogas digester is adjusted from the 113 kWh of the day-ahead plan to the 111.2 kWh of real-time plan. The real-time plan of this period makes the objective function value reach a minimum value of zero. The result completely corrects the deviation of the day-ahead plan. Compared to the day-ahead plan, not only does the local consumption of the photovoltaic power increase by 20 kWh, but it also leads to the indoor temperature closer to the target temperature that is suitable for plant growth.
The real-time scheduling calculation of the typical winter sunny day is carried out for the photovoltaic greenhouse micro-integrated energy system. In order to compare with the day-ahead plan, this paper draws electric loads curves of the day-ahead plan and the real-time scheduling and the curve of the actual photovoltaic output. They are shown in Figure 7. Figure 8 not only shows the stored energy of the phase change thermal storage device and the biogas digester, but also shows the comparison between the day-ahead plan and the real-time scheduling of the phase change thermal storage device and the biogas digester. Figure 9 not only shows the stored energy of the storage battery and the reservoir, but also shows the comparison between the day-ahead plan and the real-time scheduling of the storage battery and the reservoir. Table 6 summarizes the day-ahead and real-time local consumption of the photovoltaic power and the savings in electricity purchases. the curve of the actual photovoltaic output. They are shown in Figure 7. Figure 8 not only shows the stored energy of the phase change thermal storage device and the biogas digester, but also shows the comparison between the day-ahead plan and the real-time scheduling of the phase change thermal storage device and the biogas digester. Figure 9 not only shows the stored energy of the storage battery and the reservoir, but also shows the comparison between the day-ahead plan and the realtime scheduling of the storage battery and the reservoir. Table 6 summarizes the day-ahead and realtime local consumption of the photovoltaic power and the savings in electricity purchases. According to the Figure 7, the day-ahead electric loads curve and the real-time scheduling electric loads curve are basically consistent with the actual photovoltaic output curve. Because there is a deviation of the photovoltaic output between the day-ahead plan and the real-time scheduling, the use of electric loads in photovoltaic greenhouse have also been adjusted with the change of the photovoltaic output. As a result, the usage curve of the electric loads is more consistent with the actual photovoltaic output curve. In addition, the local consumption of the photovoltaic power has improved.  electric loads curve are basically consistent with the actual photovoltaic output curve. Because there is a deviation of the photovoltaic output between the day-ahead plan and the real-time scheduling, the use of electric loads in photovoltaic greenhouse have also been adjusted with the change of the photovoltaic output. As a result, the usage curve of the electric loads is more consistent with the actual photovoltaic output curve. In addition, the local consumption of the photovoltaic power has improved.   is a deviation of the photovoltaic output between the day-ahead plan and the real-time scheduling, the use of electric loads in photovoltaic greenhouse have also been adjusted with the change of the photovoltaic output. As a result, the usage curve of the electric loads is more consistent with the actual photovoltaic output curve. In addition, the local consumption of the photovoltaic power has improved.   According to the Figure 7, the day-ahead electric loads curve and the real-time scheduling electric loads curve are basically consistent with the actual photovoltaic output curve. Because there is a deviation of the photovoltaic output between the day-ahead plan and the real-time scheduling, the use of electric loads in photovoltaic greenhouse have also been adjusted with the change of the photovoltaic output. As a result, the usage curve of the electric loads is more consistent with the actual photovoltaic output curve. In addition, the local consumption of the photovoltaic power has improved.
According to Figure 8, the phase change thermal storage device has different amplitude of modification from the day-ahead plan in each scheduling period. Compared with the day-ahead plan, the adjustment of biogas digester in 10:00-12:00 and 20:00-24:00 is relatively large, while in the other time periods it is relatively small. This is because phase change thermal storage device and biogas storage are directly related to the photovoltaic greenhouse heat control. Due to the need to correct the deviation of the day-ahead plan, the stored energy real-time curves of both of them are adjusted more than the day-ahead curves. According to the Figure 9, for the storage battery, in 00:00-7:00, the real-time curve is basically in accordance with the day-ahead plan. From 7:00-14:00, the stored energy in the battery remains basically unchanged, illustrating that during this period the battery hardly works. From 14:00-15:00, the stored energy in the battery is reduced. Then the stored energy in the battery remains basically the same, illustrating that the battery is hardly used. The adjustment of reservoir energy storage is the smallest among all energy storage, and the fluctuation of stored energy real-time curve is the smallest. Combined with Figures 8 and 9, for the multi-form energy storage, the overall trend of the stored energy real-time curves are still similar to the day-ahead curves. It not only ensures the all-day optimality of energy scheduling, but also corrects the day-ahead deviation during the partial periods.
As can be seen from Table 6, the local consumption of the photovoltaic power in the day-ahead plan is 956 kWh and the percentage of local consumption is 85%. According to the deviation model of heat required and the real-time scheduling model, the local consumption of the photovoltaic power in the real-time plan is 1052 kWh and the percentage of local consumption is 92%. The real-time local consumption has increased by 96 kWh and the percentage of the local consumption has increased by  7%. It shows that the local consumption of photovoltaic power can be improved by using the models proposed in this paper.
In rural areas of western China, the standard electricity price is 0.49 yuan per kilowatt hour. In the case of only carrying out the day-ahead plan, the cost of purchasing electricity is 468.5 yuan lower than the ordinary greenhouse. In the case of carrying out the day-ahead plan and the real-time plan, the cost of purchasing electricity is 515.5 yuan lower than the ordinary greenhouse. This shows that the latter saves 47 yuan more than the former. It shows that the models proposed in this paper can reduce the electricity purchases cost of farmers. Let's make some assumptions. There are ten similar greenhouses in the rural area. According to the historical weather conditions, winter sunny days account for about two-thirds in rural areas of western China. Based on the above assumptions, in the case of carrying out the day-ahead plan, the cost of purchasing electricity throughout the winter is saves about 281,100 yuan. In the case of carrying out the day-ahead plan and the real-time plan, the cost of purchasing electricity throughout the winter saves about 309,300 yuan.
In summary, using the proposed real-time scheduling model to make the energy scheduling plan for the photovoltaic greenhouse micro-integrated energy system can make full use of the adjustment ability of the multi-form energy storage. In addition, it can correct the deviations of the day-ahead plan effectively. The proposed models can not only meet the suitable temperature for plant growth and effectively improve the local consumption of the photovoltaic power, but also reduce the cost of electricity purchases of the greenhouse.

Conclusions and Outlook
In this paper, the exergy analysis method is used to analyze a photovoltaic greenhouse micro-integrated energy system. The deviation model of the heat required and the real-time scheduling method are proposed of the system. The main conclusions and outlook are as follows: 1 This paper proposes a deviation model of heat required for photovoltaic greenhouse based on the exergy analysis method. The model not only accounts for the non-negligible exergy loss during the heating process of the pipes, but also considers the difference between the heat and thermal exergy affected by the actual indoor temperature. It can reflect the actual heat required more accurately, so that the greenhouse temperature is more suitable for plant growth. Based on the above analysis, the real-time optimization scheduling model is established. The goal of the real-time scheduling model is to minimize the absolute value of the difference between the energy supply and demand prediction deviation to be corrected and the adjustment of multi-form energy storage and electric loads. 2 The example shows that compared with [2], the heat required of greenhouse during the real-time scheduling stage based on the exergy theory can more accurately reflect the actual heat required. The proposed real-time optimal scheduling model can make full use of the characteristics of multi-form energy storage and adjustable loads. As a result, it corrects the day-ahead plan deviation so that the temperature is more suitable for plant growth and agricultural production is promoted. In addition, it improves the local consumption of photovoltaic power effectively and reduces the cost of farmers. 3 For other polymorphic source-storage-load micro-integrated energy systems with similar configurations, the models proposed in this paper are equally applicable. In addition, this paper is an energy optimal scheduling of the interior of the greenhouse. Micro-integrated energy system community is formed by multiple regional-level photovoltaic greenhouses. The next step to be studied is the energy mutual aid scheduling between communities.
Author Contributions: X.D. and H.N. performed the method and wrote the manuscript; Y.D. contributed to analysis and manuscript preparation; Y.W. participated in translation and supervised.
Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflicts of interest.