Development of Smart Grid Technology for Maintaining the Functioning of a Biogas Cogeneration System

The integrated Smart Grid System of harmonization of production and consumption of electric power and heat with the use of heat-pumping power supply of the biogas plant, which uses fermented wort as a low-potential source of power, was developed. A change in the power factor of the cogeneration system, the temperature of local water is predicted by measuring the voltage at the inlet to the inverter, at the outlet from the inverter and voltage frequency. In the engine cooling circuit, the temperature of cooling water at the inlet to the heat exchanger, at the outlet from the heat exchanger, and the return water temperature are measured. It was proposed to estimate a change in the ratio of voltage at the inlet to the inverter and at the outlet from the inverter. Making forestalling decisions to change the power of the heat pump and the number of plates in the heat exchanger of the engine cooling circuit makes it possible to maintain the voltage at the entrance to the inverter and the temperature of the heated local water. The complex mathematical and logical modeling of the cogeneration system, based on the mathematical substantiation of the architecture of the cogeneration system and mathematical substantiation of the maintenance of functioning of the cogeneration system, was performed. Time constants and coefficients of the mathematical models of dynamics regarding the estimation of a change in the power factor of the cogeneration system, temperature of local water, were determined. Functional estimation of a change in power factor of the cogeneration system in the range of 85–95 %, temperature of local water in the range of 30–55 °С at the compensation of reactive power of up to 40 % was obtained. Determining final functional information provides an opportunity to make forestalling decisions on a change in the power of a heat pump and a change in the number of plates in the heat exchanger of the engine cooling circuit to maintain the functioning of the cogeneration system.


Introduction
Given the need to save natural fuel and reduce the harmful emissions into the atmosphere, the distributed generation of electric power using renewable sources requires Smart Grid technologies for the integrated control of the flows of electric power and consumption [1,2]. A load of distributed energy generation is known to consume both active and reactive power, which make full capacity and have different cost values. Active power, as the ratio of active power to full power, is evaluated by power factor cosj, where j is the angle of phase shift between current and voltage. Active power is aimed at the performance of useful action, reactive power is a measure of power exchange between the generator and inductive load. Reactive power is directed at creating magnetic fields, without which functioning of the inductive load is impossible. To assess reactive power, one uses tgj, which is related to active power by the following ratio: cosj = 1/√(1+tg 2 j). In the electric network, there should be a balance of generation and consumption of active and reactive power. While the basic indicator of active power maintenance is the frequency in the power system, the indicator of maintenance of reactive power is the voltage in the distribution network. It is a change in reactive power at the consumption level that is a necessary part of voltage maintenance. The use of special compensating devices at the consumption level, for example, synchronous compensa-tors, intelligent inverters, etc., capable of both generating and absorbing reactive power, is a necessary component in terms of compensation of a voltage change. The cost of the plant and maintenance of these plants can be quite high. A relevant task in the context of further development of distributed electricity generation is to maintain the balance of production and consumption of active and reactive powers of the cogeneration system based on the heat-pumping power supply of the biogas plant, a low potential source of power for which is fermented wort [3,4]. Thus, the energy-saving technology of maintenance of the biogas plant operation [3] makes it possible to predict a change in fermentation temperature and establish the temperature of warming a heat carrier at the inlet to the heat exchanger, built-in the methane tank, with the use of heat pumping power supply. The warming heat carrier temperature is measured at the outlet to the heat exchanger during the period of biogas production. The use of an integrated system for the assessment of changes in fermentation temperature, obtained based on mathematical and logical modeling, ensures a constant release of biogas, timely unloading of fermented wort, and loading fresh material while maintaining the balance of the flows of fresh and fermented raw materials. The prediction of a change in the fermentation temperature requires making advanced decisions about a change in the temperature of the warming heat carrier at the inlet to the heat exchanger, fitted in the methane tank. Thus, the energy-saving technology of maintaining the operation of heat pump power supply [4] provides an opportunity to make advanced decisions to change the number of rotations of the heat pump compressor of the electric engine. A change in the temperature of heated water takes place at the ratio of the established ratio of the cooling agent at the outlet from the heat pump capacitor and evaporation pressure at the outlet of the evaporator.
Maintenance of the power factor of the cogeneration system on biogas fuel should take place at the level of frequency control of the electric engine of the heat pump compressor as a consumer of active and reactive power in ensuring the constant release of biogas as the producer of the alternative power source. Voltage regulation in the distribution system will make it possible to set a new level of active power, both electric and thermal cogeneration systems. Moreover, it is necessary to predict a change in the temperature of local heated water, in the heat exchanger of the engine cooling circuit of the cogeneration system, under conditions of changing the ratio of production of electric power and heat at a change in consumption. For this purpose, it is necessary to predict a change in power factor of the cogeneration system during the measurement of the voltage at the inlet in the inverter and at the outlet from the inverter on terms of the estimation of their ratio and voltage frequency.
Making advanced decisions about a change in power of the heat pump energy supply of the biogas plant and a change in the number of plates of the heat exchange of the engine cooling circuit makes it possible to estimate a change in power factor of the cogeneration system. The ratio of production of electric power and heat at a change in consumption is maintained.

