An Optimization Method for Local Consumption of Photovoltaic Power in a Facility Agriculture Micro Energy Network

In order to solve the problem of optimal dispatching of photovoltaic power for local consumption to the greatest degree in a photovoltaic greenhouse, this paper proposes a multiform energy optimal dispatching model and a solution algorithm. First, an input-output power model is established for energy storages which are reservoir, biogas digester, and block wall with phase-change thermal storage. Based on it, multiform energy storages play a bridging role of energy transfer in optimal energy dispatching. Subsequently, an optimal energy dispatching model is proposed with the objective of minimizing the sum of the squares of the difference between the loads and the photovoltaic generation in dispatching periods. Control variables are working state quantities of the time-shiftable loads and input-output state quantities of energy storages in dispatching periods. Finally, a genetic algorithm with matrix binary coding is used to solve the energy optimal dispatching model. Simulation results of a practical photovoltaic greenhouse facility agricultural micro energy network system in three typical weather conditions showed that the method could fully utilize the energy transfer function of the multiform energy storage and the time-shiftable characteristics of the agricultural load to achieve the maximum effect of increasing the local consumption of the photovoltaic power.


Introduction
Under the support of the Chinese government's "Photovoltaic Poverty Alleviation" and other policies [1][2][3], especially in western China, due to abundant solar energy resources and high altitude terrain, building distributed photovoltaic power generation on idle land in rural areas has become an effective way to increase farmers' income and solve the problem of agricultural electricity use.However, the existing rural grids in the western region are simple and cannot meet the security and stability requirements for power grids when using tie lines for distributed power to grid power delivery.On the other hand, the main network has already saturated its capacity for absorbing new energy.Therefore, only if coordinated with carrying out local consumption of photovoltaic power in accordance with local conditions, can the photovoltaic poverty alleviation projects be well implemented.Based on this, the photovoltaic greenhouse has become a model for rural areas in western China to use the local consumption technology of photovoltaic power for implementing photovoltaic poverty alleviation.Photovoltaic power generation has been widely used in the vast rural areas of China.The photovoltaic greenhouse is a typical application of photovoltaic power generation combined with facility agriculture.A facility agriculture micro energy network (FAMEN) system is formed based on Energies 2018, 11, 1503 2 of 20 modern agricultural planting.This facility-based agricultural micro energy network system combines multi-energy complementary control technology with modern agricultural cultivation technology, taking full advantage of solar energy, biomass energy, and new agricultural load.It consumes the photovoltaic peak output by optimal dispatch control, completes the process of "collecting on-site, storing on-site, and using on-site" of solar energy, and achieves the goal of promoting the growth of crops in photovoltaic greenhouses.The key to the successful implementation of this technology is how to optimize the multiform energy including energy storages, and agricultural load in the facility's agricultural micro energy network system to realize the local consumption of photovoltaic power.
As an extension of the energy internet, the concept of a micro energy network [4][5][6] with multiform energy has provided new ideas for solving the issue of local consumption of photovoltaic power.At present, research on micro energy networks in the literature at home and abroad are mostly based on the discussion of concept and architecture [7][8][9][10].There is no report on the local consumption of photovoltaic power in a micro energy network through optimal dispatching of multiform energy.Much research has been conducted for the problem of energy optimal dispatching of microgrids containing photovoltaic power, which mainly focuses on energy optimization from the aspects of economic operation [11][12][13][14], peak clipping and valley filling [15][16][17][18], and demand-side response [19][20][21] at home and abroad.However, the investment and maintenance costs of electricity storage in microgrids increase dramatically with the increase of battery installation capacity, which makes the configuration of energy storage in the microgrid more conservative and the cost and maintenance requirement too high.In addition, the energy-optimized dispatching strategy of microgrids, which aims at economy, is ultimately achieved through the use of the energy space-time shifting function of energy storage.Therefore, the frequent charge and discharge operations of battery storage cannot be avoided, and the energy storage life is greatly affected by frequent charging and discharging.Moreover, the battery-based energy storage form is single in the microgrid, and the limitation of demand-side response technology equipment makes the load dispatching not yet reach a substantial application.The two factors responsible for this are that the power fluctuation in the microgrid has a great impact on the upper-level power grid, and the microgrid system has a low photovoltaic absorption capability.
Compared to the currently widely studied microgrid systems, the facility agriculture micro energy network system has a variety of energy types of energy storage, and most of the load has time-shifting characteristics.The photovoltaic power's maximal local consumption also makes it impossible for the system to use the economic cost as the goal to carry out power exchange with the main network.Therefore, the conventional microgrid power optimization dispatching method is no longer applicable in facility agriculture micro energy networks.In view of the above problems, this paper first analyzes the typical structure of photovoltaic micro energy grids in greenhouse facilities, and then proposes a multimodal energy input-output model.Then, an energy optimization dispatching model is established, aiming at minimizing the sum of the square of the difference between the load energy and the photovoltaic (PV)-generated energy in dispatching periods, so as to achieve the goal of maximum local consumption of photovoltaic power.A genetic algorithm with matrix binary coding is used to solve the problem.Finally, an example of an actual photovoltaic greenhouse facility agricultural micro energy network system is used to verify the effectiveness of the energy optimization model and algorithm.

Typical Structure of Photovoltaic Greenhouse Facility Agricultural Micro Energy Network System
A typical facility agricultural micro energy network with a photovoltaic greenhouse is externally connected to the distribution network.The interior of it is mainly composed of a photovoltaic power generator, reservoir, biogas digester, block wall with phase-change thermal storage, and various types of loads.The schematic diagram of the structure is shown in Figure 1.According to the type of energy that the load belongs to and its time-shiftable characteristics, the load can be divided into six categories.They are time-shiftable electrical load, non-time-shiftable electric load, time-shiftable heat load, non-time-shiftable heat load, time-shiftable potential energy load, and non-time-shiftable potential energy load.Table 1 shows the classification of various types of loads and their characteristics in the typical photovoltaic greenhouse facility agricultural micro energy network system.
Energy stores in the facility agriculture micro energy network with photovoltaic greenhouse exist in many forms, including reservoir, biogas digester, and block wall.They play a bridging role of energy transfer in optimal dispatching of photovoltaic power.Energy storage of the reservoir utilizes pumped storage to convert electrical energy into potential energy for water storage, providing energy for plant irrigation when required; energy storage of the biogas digester utilizes bio-gas heat pump heating to promote biogas production, converting the chemical energy of biomass wastes and electrical energy into biomass chemical energy of biogas, and directly heating biogas to provide heat for greenhouse warming when needed; energy storage of the block wall with phase-change thermal storage uses phase change heat storage heat pumps to convert electrical energy into heat energy storage, and provide heat to heat up the greenhouses when needed.
In order to more vividly express the significance of the optimization goal to improve energy efficiency, the exergy analysis method was used to analyse the photovoltaic greenhouses' agricultural micro energy network system.The exergy analysis diagram is shown in Figure 2. According to the type of energy that the load belongs to and its time-shiftable characteristics, the load can be divided into six categories.They are time-shiftable electrical load, non-time-shiftable electric load, time-shiftable heat load, non-time-shiftable heat load, time-shiftable potential energy load, and non-time-shiftable potential energy load.Table 1 shows the classification of various types of loads and their characteristics in the typical photovoltaic greenhouse facility agricultural micro energy network system.
Energy stores in the facility agriculture micro energy network with photovoltaic greenhouse exist in many forms, including reservoir, biogas digester, and block wall.They play a bridging role of energy transfer in optimal dispatching of photovoltaic power.Energy storage of the reservoir utilizes pumped storage to convert electrical energy into potential energy for water storage, providing energy for plant irrigation when required; energy storage of the biogas digester utilizes bio-gas heat pump heating to promote biogas production, converting the chemical energy of biomass wastes and electrical energy into biomass chemical energy of biogas, and directly heating biogas to provide heat for greenhouse warming when needed; energy storage of the block wall with phase-change thermal storage uses phase change heat storage heat pumps to convert electrical energy into heat energy storage, and provide heat to heat up the greenhouses when needed.In order to more vividly express the significance of the optimization goal to improve energy efficiency, the exergy analysis method was used to analyse the photovoltaic greenhouses' agricultural micro energy network system.The exergy analysis diagram is shown in Figure 2.   The exergy equilibrium equation of photovoltaic greenhouse micro energy network system is: Among them, , PV in E is the solar exergy input to the photovoltaic power source, so that the photovoltaic power source works to produce electrical energy;  The exergy equilibrium equation of photovoltaic greenhouse micro energy network system is: Among them, E PV,in is the solar exergy input to the photovoltaic power source, so that the photovoltaic power source works to produce electrical energy; E g,in is the direct exergy input of the solar energy to the plants in the greenhouse for photosynthesis; E D,in is the exergy input of the distribution network to the electrical loads in the greenhouse which help promote the growth of plants; ∆E G is the exergy increase of the photovoltaic greenhouse micro energy network; E loss is the total exergy loss of the micro energy network, which consists of exergy loss in each part of the micro energy network, as shown in Equation ( 2).
Among them, E PV,xlin is the unavoidable exergy loss when the photovoltaic power source carries out energy conversion; E PV,l is the exergy loss caused by the abandonment of the photovoltaic power source; E S,l is the exergy loss when the energy storage of the reservoir is converted; E X,l is the exergy loss in the process of energy conversion in a block wall with phase-change thermal energy storage; E Z,l is the exergy loss in the process of energy conversion in biogas digester energy storage; E G,l is the exergy loss of the various types of loads in the greenhouse.
Reducing exergy loss can improve the exergy efficiency of the micro energy network system.In the exergy loss of various parts of the micro energy network system, the exergy loss caused by the abandonment of the photovoltaic power source has the greatest optimization space.Through reasonable optimization of the exergy input of photovoltaic power to the electric loads in the greenhouse E PV,gin , the exergy input of the photovoltaic power to the energy storage of reservoir E S,in , the exergy input of the photovoltaic power to the energy storage of block wall with phase-change thermal storage E X,in , and the exergy input of the photovoltaic power to the energy storage of biogas digester E Z,in , the exergy loss caused by the abandonment of the photovoltaic power E PV,l can be reduced, and the exergy efficiency of the micro energy network system can be improved.In other words, by fully utilizing the energy transfer function of multiform energy storage and time-shiftable loads, it is possible to increase the local consumption of the photovoltaic power, thereby achieving the effect of improving the exergy efficiency of the micro energy network system.