Literature review and problem statement
Optimization of distributed generation of electric power traditionally uses the improvement of intelligent control systems both by the production of electrical power, and consumption. Thus, paper [5] presents the Smart system of biogas production based on a microcontroller for the estimation of parameters of biogas plant operation. Detection of the interaction between a change in the parameters offered an opportunity to conclude the necessity of continuous monitoring of biogas production process in terms of its optimization, but without interaction with consumption. Paper [6] presented the innovative system of electric power cogeneration for cooling to be integrated into the cycle of biogas turbines. The capacity of the implemented integrated power plant was studied using the laws of thermodynamics and software Engineering Equation Solver (EES). The total cooling load and net electrical power were evaluated: 505.2 kW and 1168 kW, respectively. Energy and exergetic efficiency of the proposed innovation system, but without taking into account the interaction with electricity consumption, was presented. Thus, paper [7] presents the results of intelligent control of the distributed power generation based on large-scale seasonal heat accumulation (ATES). The disadvantage of this development is the need for spatial planning related to the use of construction technology for ATES creation. Moreover, the information exchange between the ATES systems when it comes to dynamic control does not establish the relations of the use of accumulation with the estimate in a power factor change. Article [8] proposed a hierarchical framework for the control of electric power consumption by one-rank information exchange in the real-time market. The results of the optimization of electricity consumption schedule based on the interaction between electric power generation and participants of consumption are presented. However, the possibility of changing the consumption schedule regarding the estimation of a change in the reactive power of the distribution system under conditions of voltage regulation was not established. The results of the implementation of the algorithm of stochastic optimization of distributed electricity generation using fuzzy logic are presented in paper [9]. The relation of electric system loading and operational costs with the flexibility of control of distributed generation was found. The boundary level of electricity generation using a communal network as virtual storage in terms of maintaining the control flexibility was proposed. However, design and strategy of control, at which the results are calculated in the given work, do not make it possible to expand the level of distributed power generation. Research [10] proposed the cyber-physical system of control of distributed generation of electric power, based on the theory of consensual protocol. Analysis of the system behavior and power optimization does not make it possible to expand the level of consumption, because they do not assess the balance of active and reactive power. It is known that electric devices, for example, asynchronous electric engines, along with active power, consume reactive power as well. Reactive power does not perform a useful function directly, but maintains the operation of these devices to create magnetic fields, without which power consumption is impossible.
The well-known VVO concept offers the opportunity to change the electrical energy consumption based on the voltage regulation in the distribution system with the use of a change in reactive power. Research [11] proposed the intelligent transducer regulating voltage by absorbing or supplying reactive power (Var) to the network or from the network using the Volt-Var control function. This article deals with the capacitive (that is, Var-injection) and inductive (that is, Var-absorption) effects using the intelligent inverter and its ability to affect the voltage at the distribution level. When the intelligent converter introduces reactive power, it increases the distribution voltage. Conversely, the voltage decreases when the intelligent inverter absorbs reactive power. Paper [12] presents the VVO optimization model to establish priority sensitivity to data changes, based on precise measurement in order to improve the programs of response to electricity consumption. The presented analysis of literary sources [5][6][7][8][9][10][11][12] makes it possible to estimate the optimization of distributed generation of electric power without taking into account the interaction of electric power production and consumption, that is, without estimation of functional efficiency of generating systems. Traditionally, the use of reactive power to control the voltage in an electric network is carried out by means of, for example, transformers, capacitor batteries, voltage regulators, static synchronous compensators, etc. The installation and maintenance costs of these devices can be quite high and some have a relatively slow response time of about a few seconds [11]. Heat-pump power supply of the biogas plant provides an opportunity to use a heat pump as a voltage regulator in the distribution network. A change in the reactive power of the cogeneration system is estimated based on the evaluation of a change in the number of revolutions of the electric engine of the heat pump compressor within the term of biogas production.
That is why it is proposed to measure voltage at the inlet to the inverter and voltage at the outlet from the inverter in terms of estimation of their ratio when measuring voltage frequency. Moreover, the use of heat pumping power supply of the biogas plant makes it possible to regulate the ratio of production of electricity and heat at changing consumption. That is why it is proposed to measure the temperature of cooling water at the inlet to the heat exchanger of the engine cooling circuit and at the outlet from the heat exchanger and the temperature of cooling water. The engine cooling circuit, which usually acts as a protective element for the engine of the cogeneration system to prevent overheating, becomes a complex information system to assess changes in an electrical and thermal power cogeneration system. It is this energy equipment that responds to a change in consumption of electric power regarding the frequency control of the heat pumping power supply of the biogas plant in regard to the change in the balance of electrical power and heat consumption. That is why the unresolved problematic part of maintaining the operation of the cogeneration biogas fuel system is the prediction of a change in the power factor of the cogeneration system and the temperature of local heated water.
Making advanced decisions on changing the power of a heat pump and changing the number of the plates of the heat exchanger of the engine cooling circuit makes it possible to regulate voltage in the distribution system. Ensuring a change in active electric and thermal powers of the cogeneration system makes it possible to maintain their ratio at a change in consumption.
This substantiated the need for research in this direction.

The aim and objectives of the study
The aim of this study is to develop the Smart Grid technology to maintain the operation of the cogeneration biogas fuel system.
To achieve the aim, the following tasks were set: -to propose the prediction of a change in power factor of the cogeneration system, the temperature of local water in the engine cooling circuit based on the estimation of a change in the ratio of voltage measured at the inlet to the inverter, at the outlet from the inverter at the measurement of voltage frequency. With this aim, to develop the integrated Smart Grid system for maintaining the fermentation temperature with the application of heat pumping power supply, which uses fermented wort as a low-potential source; -to develop the block diagram and to perform comprehensive mathematical modeling to obtain a reference estimation of a change in power factor of the cogeneration system, the temperature of local water in the circuit of cooling the heated engine; -to suggest making forestalling decisions to change the power of heat-pump energy supply of the biogas plant and to change the number of plates of the heat exchanger of the engine cooling circuit to maintain voltage in the distribution system and the ratio of electricity and heat production at a consumption change. To this end, to develop the structural circuit and to perform logical modeling in terms of obtaining the functional estimation of a change in power factor of the cogeneration system, the temperature of local water in the cooling circuit of the heated engine; -to develop the block diagram and to perform logical modeling regarding obtaining the integrated Smart Grid system of maintenance of the cogeneration system operation at the decision making level; -to ensure harmonization of production of electric power and heat based on the prediction of a change in power factor of the cogeneration system, the temperature of local water in the engine cooling circuit at a consumption change.
4. Materials and methods to study the maintenance of functioning of the cogeneration biogas system

1. Methodological and mathematical substantiation of the architecture of the Smart cogeneration biogas system
Based on the methodological and mathematical substantiation of the architecture of technological systems [1], energy-saving technologies of biogas production with the use of heat-pumping energy supply [3,4], the architecture of the Smart cogeneration biogas system was proposed (Fig. 1). A cogeneration system is a dynamic system, the operation of which is the reproduction of a change in external, internal influences and initial conditions, for example, a change in power of the electric engine of the heat pump, a change in the ratio of production of electric power and heat under conditions of a consumption change, etc.
That is why, when designing a cogeneration biogas system, underlying which is an integrated dynamic subsystem (Fig. 1). The integrated dynamic subsystem includes the following components: the electric network, the cogeneration unit, the engine cooling circuit as a part of the cogeneration plant, the biogas plant, the heat pump, the frequency converter. The heat pump uses fermented wort as a low-potential power source to maintain the fermentation temperature, unloading of fermented wort, and loading of fresh material. The frequency converter performs the frequency regulation of the spiral compressor of the heat pump. Other units included in the cogeneration system are the units of charge, discharge, and estimation of functional efficiency, which are in harmonized interaction with the integrated dynamic subsystem (Fig. 1).
Based on the methodological and mathematical substantiation of the technological systems [1], energy-saving technologies of biogas production using heat-pumping power supply [3,4], the mathematical substantiation of the architecture of the cogeneration Smart biogas system (1) was proposed (Fig. 2).
In Fig. 2, SСSBF(τ) is the cogeneration Smart biogas system; τ is the time, s; D(τ) is the integrated dynamic subsystem; P(τ) is the properties of the elements of the cogeneration system; x(τ) is the influences (a change in parameters: voltage at the inlet to the inverter and at the outlet from the inverter, voltage frequency, temperature of cooling water at the inlet to the heat exchanger, at the outlet from the heat exchanger, the temperature of return water); f(τ) is the measured parameters (voltage at the inlet of the inverter and at the outlet of the inverter, voltage frequency, the temperature of cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger, the temperature of return water); K(τ) is the coefficients of the mathematic description of the dynamics of a change in power factor, the temperature of local water; y(τ, z) is the output parameters (power factor, reactive power factor, active, reactive powers of the cogeneration system, temperature of local water); z is the coordinate of the length of the heat exchanger of the engine cooling circuit, m; d(τ) is the dynamic parameters of a change in the power factor of the cogeneration system, the temperature of local water; FI(τ) is the functional final information; LC(τ) is the logical relations regarding the control of the cogeneration system workability; LS(τ) is the logical relations regarding the identification of the state of the cogeneration system; R(τ) is the logical relations in SСSBF(τ) to prove the correctness of decisions made from the units of the cogeneration system.
Indices: i is the number of elements in the cogeneration system; 0, 1, 2 are the initial stationary mode, external and internal character of influences.