Multiform Energy Storage Input-Output Power Model
Reservoirs, biogas digesters, and block walls with phase-change thermal storage are among the common multiform energy storages in facility agriculture micro energy networks with photovoltaic greenhouses.They can be used as the energy transfer function to realize the goal of local consumption of photovoltaic power, serving as intermediate bridges between photovoltaic power and time-shiftable agricultural loads.That is, they consume electrical energy as electrical load, and store it as other forms of energy during peak PV output period, providing energy for agricultural load directly as other forms of energy during periods of low PV output.Similar to electricity storage, multiform energy stores are regarded as loads when energy is input, and they are used as energy sources when energy is output.Based on this, the input-output power model of three types of storage energy is established as follows: (1) Reservoir energy input-output power model The reservoir in the facility agriculture micro energy network can use pumped storage to convert electrical energy into potential energy for water storage for plant watering.Based on this, the model of the energy storage input-output of the reservoir is established as follows.
In the formula, P SI is the input power of the reservoir, kW; P w is the electric pump power of the electric load, kW; P SO is the output power when the reservoir is used for watering the plants, that is, the energy supply power when the reservoir is used as an energy source, kW; t SImax is the maximum input time of the reservoir, that is, the time required by the electric water pump to fill the reservoir from empty to full water capacity, h; t SOmax is the maximum output time of the reservoir, that is, the time required for complete discharge of the full reservoir for watering plants, h; η SI is the energy storage efficiency of the reservoir.
(2) Biogas digester energy input-output power model On one hand, a biogas digester in the facility agriculture micro energy network can utilize an electric heat pump to promote biogas production, thereby converting the chemical energy biomass waste and electric energy into bio-chemical energy of biogas; on the other hand, when the greenhouse requires heating, biogas can be directly burned to provide heat.Based on this, we established a biogas digester energy storage input-output power model as follows.
In the formula, P ZI is the input power of the biogas digester, kW; P z is the heat pump power for the biogas production, kW; P ZO is the output power of the biogas digester, kW; t ZImax is the maximum input time of the biogas digester, that is, the time required to use the digester heat pump to promote the gas storage from empty gas storage to full gas storage during biogas production, h; η ZI is the energy storage efficiency of the digester; t ZOmax is the maximum output time of the digester, that is, the time required by the biogas digester to heat up the greenhouse from the full gas storage capacity to empty gas storage capacity, h.
(3) Block wall with phase-change thermal storage energy input-output power model A block wall with phase-change thermal storage in the facility agriculture micro energy network can use phase-change heat storage heat pumps to convert electrical energy into heat energy.On the other hand, it can be used as a heat energy source to heat greenhouses.The input-output power model of the block wall with phase-change thermal storage is established as follows.
P XI = P x P XO = P ZI t ZImax η ZI /t XOmax (5) In the formula: P XI is the input power of the block wall with phase-change thermal storage, kW; P x is the phase change heat storage heat pump power, kW; P XO is the output power of the block wall with phase-change thermal storage, kW.t ZImax is the maximum input time of the block wall with phase-change thermal storage, that is, the time required to store heat from 0 to full heat storage when the phase change heat storage pylon is used by the heat pump, h; η ZI is the energy storage efficiency of the block wall with phase-change thermal storage; t XOmax is the maximum output time of the block wall with phase-change thermal storage, that is, the time required to heat up the greenhouse from full heat storage capacity to 0 heat storage capacity, only using the block wall with phase-change thermal storage

Objective Function
In a facility agriculture micro energy network system with a photovoltaic greenhouse, the local multiform loads in the system are the main targets for system operation optimization.The objective function for this optimal dispatching problem is described in terms of the square of the difference between the load energy and the photovoltaic power generation in the dispatching period.It can make the energy consumption curve of the micro energy network system and the photovoltaic output curve the most similar in the dispatching period.The objective function is as follows.
In the formula, T is the number of the dispatching periods in one cycle, L t is the using energy of loads after optimization of t period, kWh; L pvt is the predicted value of photovoltaic power in t, period kWh.
L t consists of the non-time-shiftable load, time-shiftable load, and input/output energy of energy storage in the t period.
In the formula, L dxt is the total energy of the non-time-shiftable load in t period, kWh, L movet is the energy of time-shiftable agricultural electricity, heat, and potential energy loads in t period, kWh, as shown in Formula (8); L ct is the input and output energy of energy storage in t period, kWh, as shown in Equation (9).
In the formula, n is the number of time-shiftable agriculture electric loads; m is the number of time-shiftable agricultural potential loads; v is the number of time-shiftable agricultural heat loads; P ei is the power of the i-th time-shiftable agricultural electric load kW; P pi is the power of the i-th type of time-shiftable agricultural potential load, kW; P qi is the power of the i-th type of time-shiftable agricultural heat load, respectively, kW; x ei,t is the working state quantity of the i-th type of time-shiftable agriculture electric energy load in the t-th dispatching period; x pi,t is the working state quantity of the i-th type of time-shiftable agricultural potential load in the t-th dispatching period; x qi,t is the working state quantity of the i-th type of time-shiftable agricultural thermal load in the t-th dispatching period; ∆t is the interval time between each dispatching period, h.
In the formulas: x SIt , x ZIt , and x XIt respectively represent the input state quantity of energy storage in the reservoir, biogas digester, and block wall with phase-change thermal storage in the t-th dispatching period; x SOt , x ZOt , and x XOt represent the output state quantities of energy storage in the reservoir, biogas digester, and block wall with phase-change thermal storage in the t-th dispatching period, respectively.The input and output power of each energy storage is calculated according to Equations ( 3)-(5).

Constraints
(1) Energy balance constraint In the formulas, L dx,et , L dx,pt , and L dx,qt are respectively the sum of non-time-shiftable agricultural electrical loads, the non-time-shiftable potential loads and the non-time-shiftable heat loads in the dispatching period t, kWh; L move,et , L move,pt , and L move,qt are respectively the sum of time-shiftable agricultural electric loads, the time-shiftable potential loads, and the time-shiftable heat loads in the dispatching period t, kWh.S e , S p , and S 0 q correspond to the stored electrical, potential, and heat energy of the storage devices at the end of the current dispatching cycle, kWh; S 0 e , S 0 p , and S 0 q correspond to the stored electrical, potential, and heat energy of the storage devices at the beginning of the current dispatching cycle, kWh; ∑ L e , ∑ L p , and ∑ L q correspond to the total using energy by the electric loads, the potential loads, and the heat loads, respectively, in the current dispatching cycle, kWh.
(2) Multiform energy storage space constraint In the formula, Q 0 S , Q 0 Z , and Q 0 X represent the energy initially stored in the reservoir, the biogas digester, and block wall with phase-change thermal storage at the beginning of the current dispatching cycle, kWh; A S , A Z , and A X indicate the energy storage space of the reservoir, biogas digester, and block wall with phase-change thermal storage, respectively.
(3) Time-shiftable load continuity work status constraint Some time-shiftable loads must work for several dispatching periods in succession due to the limitations of the production process.For example, the physical insecticide load must work continuously for 2 h to achieve the desired effect.Therefore, the following constraint is established for time-shiftable loads that require continuous operation: In the formula, x lt , x lt+1 , and x lt+k−1 represent the working state quantities of the time-shiftable load l in the t, t + 1, and t + k − 1 dispatching periods respectively.G is a set for time-shiftable loads of continuous work.
(4) Time-shiftable load non-working time constraint Some time-shiftable loads cannot work at certain times due to the limitations of the production process.For example, watering irrigation load is difficult from 0:00 to 10:00 and 19:00 to 24:00, considering the influences on plant growth.Therefore, an inoperable period state constraint is established for such a time-shiftable load.
In the formula, x lt represents the work state quantity of the time-shiftable load l in the t-th dispatching period; F is the set of restrictive time-shiftable loads of the working period; N is the complete set of the dispatching periods that the time-shiftable load l cannot work in.
(5) Input and output status of energy storage mutually exclusive constraint It is not possible for all types of energy storage to be in the input and output states at the same time.The energy input/output state quantity must satisfy the mutual exclusion constraint: Energies 2018, 11, 1503 9 of 20 In the formulas: x SIt , x ZIt , and x XIt respectively represent the input state quantity of energy storage in the reservoir, biogas digester and block wall with phase-change thermal storage in the t-th dispatching period; x SOt , x ZOt , and x XOt represent the output state quantities of energy storage in the reservoir, biogas digester, and block wall with phase-change thermal storage in the t-th dispatching period, respectively.

Matrix Binary Coding of Control Variables
The control variables of this dispatching problem are: working state quantities of the time-shiftable electric loads, heat loads, potential loads, and input and output state quantities of the reservoir, biogas digester, and block wall with phase-change thermal storage energy in dispatching periods.In this work, the genetic algorithm adopts the grouping matrix binary coding method and decomposes control variables into two relatively independent sub-chromosomal codes.One is various types of time-shiftable loads in each dispatching period of work state quantities matrix sub-chromosome L as shown in Formula ( 14), the other is each form of energy storage input and output state quantities in each dispatching period matrix sub-chromosome Q, as shown in Formula (15).The matrix C formed by the control variables is represented as: In the formula, x ei,t is the work state quantity of the i-th type time-shiftable agricultural electric load in the t-th dispatching period; x pi,t is the work state quantity of the i-th type time-shiftable agricultural potential load in the t-th dispatching period; x qi,t is the work state quantity of the i-th type time-shiftable agricultural heat load in the t-th dispatching period.A status of 0 means it is inactive, and 1 means it is in work.
In the formula: x SIt , x ZIt , and x XIt respectively represent the input state quantity of energy storage in the reservoir, biogas digester, and block wall with phase-change thermal storage in the t-th dispatching period.The state value is 0 if it is in a non-operating state and 1 if it is in an input state.x SOt , x ZOt , and x XOt represent the output state quantities of energy storage in the reservoir, biogas digester, and block wall with phase-change thermal storage in the t-th dispatching period, respectively.The state value is 0 if it is in a non-operating state and 1 if it is in an output state.