2. Mathematical substantiation of the Smart Grid maintenance of the operation of the cogeneration biogas system
The mathematical substantiation of maintenance of the operation of the cogeneration system (2), (Fig. 3), based on the methodology of the mathematical description of dynamics of power systems, the method of the graph of cause-effect relations [1,3,4] was proposed. The basis of the proposed rationale is the mathematical description of the architecture of the cogeneration Smart biogas system (1), (Fig. 2).
Prediction of a change in power factor and a change in the temperature of local water of the engine cooling circuit makes it possible to make forestalling decisions on a change of the heat pump power and the number of heat exchanger plates of the engine cooling circuit. The voltage at the inlet of the inverter, at the outlet of the inverter and voltage frequency, is measured. In the engine cooling circuit, the temperature of the cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger, and the temperature of return water are measured.
In Fig. 3, SGCSBF(τ) is the Smart Grid maintenance of the operation of the cogeneration biogas system; τ is the time, s; D(τ) is the integrated dynamic subsystem; P(τ) is the properties of the elements of the integrated dynamic subsystem, units of the cogeneration system; MM(τ, z) is the mathematical modeling of dynamics of a change in power factor, the temperature of local water; sd(τ) is the output data (productivity of the biogas plant and the type of the cogeneration system and its power, the heat pump type and its power, the integrated system of maintenance of fermentation temperature, the inverter type; lp(τ) is the boundary change in parameters (voltage at the inlet of the inverter and at the outlet of the inverter, voltage frequency, temperature of cooling water at the inlet of the heat exchanger and at the outlet of the heat exchanger, the temperature of return water; lf(τ) is the levels of operation of the cogeneration system; fd is the obtained parameters (parameters of heat exchange in the heat exchanger of the engine cooling circuit, time constants and coefficients of the mathematical model of dynamics of a change in power factor, the temperature of local water; tf(τ, z) is the transfer function of predicted parameters -power factor, the temperature of local water; AI(τ, z) is the standard information regarding the evaluation of the maximum admissible change in power factor, the temperature of local water; C(τ) is the control of workability of the cogeneration system; LC(τ) is the logical relations of the control of the cogeneration system workability; x(τ) is the influences (a change in parameters: voltage at the inlet of the inverter and at the outlet of the inverter, voltage frequency, temperature of cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger, the temperature of return water); f(τ) is the measured parameters (voltage at the inlet of the inverter and at the outlet of the inverter, voltage frequency, temperature of the cooling water at the inlet of the heat exchanger and at the outlet of the heat exchanger, the temperature of return water); K(τ) is the coefficients of the mathematical description of the dynamics of a change in power factor, the temperature of local water; y(τ, z) is the input parameters (power factor, reactive power factor, active and reactive powers, the temperature of local water); z is the coordinate of the length of the heat exchanger of the engine cooling circuit, m; d(τ) is the dynamic parameters of estimation of a change in power factor, the temperature of local water; FI(τ) is the functional final information regarding decision making; LMD(τ) is the logical relations of decision making; MD(τ) is decision making; NC(τ) is the new conditions of the cogeneration system operation; S(τ) is the identification of the state of the cogeneration system; LS(τ) is the logical relations of identification of the state of the cogeneration system; R(τ) is the logical relations between the dynamic subsystem and units of charge, discharge, functional estimation of efficiency that belong to the cogeneration system.
Indices: i is the number of elements of SGCSBF(τ); 0, 1, 2 are the initial, external, and internal character of influences.
Mathematical substantiation of the architecture of the cogeneration Smart biogas system Mathematical substantiation of the architecture of the cogeneration system (1) and mathematical description (2) make it possible to maintain the operation of the cogeneration system using the following actions: -workability control (C(τ)) of the dynamic subsystem based on mathematical (MM(τ, z)) and logical (LC(τ)) modeling regarding obtaining standard (AI(τ,z)) estimate of a change in power factor of the cogeneration system of a change in the temperature of local water; -workability control (C(τ)) of the dynamic system based on mathematical (MM(τ, z)) and logical (LC(τ)) modeling regarding the obtaining functional (FI (τ)) estimate of a change in power factor of the cogeneration system, the temperature of local water; -decision making (MD(τ)) with the use of the functional information (FI(τ)), obtained based on logical modeling (LMD(τ)); -decision making to maintain the ratio of production and consumption of electric power and heat with the use of the functional assessment of a change in power factor, the temperature of local water, (FIIDS(τ)); -identification (S(τ)) of the new conditions of functioning of the cogeneration system (NC(τ)) based on logical modeling (LS(τ)) as a part of the dynamic subsystem and confirmation of new operating conditions based on logical modeling (R(τ)) from the units of the cogeneration system.

3. Mathematical modeling of the dynamics of change in the power factor of the cogeneration system and in the temperature of local water
According to formulas (1), (2), the prediction of a change in the power factor of the cogeneration system and the temperature of local water was proposed. The voltage at the inlet of the inverter, at the outlet of the inverter and voltage frequency, is measured. In the engine cooling circuit, the following parameters are measured: the temperature of the cooling water at the inlet to the heat exchanger at the outlet of the heat exchanger and the return water temperature.
Transfer function by the channel «power factor of the cogeneration system -voltage at the inlet to the inverter» is complex. A change in power factor and the local water temperature are estimated. A change in the local water temperature is estimated both over time and along the spatial coordinate of the length of the plate of the heat exchanger of the engine cooling circuit: where where PF is the power factor of the cogeneration system; I 1 , I 2 is the current at the inlet of the inverter and at the outlet of the inverter, respectively, A; U 1 , U 2 is the voltage at the inlet of the inverter and at the outlet of the inverter, respectively, В; C is the specific thermal capacity, kJ/(kg·K); α is the heat transfer factor, kW/(m 2 ·K); G is the loss of substance, kg/s; g is the specific weight of a substance, kg/m; h is the specific surface, m 2 /m; σ, q are the temperature of cooling water and of separating wall, respectively, K; z is the coordinate of the length of the heat exchanger, m; T lw , T m are the time constants that characterize the thermal accumulating capacity of local water, metal, s; m is the indicator of the dependence of heat transfer factor on consumption; i is the time, s; S is the Laplace parameter; S = ωj; ω is the frequency, 1/s. Indices: 0 -initial stationary mode; 1 -the inlet of the cogeneration system; в lw -local water; whc -warming heat carrier; m -metal wall.
Transfer function along the channel: «power factor of the cogeneration system -voltage at the inlet of the inverter» was obtained based on the solution of a system of nonlinear differential equations using the Laplace transform tool. The system of differential equations includes the equation of state as the estimation of the physical model of the cogeneration system. The system of differential equations also includes the equation of energy of transmitting and receiving mediacooling water and local water, respectively, and the equation (τ), (τ), (τ, ), (τ), (τ) (τ))), The K whc factor includes the temperature of the separating wall q: where σ 1 , σ 2 are the temperatures of cooling water at the inlet and at the outlet of the heat exchanger of the engine cooling circuit, K, respectively; t 1 , t 2 are the temperatures of local water at the inlet and at the outlet of the heat exchanger, K, respectively; α is the heat transfer factor, kW/(m 2 ·K). Index: lw -local water.
A m m whc = + ( ) where δ is the thickness of a plate of the heat exchanger, m; λ is the thermal conductivity of the metal plates of the heat exchanger, kW/(m·K). Indices: whc -warming heat carrier; m -metal wall of the plate of a heat exchanger.
To use the real part O(ω), the following factors were obtained: The transfer function (3), which was obtained based on the use of the operator method of solving the system of nonlinear differential equations, retains the Laplace transform parameter -S (S = ω j), where ω is the frequency, 1/s. To switch from the frequency area to the time area, a real part (3), obtained as a result of the mathematical treatment of transfer function, was separated.
It is this part that is included in the integrals (15), (16), which makes it possible to obtain dynamic characteristics of a change in power factor of the cogeneration system, the temperature of local water using the inverse Fourier transform.
where PF is the power factor of the cogeneration system; t is the temperature of local water, K.

5.
Results of studying the maintenance of functioning of the cogeneration system

1. Integrated Smart Grid system to maintain the fermentation temperature with the use of heat pumping power supply
Based on the integrated system of the maintenance of fermentation temperature [3], a comprehensive integrated system of maintaining the operation of the biogas plant was developed, based on the frequency control of heat pumping power supply, which uses fermented wort as a low-potential energy source (Table 1, Fig. 4).  Fig. 4. Maintenance of the fermentation temperature based on frequency control of the electric engine of the spiral compressor of the heat pump, where 2, 3, 4, 5 are decisions made to change the power of a heat pump, 1, 6 are the maintenance of loading of fresh wort and unloading of fermented material, respectively The developed integrated system of maintenance of fermentation temperature ( Table 1, Fig. 4) is the basis for complex mathematical modeling of the cogeneration biogas system.

2. Reference estimation of a change in the power factor of the cogeneration system and temperature of heated local water
According to the proposed block diagram (Fig. 5), Tables 1-3 (Fig. 4) present the results of complex mathematical modeling of the cogeneration biogas system.
The time constants and coefficients, which are a part of the mathematical model of dynamics (3), presented in Table 3, were obtained based on the integrated Smart Grid system (Table 1, Fig. 4) and parameters of heat exchange in the engine cooling circuit ( Table 2).   Fig. 5. Block diagram of complex mathematical modeling of the cogeneration biogas system: P, P е , P t are the nominal, electric, thermal power of the cogeneration system, respectively, kW; Q t , N t are the thermal productivity, power of the thermal pump, respectively, kW; V bv is the biogas volume, m 3 /day; t, t 1 , t 2 are the fermentation temperature, the temperature of cooling water at the inlet of the heat exchanger of the engine cooling circuit and at the outlet of the heat exchanger, respectively, °С

3. Functional estimation of a change in the power factor of the cogeneration system and the temperature of heated local water
Based on the proposed mathematical substantiation Smart Grid maintenance of functioning of the cogeneration system (1) to (3), the block diagram for the control of efficiency of the cogeneration biogas on biogas fuel (Fig. 6) was developed.
Control of serviceability of the cogeneration system (Fig. 6) enables obtaining the resulting information on decision-making about the maintenance of the functioning of the cogeneration system.

4. Smart Grid system of maintaining the operation of the cogeneration system at the decision-making level
Based on the proposed mathematical substantiation (1-3), the block diagram (Fig. 7) of the maintenance of the functioning of the cogeneration biogas system was developed based on the maintenance of change in functional efficiency.

Reference dynamic characteristics based on transfer function
Obtaining final information:

Obtaining final information
Maintenance of the ratio of production of electric power and heat t, t in, t out , t rw are the temperatures of local water, cooling water at the inlet of the heat exchanger of the engine cooling circuit, at the outlet of the heat exchanger, the temperature of return water, respectively, °С; q is the temperature of the separating wall. respectively, K; PF is the power factor of the cogeneration system; CT is the event control; Z is the logical relations; d is the dynamic parameters; x is the influences; f d is the diagnosed parameters; y is the output parameters; K is the mathematic description factors; i is time. Indices: c is efficiency control; ecv is the constant calculation value of a parameter of the upper level of functioning; 0, 1, 2 are the initial stationary mode, external, internal parameters; 3 is the coefficients of dynamics equations; 4 is the essential diagnosed parameters; 5 is dynamic parameters U 1 , U 2 are the voltages at the inlet of the invertor and at the outlet of the invertor, respectively, V; f is the voltage frequency, Hz; CT c is the efficiency control; t, t in , t outl , t rw are the temperature of local water, cooling water at the inlet of the heat exchanger of the engine cooling circuit, at the outlet of the heat exchanger, the temperature of return water, respectively, K; PF is the power factor of the cogeneration system; N Т is the power of the heat pump, kW; n is the number of plates of the heat exchanger of the engine cooling circuit; i is the time, Indices: i is the number of operation levels; е is the reference value of the parameter; ecv is the constant calculation value of the parameter of the upper level of functioning; ecl is the operation level The comprehensive integrated system of maintenance of operation of the cogeneration biogas system was developed. There is a continuous measurement of voltage at the inlet of the inverter, at the outlet of the inverter and voltage frequency. In the engine cooling circuit, the temperature of cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger, and the temperature of return water are measured.
The maintenance of the temperature of local water in the engine cooling circuit is based on the harmonization of the ratio of production of electrical power and heat at a change in consumption (Table 4). Table 4 Integrated Smart Grid System of harmonization of production and consumption of electric power and heat at a change of consumption Note: PF is the power factor of the cogeneration system; tgj is the factor of reactive power of the cogeneration system; Q is the reactive power of the cogeneration system, kVAR; P e , P t , are the active electric, thermal power of the cogeneration system, kW, respectively; N t is the power of the heat pump, kW; U 1 , U 2 , is the voltage at the inlet and at the outlet of the invertor, V, respectively; t inlet , t outlet , t rw are the temperatures of cooling water at the inlet of the heat exchanger of the engine cooling circuit, at the outlet of the heat exchanger, the temperature of return water, respectively, °С, respectively; t is the temperature of local water, °С; G is the consumption of cooling water, kg/s; n is the number of plates of the heat exchanger of the engine cooling circuit; m is the ratio of production and consumption of electric power and heat. Index: 1 -established calculation value of the parameter of the first operation level

Harmonization of the generation of electric power and heat based on predicting a change in the power factor and temperature of local water at a change in consumption
A power factor of the cogeneration system in the established period is determined as follows (Table 4, Fig. 8 where PF is the power factor of the cogeneration system; PF 1 , PF 2 are the initial, final values of power factor; τ is the time, s. Index: ecv is the constant calculation value of the parameter of the upper level of functioning; i is the number of levels of the cogeneration system operation. The temperature of local water in the established period is determined as follows (Table 4, Fig. 9): where t is the temperature of local water, °С; t 1 , t 2 are the initial, final values of temperature of local water; τ is the time, s. Index: ecv is the constant calculation value of the parameter of the upper level of operation; i is the number of levels of functioning of the cogeneration system. Based on the ratio cosj = 1/√(1+tg 2 j), the factor of reactive power tgj, which makes up for the period of 65·10 2 s (1.8 hours) 0.4392, was determined (Table 4, Fig. 10). Based on the values of cosj and tgj in this period, the active and reactive powers of the cogeneration system were found: 32 kW and 14.05 kVAR, respectively (Table 4, Fig. 11).
Thus, for example, in the time interval 65·10 2 s (1.8 hours) from the loading of fresh material into the biogas plant (Table 1), the absolute value of power factor of the cogeneration system (Table 4)  The absolute value of the temperature of local water (Table 4)   Thus, for example, in the period of time 65·10 2 s (1.8 hours), an increase in the power factor of the cogeneration system PF(τ) was predicted, from 0.8858 to 0.9155 (Table 4, Fig. 8) by 13 % relative to a decrease in the factor of reactive power tgj from 0.5239 to 0.4392 (Table 4, Fig. 9). With this aim, the forestalling decision to decrease the number of revolutions of the electric engine of the heat pump compressor to the level of 1098 rpm (Table 1). A decrease in the active power of the heat pump to the level of 2.3 kW (Table 1) makes it possible to set the temperature of the warming heat carrier at the inlet of the heat exchanger, fitted in a methane tank, at the level of 49.9 °C. The temperature of the fermentation of raw material is maintained at the level of 35.62 °C (Table 1, Fig. 5).
Predicting the maintenance of heating local water to the level of 46.37 °C in this time period (Table 4, Fig. 9), the forestalling decision to increase the number of plates of the heat exchanger of the engine cooling circuit from 48 pieces to 60 pieces was made. The ratio of production of electric power and heat at a change in consumption is maintained (Table 4, Fig. 12).
An increase in active electric and thermal power of the cogeneration system occurs at the compensation of reactive power of the cogeneration system up to 13 % ( Table 4, Fig. 11). The implementation of such actions makes it possible to maintain the balance of generation and consumption of electrical power and heat ( Table 4, Fig. 12). Voltage regulation in the distribution system based on a change in the reactive and active power of heat pump power supply of the biogas plant (Table 4) makes it possible to maintain the ratio of production of electric power and heat at a change in consumption.

Discussion of results of studying the Smart Grid technology for maintaining the functioning of the cogeneration biogas system
One of the advantages of cogeneration technologies when it comes to distributed generation of electric power is the possibility of using biogas as a renewable energy source. Optimization of the distributed generation of electric power traditionally uses the improvement of intelligent control systems without taking into account the interaction of production of electric power and consumption. The use of reactive power to control the voltage in the electric network with the help of, for example, transformers, capacitor batteries, voltage regulators, static synchronous compensators, etc. is traditional. The costs of mounting and maintaining these devices can be quite high and some of them have a relatively slow response time, of the order of a few seconds. The inclusion of the biogas plant and the heat pump into the integrated dynamic subsystem (Fig. 1) of the cogeneration system Smart offers an opportunity to use the heat pump as a voltage regulator in the distribution network. The changes in the reactive power of the cogeneration system are estimated based on the assessment of a change in revolutions of the electric engine of the heat pump compressor within the term of the biogas production. This term is determined by loading fresh wort and unloading fermented material, which takes place 4-6 times per day during the continuous production of biogas. That is why it was proposed to predict a change in power factor of the cogeneration system, the temperature of local water in the engine cooling circuit based on the estimation of change in the ratio of the measured voltage at the inlet of the inverter, at the outlet of the inverter, when measuring the voltage frequency. With this aim, the integrated Smart Grid system of maintenance of the fermentation temperature with the use of the heat pump power supply, which uses fermented wort as a low-potential energy source (Table 1, Fig. 4), was developed. The developed system makes it possible while using the frequency control of the electric engine of the spiral compressor of the heat pump, to ensure a change in the temperature of the warming heat carrier at the inlet of the heat exchanger, fitted in the methane tank. It is this system that becomes the basis of complex mathematical simulation of the cogeneration system (Fig. 5, Tables 2, 3), which results in obtaining reference information on estimation of power factor of the cogeneration system and temperature of local water. Moreover, the use of heat pumping power supply of the biogas plant makes it possible to regulate the ratio of production of electric power and heat at a change of consumption. That is why it is proposed to measure the temperature of cooling water at the inlet of the heat exchanger of the engine cooling circuit and at the outlet of the heat exchanger and the temperature of return water. The engine cooling circuit, which usually performs the function of the protective element, becomes a comprehensive information system for assessing a change in electric and thermal power of the cogeneration system at a change in the ratio of consumption of electrical power and heat. This circuit reacts to a change in electric power consumption, regarding the frequency control of the heat pumping power supply of the biogas plant due to a change in the balance of consumption of electric power and heat. That is why using mathematical substantiation of the architecture of the cogeneration system (Fig. 2), maintenance of functioning of the cogeneration system (Fig. 3), and transfer function (3), it was proposed to make forestalling decisions to change the power of the heat pumping power supply of the biogas plant and to change the number of plates of the heat exchanger of the engine cooling circuit. Voltage in the distribution system and the ratio of production of electric power and heat are maintained at a change in consumption. For this purpose, a functional estimation of a change in the power factor of the cogeneration system, the temperature of local water in the circuit of cooling the heated engine were obtained (Fig. 6). The prediction of a change in power factor of the cogeneration system and the temperature of heated local water makes it possible to take forestalling decisions to change the power of a heat pump and to change the number of plates of the heat exchanger of the engine cooling circuit. For this purpose, the integrated Smart Grid System of harmonization of production and consumption of electric power and heat at a change of consumption (Table 4) was obtained, based on logical modeling (Fig. 7), It is this integrated system that determines the exact term of making forestalling decisions, regarding the maintenance of functioning of the cogeneration biogas system.
Thus, in the period from the loading of fresh material to unloading of fermented wort (3.6 hours), the increase in power coefficient of the cogeneration system PF(τ) from 0.8644 to 0.9498 (Table 4, Fig. 8) regarding an increase in reactive power factor tgj from 0.5816 to 0.3286 (Table 4, Fig. 9) was predicted. With this aim, a proactive decision was made to reduce the number of revolutions of the electric engine of the heat pump compressor to the level of 755.1 rpm (Table 1). A decrease in the active power of the heat pump to the level of 1.58 kW (Table 1) makes it possible to set the temperature of the warming heat carrier at the inlet of the heat exchanger, fitted in the methane tank, at the level of 45 °C. The temperature of the fermentation of raw materials is maintained at the level of 34 °C (Table 1, Fig. 5). Predicting the maintenance of heating local water to the level of 55 °C in the time period (Table 4, Fig. 9), the forestalling decision was made to increase the number of plates of the heat exchanger of the engine cooling circuit up to 68 pieces. The ratio of production of electric power and heat at a change in consumption is maintained (Table 4, Fig. 12). An increase in active electric and thermal power of the cogeneration system was estimated by the compensation of reactive power of the cogeneration system from 17.56 kVAR to 10.9 kVAR -up to 40 % (Table 4, Fig. 11). The implementation of such actions makes it possible to maintain the balance of generation and consumption of electric power and heat (Table 4, Fig. 12). Maintaining the operation of the cogeneration biogas system with the use of the developed Smart Grid technology allows decreasing the cost of production of electric power and heat up to 30 %. The monetary profit was obtained in the amount of 9,000 /year by the «green tariff» for additional generation of electric power. Annual energy saving in the units of conditional fuel is 19.5 t.c.f./year. Joining Smart Grid technologies will provide consumers with high-quality power and under conditions of decreasing «green tariff» regarding the possibility of compensating significant costs for the maintenance of additional devices in the electric network. The presented research results are a continuation of work in the direction of harmonization of power production and consumption [1,3,4]. The development of this study involves the planned approbation of the research results, for example, hybrid solar panels when it comes to connecting to the network and own heat consumption.

Conclusions
1. It was proposed to predict a change in power factor of the cogeneration system, the temperature of local water in the engine cooling circuit based on the estimation of a change of the ratio of measured voltage at the inlet of the inverter, at the outlet of the inverter during the measurement of voltage frequency. The integrated Smart Grid system for maintaining the fermentation temperature with the application of heat pumping energy supply, which uses fermented wort as a low-potential source, was developed.
2. The block diagram was built and complex mathematical modeling was performed of the cogeneration system based on the integrated system for maintaining fermentation temperature and mathematical modeling of dynamics regarding the estimation of the efficiency factor of the cogeneration system and the temperature of local water. The uniting element of mathematical modeling of dynamics is the estimation of the ratio of measured voltage at the inlet of the inverter, at the outlet of the inverter during the measurement of voltage frequency. The temperature of the cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger and the return water temperature are measured in the engine cooling circuit. The parameters of heat exchange in the heat exchanger of the engine cooling circuit, time constants and coefficients of the mathematical models of dynamics for the established operation levels were determined. The reference dynamic estimations of the power factor of the cogeneration system, of the temperature of local water were obtained.
3. It was proposed to make forestalling decision to change the power of the heat-pump power supply of the biogas plant and to change the number of plates in the heat exchanger of the engine cooling circuit regarding the maintenance of voltage in the distribution system and the ratio of production of electric power and heat at the change of consumption. A block diagram was built and logical modeling of control of the efficiency of the cogeneration system was performed, which is carried out according to the cause and effect principle. The logical unit has the components that assess the measured voltage change at the inlet of the inverter, at the outlet of the inverter, and voltage frequency. In the engine cooling circuit, a change in the temperature of cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger, the temperature of return water were assessed. According to the block diagram, a change in the temperature of the wall of the plate of the heat exchanger of the engine cooling circuit, the coefficients of mathematical models of dynamics, K pf , K whc , power factors, the temperature of local water are estimated. A change in dynamic parameters of the power factor of the cogeneration system and in the temperature of local water is assessed. In the resultant unit of serviceability control, the functional estimation of a change in the power factor of the cogeneration system, the temperature of local water in the circuit of cooling the heated engine was obtained.
4. The integrated Smart Grid system of harmonization of production and consumption of electrical power and heat at a change in consumption was developed based on the designed block diagram of logic modeling. The maintenance of the power factor of the cogeneration system, temperature of local water is based on a comparison of the measured voltage at the inlet of the inverter, at the outlet of the inverter, and voltage frequency, with reference values. In the engine cooling circuit, the temperature of cooling water at the inlet of the heat exchanger, at the outlet of the heat exchanger, the temperature of return water are compared with the reference values.
5. The coordination of the production of electric energy and heat when changing consumption is ensured. Prediction of power coefficient of the cogeneration system, temperature of local water makes it possible to take forestalling decisions to change the power of heat pump energy supply of the biogas plant and to change the number of plates of the engine cooling circuit.