Genetic Algorithm Solution Process
In this paper, a genetic algorithm with matrix binary coding is used to solve the established optimal dispatching model.The solution process is shown in Figure 2.
Step 1: Randomly generate the working state quantities of each type of time-shiftable load in each period within the corresponding constraint conditions to form a matrix L; randomly generate the state quantities of the input and output states of each form of energy storage within the corresponding constraint conditions to form a matrix Q, and according to (15), form an initial individual of the binary coded control variable matrix.Then, repeat N times to form the initial population of the control variables matrix, then the population size is N.
Step 2: Set the individual fitness function as the reciprocal of the objective function ( 6) of this work.
Step 3: Genetic Operators and Genetic Operations 1 crossover i. Formation of sub-chromosome L after crossover The two parent sub-chromosomes selected for crossover are represented as: where: M represents the number of load types.
The crossover operation is performed on a column of the two parent sub-chromosomes, and the resulting new daughter chromosomes are denoted as F 1 , F 2 .The specific crossover operation process is: (a) Generate a random crossover position j between 1 and M. (b) Perform a crossover on the two column vectors at crossover position j to generate the new sub-chromosomes S 1 , S 2 : mutation operations perform feasibility tests based on constraints.Retain viable variant individuals that meet the constraints.
Whether to mutate is determined by the mutation probability, m P .Randomly select the mutation bit to perform the mutation operation as shown in Equation ( 22).Individuals that have undergone mutation operations perform feasibility tests based on constraints.Retain viable variant individuals that meet the constraints.
Set the flag vector to flag if the constraint condition is satisfied.Kick out individuals who do not satisfy the constraints, calculate and store each individual fitness value within the current population, and select the better individuals to copy to the next generation.
Step 4: Repeat steps 2 through 4 until the termination condition is met.

Basic Information
This paper uses the simulation of an actual photovoltaic greenhouse facility agricultural micro energy network in western rural China as an example.The system's structure is shown in Figure 1.The system is a demonstration project of 'Research and Demonstration of Key Technologies for Local Consumption Dissipation of Distributed Power Sources Based on Time-Shiftable Agricultural Loads'.The capacity parameters of photovoltaic power and multiform energy storage have been addressed by another sub-topic research of the project which is on the optimization of agricultural micro energy network system configuration based on the actual situation in the area.The micro energy network system has 280 kWp photovoltaic power installed; the energy space of the reservoir is 200 kWh; the energy space of the biogas digester is 5400 kWh; the energy space of the block wall with phase-change thermal storage is 300 kWh.
According to the actual situation in the region, the produced energy conditions of photovoltaic greenhouse under three typical scenarios of a winter sunny day, cloudy day, and rainy day are used as examples to verify the effectiveness of the models and algorithms constructed in this work.The dispatching cycle is one day and the dispatching period is one hour.The output curves of photovoltaic power under three typical weather conditions are shown in Figure 3.
As can be seen from Figure 4, the photovoltaic output on a sunny day is significantly greater than on the cloudy and rainy days.On the sunny winter day, peak hours for photovoltaic power during the day are generated from 11:00 to 13:00.In the winter cloudy days, photovoltaic power output also reached a peak of one day near 12 o'clock.In the winter rainy day, the photovoltaic output fluctuates about a relatively low value with no apparent peak period.
with phase-change thermal storage is 300 kWh.
According to the actual situation in the region, the produced energy conditions of photovoltaic greenhouse under three typical scenarios of a winter sunny day, cloudy day, and rainy day are used as examples to verify the effectiveness of the models and algorithms constructed in this work.The dispatching cycle is one day and the dispatching period is one hour.The output curves of photovoltaic power under three typical weather conditions are shown in Figure 3.As can be seen from Figure 4, the photovoltaic output on a sunny day is significantly greater than on the cloudy and rainy days.On the sunny winter day, peak hours for photovoltaic power during the day are generated from 11:00 to 13:00.In the winter cloudy days, photovoltaic power output also reached a peak of one day near 12 o'clock.In the winter rainy day, the photovoltaic output fluctuates about a relatively low value with no apparent peak period.

Analysis of Examples (1) Sunny day in winter
The model and algorithm established in this work we used for optimization calculation.On a sunny winter day, the loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro energy network is shown in Figure 5.After optimization, the stored energy curve of each form of energy storage is shown in Figure 6.The comparison of the time-shiftable load and energy storage working time before and after optimization is shown in Table 2.

Analysis of Examples (1) Sunny day in winter
The model and algorithm established in this work we used for optimization calculation.On a sunny winter day, the loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro energy network is shown in Figure 5.After optimization, the stored energy curve of each form of energy storage is shown in Figure 6.The comparison of the time-shiftable load and energy storage working time before and after optimization is shown in Table 2.

Analysis of Examples (1) Sunny day in winter
The model and algorithm established in this work we used for optimization calculation.On a sunny winter day, the loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro energy network is shown in Figure 5.After optimization, the stored energy curve of each form of energy storage is shown in Figure 6.The comparison of the time-shiftable load and energy storage working time before and after optimization is shown in Table 2.As can be seen from Figures 5 and 6 and Table 2, the load curve of the micro energy network system before the optimization in the winter sunny day is very different from the PV output curve.During the daytime from 8:00 to 15:00, PV output is much greater than the load.There is no photovoltaic output during the night, but the demand for electricity at night is greater due to the need to heat the greenhouse through far-infrared heating.After optimization, the load curve is close to the PV output curve.In the 8:00-15:00 time period, during which the PV output is relatively high during the day, the reservoir, biogas digester, and block wall with phase-change thermal storage are used to store the electric energy as other forms of energy, thereby increasing the electric load during PV peak output period.On the other hand, the working time of time-shiftable loads, such as sound wave encouragement, Light Emitting Diode (LED) growth lighting, ventilators, etc., are also adjusted to this time period as a supplementary adjustment of the electric load.The two together maximize the consumption of photovoltaic power during daytime hours.In the absence of photovoltaic output during the night, the biogas digester, and block wall with phase-change thermal storage are used together to increase the temperature of the greenhouse to replace the far-infrared heating as the electric load in order to reduce the electric load at night.As can be seen from Figures 5 and 6 and Table 2, the load curve of the micro energy network system before the optimization in the winter sunny day is very different from the PV output curve.During the daytime from 8:00 to 15:00, PV output is much greater than the load.There is no photovoltaic output during the night, but the demand for electricity at night is greater due to the need to heat the greenhouse through far-infrared heating.After optimization, the load curve is close to the PV output curve.In the 8:00-15:00 time period, during which the PV output is relatively high during the day, the reservoir, biogas digester, and block wall with phase-change thermal storage are used to store the electric energy as other forms of energy, thereby increasing the electric load during PV peak output period.On the other hand, the working time of time-shiftable loads, such as sound wave encouragement, Light Emitting Diode (LED) growth lighting, ventilators, etc., are also adjusted to this time period as a supplementary adjustment of the electric load.The two together maximize the consumption of photovoltaic power during daytime hours.In the absence of photovoltaic output during the night, the biogas digester, and block wall with phase-change thermal storage are used together to increase the temperature of the greenhouse to replace the far-infrared heating as the electric load in order to reduce the electric load at night.Before the optimization, the micro energy network purchased 623.71 kWh from the distribution network and consumed 491.30kWh of photovoltaic power.After optimization, the micro energy network purchased 26.45 kWh from the distribution network and consumed 1077.71kWh of photovoltaic power, increasing the amount of photovoltaic energy consumption by 586.41 kWh.
It can be seen that on a sunny winter day, the local optimization method of photovoltaic power supply provided by the facility agriculture micro energy network proposed in this work can fully utilize the energy transfer function of multiform energy storage and the time-shiftable characteristics of time-shiftable agricultural load to achieve the optimal local consumption of photovoltaic power. (

2) Rainy day in winter
The model and algorithm established in this paper were used for the optimization calculation.The loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro energy network on a rainy winter day is shown in Figure 7.The stored energy curve of each form of energy storage after optimization is shown in Figure 8.The comparison of working time before and after the time-shiftable load optimization is shown in Table 3.
Energies 2018, 11, x FOR PEER REVIEW 14 of 20 kWh of photovoltaic power, increasing the amount of photovoltaic energy consumption by 586.41 kWh.
It can be seen that on a sunny winter day, the local optimization method of photovoltaic power supply provided by the facility agriculture micro energy network proposed in this work can fully utilize the energy transfer function of multiform energy storage and the time-shiftable characteristics of time-shiftable agricultural load to achieve the optimal local consumption of photovoltaic power.
(2) Rainy day in winter The model and algorithm established in this paper were used for the optimization calculation.The loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro energy network on a rainy winter day is shown in Figure 7.The stored energy curve of each form of energy storage after optimization is shown in Figure 8.The comparison of working time before and after the time-shiftable load optimization is shown in Table 3.    From Figures 7 and 8 and Table 3, it can be found that on a cloudy rainy day in winter, the load curve of the micro energy network system before the optimization is different from the PV output curve: during the period of 7:00 to 14:00, the photovoltaic output fluctuates to a certain degree, but the load using energy is very small and there is no time-shiftable load; in the night, there is no PV output, but due to the need to increase the temperature of the greenhouse through far-infrared heating, the demand for electricity is increased.After optimization, the load curve is close to the PV output curve: in the 7:00-14:00 time period, the storage reservoir, biogas digester,  From Figures 7 and 8 and Table 3, it can be found that on a cloudy rainy day in winter, the load curve of the micro energy network system before the optimization is different from the PV output curve: during the period of 7:00 to 14:00, the photovoltaic output fluctuates to a certain degree, but the load using energy is very small and there is no time-shiftable load; in the night, there is no PV output, but due to the need to increase the temperature of the greenhouse through far-infrared heating, the demand for electricity is increased.After optimization, the load curve is close to the PV output curve: in the 7:00-14:00 time period, the storage reservoir, biogas digester, and block wall with phase-change thermal storage are used to store the electric energy as other forms of energy, thereby increasing the electric load during PV peak output period.In the absence of photovoltaic output during the night, the biogas digester and block wall with phase-change thermal storage are used together to increase the temperature of the greenhouse to replace the far-infrared heating in order to reduce the electrical load at night.
Before the optimization, the micro energy network purchased 483.92 kWh from the distribution network and consumed 72.08 kWh of photovoltaic power.After optimization, the micro energy network purchased 29.86 kWh from the distribution network and consumed 277.14 kWh of photovoltaic power, increasing the amount of photovoltaic energy consumption by 205.06 kWh.
It can be seen that on a rainy winter day, the local optimization method of photovoltaic power supply provided by the facility agriculture micro energy network proposed in this work can fully utilize the energy transfer function of multiform energy storage to achieve the optimal local consumption of photovoltaic power.
(3) Cloudy day in winter In order to analyze the influence of the final state of each form of energy storage on the next dispatching period in the previous dispatching cycle, the scenario simulation under the cloudy winter day is set to two conditions: (a) perform the simulation calculation of the cloudy day after the above-described '(1) Sunny day in winter' dispatch, when the initial state of the energy storage of each form on this cloudy day is the final state of energy storage after the optimal dispatching of the sunny winter day; (b) perform the simulation calculation of the cloudy day after the above-described '(2) Rainy day in winter' dispatch, when the initial state of the energy storage of each form on this cloudy day is the final state of energy storage after the optimal dispatching of the rainy winter day.
(a) Cloudy day in winter after sunny day On a cloudy winter day after sunny day dispatching, the loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro network is shown in Figure 9.After optimization, the stored energy curve of each form of energy storage is shown in Figure 10.The comparison of the time-shiftable load and energy storage working time before and after optimization is shown in Table 4.As can be seen from Figures 9 and 10, and Table 4, the load curve of the micro energy network system before the optimization on cloudy day is very different from the PV output curve.During the daytime from 7:00 to 16:00, PV output is much greater than the load.There is no photovoltaic output during the night, but the demand for electricity at night is greater due to the need to heat the greenhouse through far-infrared heating.After optimization, the load curve is close to the PV output curve.In the 7:00-16:00 time period, during which the PV output is relatively high during the day, the reservoir, biogas digester, and block wall with phase-change thermal storage are used to store the electric energy as other forms of energy, thereby increasing the electrical load during PV peak output period.On the other hand, the working time of the ventilator is also adjusted to this time period as a supplementary adjustment of the electric load.The two together maximize the consumption of photovoltaic power during daytime hours.In the absence of photovoltaic output during the night, the biogas digester and block wall with phase-change thermal storage are used together to increase the temperature of the greenhouse to replace the far-infrared heating in order to reduce the electric load at night.
Before the optimization, the micro energy network purchased 495.91 kWh from the distribution network and consumed 57.10 kWh of photovoltaic power.After optimization, the micro energy network purchased 13.25 kWh from the distribution network and consumed 551.80 kWh of photovoltaic power, increasing the amount of photovoltaic energy consumption by 494.70 kWh.

(b) Cloudy day in winter after rainy day
The loads curve before and after the optimization of the photovoltaic greenhouse facility agricultural micro energy network on a cloudy winter day after rainy day dispatching is shown in Figure 11.The stored energy curve of each form of energy storage after optimization is shown in Figure 12.The comparison of the time-shiftable load and energy storage working time before and after optimization is shown in Table 5.
After optimization, the micro energy network purchased 214.9 kWh from the distribution network and consumed 582.40 kWh of photovoltaic power, increasing the amount of photovoltaic energy consumption by 525.40 kWh.
Similarly, it can be seen from Figures 11 and 12 and Table 5 that the goal of maximizing the PV output can be achieved after being optimized under the cloudy day after the rainy day.In addition, comparing the optimal results of the cloudy day scenario (a) after a sunny day and (b) after the rainy day, it can be found that, due to the fact that in scenario (a), all types of energy stores have stored more energy at the end of the previous dispatching period (sunny day), the energy storages of biogas digester and block wall with phase-change thermal storage release heat for warming up the greenhouses between 0:00 and 7:00.In scenario (b), at the end of the previous dispatching period (rainy day), all types of stored energy have less energy and cannot meet the heating demand between 0:00 and 7:00.The temperature of the greenhouse can only be increased by means of far-infrared lighting, so the electricity purchased from the distribution network under scenario (b) (214.9 kWh) greatly increases compared to that under scenario (a) (13.25 kWh).Since the photovoltaic power supply basically has no output during this period, it has little effect on the amount of photovoltaic consumption, making little difference in the total amount of photovoltaic consumption between the two scenarios.From the analysis of the above two scenarios, it can be seen that the last state of the energy stores from the last dispatching period has an effect reflected mostly in the initial periods of the next dispatching period.However, in both scenarios, the optimization method proposed in this paper can be used to guide the dispatching system to make full use of the energy transfer function of multiform energy stores and the time-shiftable characteristics of agricultural loads, so as to maximize the local consumption of photovoltaic power.(4) Analysis of photovoltaic power consumption As shown in Table 6, after optimization, the photovoltaic power consumption on a sunny day reached 96.1%, an increase of 52.4%.On rainy days and cloudy days under two conditions, the percentage of photovoltaic power consumption reached 86.0%, 90.7%, and 71.5%.Compared with a rainy day, the optimized PV power consumption and consumption ratio are higher than on sunny days and cloudy days because more time-shiftable loads allow greater optimization space.(4) Analysis of photovoltaic power consumption As shown in Table 6, after optimization, the photovoltaic power consumption on a sunny day reached 96.1%, an increase of 52.4%.On rainy days and cloudy days under two conditions, the percentage of photovoltaic power consumption reached 86.0%, 90.7%, and 71.5%.Compared with a rainy day, the optimized PV power consumption and consumption ratio are higher than on sunny

Figure 1 .
Figure 1.Schematic diagram of the typical structure of facility agriculture micro energy network with photovoltaic greenhouse.

Figure 1 .
Figure 1.Schematic diagram of the typical structure of facility agriculture micro energy network with photovoltaic greenhouse.

Figure 2 .
Figure 2. Photovoltaic greenhouse facility agricultural micro energy network exergy analysis diagram.
direct exergy input of the solar energy to the plants in the greenhouse for photosynthesis; , D in E is the exergy input of the distribution network to the electrical loads in the greenhouse which help promote the growth of plants; G E  is the exergy increase of the photovoltaic greenhouse micro energy network; loss E is the total exergy loss of the micro energy network, which consists of exergy loss in each part of the micro energy network, as shown in Equation (2).

Figure 2 .
Figure 2. Photovoltaic greenhouse facility agricultural micro energy network exergy analysis diagram.

Figure 3 .
Figure 3. Genetic algorithm with matrix binary coding solution flowchart.Figure 3. Genetic algorithm with matrix binary coding solution flowchart.

Figure 3 .
Figure 3. Genetic algorithm with matrix binary coding solution flowchart.Figure 3. Genetic algorithm with matrix binary coding solution flowchart.

Figure 4 .
Figure 4. Photovoltaic output curves for three typical weather days.

Figure 4 .
Figure 4. Photovoltaic output curves for three typical weather days.

Figure 5 .
Figure 5.Comparison curve of loads before and after optimization on a sunny winter day.Figure 5. Comparison curve of loads before and after optimization on a sunny winter day.

Figure 5 . 20 Figure 6 .
Figure 5.Comparison curve of loads before and after optimization on a sunny winter day.Figure 5. Comparison curve of loads before and after optimization on a sunny winter day.Energies 2018, 11, x FOR PEER REVIEW 13 of 20

Figure 6 .
Figure 6.The stored energy curve of energy stores on a winter sunny day.

Figure 7 .
Figure 7.Comparison curve of load before and after optimization on a rainy winter day.Figure 7. Comparison curve of load before and after optimization on a rainy winter day.

Figure 7 .
Figure 7.Comparison curve of load before and after optimization on a rainy winter day.Figure 7. Comparison curve of load before and after optimization on a rainy winter day.

Figure 7 .
Figure 7.Comparison curve of load before and after optimization on a rainy winter day.

Figure 8 .
Figure 8.The stored energy curve of energy stores on a winter rainy day.

Figure 8 .
Figure 8.The stored energy curve of energy stores on a winter rainy day.

Energies 2018 ,
photovoltaic output during the night, the biogas digester and block wall with phase-change thermal storage are used together to increase the temperature of the greenhouse to replace the far-infrared heating in order to reduce the electric load at night.

Figure 9 .
Figure 9.Comparison curve of load before and after optimization on a cloudy winter day after a sunny day.

Figure 10 .
Figure 10.The stored energy curve of energy stores on a winter cloudy day after a sunny day.

Figure 9 .
Figure 9. curve of load before and after optimization on a cloudy winter day after a sunny day.

Figure 9 .
Figure 9.Comparison curve of load before and after optimization on a cloudy winter day after a sunny day.

Figure 10 .
Figure 10.The stored energy curve of energy stores on a winter cloudy day after a sunny day.

Figure 10 .
Figure 10.The stored energy curve of energy stores on a winter cloudy day after a sunny day.

Figure 11 .
Figure 11.Comparison curve of load before and after optimization on a cloudy winter day after a rainy day.

Figure 12 .
Figure 12.The stored energy curves of energy stores on a winter cloudy day after a rainy day.

Figure 11 . 20 Figure 11 .
Figure 11.Comparison curve of load before and after optimization on a cloudy winter day after a rainy day.

Figure 12 .
Figure 12.The stored energy curves of energy stores on a winter cloudy day after a rainy day.

Figure 12 .
Figure 12.The stored energy curves of energy stores on a winter cloudy day after a rainy day.

Table 1 .
Load characteristics classification in photovoltaic greenhouse facilities agricultural micro energy networks.

Table 1 .
Load characteristics classification in photovoltaic greenhouse facilities agricultural micro energy networks.
SOt x ZIt x ZOt x XIt x x SIt x

Table 2 .
Timetable of loads and energy storages working time before and after optimization on a sunny winter day.

Table 2 .
Timetable of loads and energy storages working time before and after optimization on a sunny winter day.

Table 3 .
Energy storage working time before and after optimization on a rainy winter day.

Table 4 .
Timetable of loads and energy stores working time before and after optimization on a cloudy winter day after a sunny day.Load Power kW Workable Hours Work time before Optimization Work Time after Optimization Ventilator 20 0-23 12-17 9; 11; 12; 15; 17; 18 0-3; 22; 23 phase change heat storage heat

Table 4 .
Timetable of loads and energy stores working time before and after optimization on a cloudy winter day after a sunny day.

Table 5 .
Timetable of loads and energy stores working time before and after optimization on a cloudy winter day after a rainy day.