Virtual energy storage-containing multi-energy micro-grid scheduling method based on deep reinforcement learning
Through the multi-energy microgrid scheduling method based on deep reinforcement learning, the problems of flexible regulation of virtual energy storage and source-load uncertainty in multi-energy microgrids are solved, and the economic operation and efficient energy utilization of multi-energy microgrids are realized, which improves the efficiency of multi-energy microgrids. System adaptability and intelligent management.
Patent Information
- Application Number
- CN202410659755.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-13
AI Technical Summary
The uncertainty of renewable energy generation and load in multi-energy microgrids makes it difficult to optimize operations. It is difficult for existing technologies to effectively utilize virtual energy storage, resulting in poor system economics and poor source-load adaptability.
A method based on deep reinforcement learning is used to establish a multi-energy microgrid mathematical model including virtual energy storage. The deep reinforcement learning model is transformed into a Markov decision-making process, and the state space, action space and reward function are defined, and the pre-trained deep reinforcement is used. The learning model is used to optimize the scheduling of multi-energy microgrids and realize adaptive adjustment of dynamic scheduling strategies.
It improves the economic operation and efficient energy utilization capabilities of multi-energy microgrids, can flexibly respond to random fluctuations in source and load, fully utilizes the flexible regulation capabilities of virtual energy storage, and achieves collaborative economic operation and intelligent regulation and management in uncertain environments.
Smart Images

Figure CN118646045A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of energy network optimization and scheduling, and in particular to a multi-energy microgrid scheduling method containing virtual energy storage based on deep reinforcement learning. Background Art
[0002] Multi-energy microgrids are an important path to support the realization of my country's "dual carbon" goals, and provide a good solution for optimizing energy supply and improving energy utilization efficiency. Multi-energy microgrids deeply integrate various types of energy such as electricity, heat, and natural gas in the "production-conversion-transmission-storage-use" links of energy to form a multi-energy integrated utilization system, which is composed of energy supply equipment, energy conversion equipment, energy storage equipment, and loads. Multiple energy devices are coupled with each other to achieve cascade utilization and coordinated optimization of energy. Multi-energy microgrids will become an important part of the future energy system. However, the uncertainty of renewable energy generation and multi-energy loads in multi-energy microgrids has brought great challenges to their optimized operation. Traditional solution methods such as stochastic programming and robust optimization often rely on accurate predictions of uncertain factors such as renewable energy and loads or complex mathematical models, which are difficult to accurately respond to random fluctuations in sources and loads, and cannot flexibly adapt to dynamic changes in the actual operating environment.
[0003] In recent years, data-driven artificial intelligence technology has developed rapidly, providing technical support for solving the above problems. Artificial intelligence methods such as reinforcement learning and deep reinforcement learning (DRL) have been introduced into the optimization scheduling research of multi-energy microgrids. As a model-free decision-making method, deep reinforcement learning does not need to predict or model the uncertainty factors in the system in advance, but collects information through real-time interaction with the environment, and continuously updates and optimizes its decision-making strategy based on this information. This method enables deep reinforcement learning to quickly adapt to environmental changes, respond flexibly to random fluctuations in sources and loads and dynamic changes in the system, and improve the robustness of the system.
[0004] In addition, in multi-energy microgrids, energy storage equipment plays a great role. By configuring energy storage equipment such as electric energy storage and thermal energy storage, the energy storage charging and discharging characteristics can be used to improve the economic benefits and regulation capabilities of multi-energy microgrids. However, the cost of energy storage equipment is high, the investment cycle is long, and it is difficult to apply on a large scale. By adjusting the flexible load on the user side of the multi-energy microgrid through the control center or by economic means, it can also play a similar effect of transferring energy across time periods by energy storage equipment, improving the economic efficiency of multi-energy microgrid operation. Such loads can be regarded as virtual energy storage. However, the existing technology has not fully evaluated and developed the adjustable potential of user-side flexible loads, resulting in insufficient utilization of user-side resources. Therefore, it is necessary to conduct in-depth research on the flexible regulation capabilities of virtual energy storage such as electric vehicles and building thermal storage in multi-energy microgrids, and to build an accurate quantitative model.
[0005] In summary, under the premise of considering multiple uncertain factors and the flexible regulation capability of virtual energy storage, using deep reinforcement learning to conduct research on the optimal scheduling of multi-energy microgrids is of great significance to achieving the economic operation and efficient utilization of energy in multi-energy microgrids.
[0006] In view of this, the present invention is proposed. Summary of the invention
[0007] The present invention discloses a multi-energy microgrid scheduling method with virtual energy storage based on deep reinforcement learning, which is helpful to address the problems of poor overall system economy and poor adaptability to random source-load fluctuations described in the above background technology.
[0008] The present invention adopts the following technical solutions:
[0009] S1. Establish a mathematical model of multi-energy microgrid taking into account virtual energy storage;
[0010] s2. Mathematically describe the multi-energy microgrid optimization scheduling problem and establish the objective function and constraints of the multi-energy microgrid optimization scheduling problem;
[0011] s3. Convert the multi-energy microgrid optimization scheduling problem into a Markov decision process and define the state space, action space and reward function of the deep reinforcement learning model;
[0012] S4, collecting current state parameters of the multi-energy microgrid;
[0013] S5. Input the current state parameters into a pre-trained deep reinforcement learning model to obtain the action volume output by the deep reinforcement learning model, and realize the overall optimal scheduling of the multi-energy microgrid based on the action volume.
[0014] Furthermore, S1 establishes a mathematical model of a multi-energy microgrid taking into account virtual energy storage. The microgrid includes energy supply, conversion and storage equipment. The energy supply equipment is a photovoltaic generator set; the energy conversion equipment includes a combined heat and power unit (CHP), a gas boiler (GB), and an electric boiler (EB); the energy storage equipment is a battery energy storage (BES); the load side includes thermal load and electrical load, wherein the thermal load includes daily life thermal load and building thermal storage, and the electrical load includes daily life electrical load and electric vehicle (EV). Each model is constructed as follows:
[0015] The model of the combined heat and power unit is expressed as:
[0016]
[0017]
[0018] Where P CHP (t) is the output power of the combined heat and power unit (kW), G CHP (t) is the natural gas flow rate consumed by the cogeneration unit (m 3 ), L NG is the calorific value of gas (kWh / m 3 ), η CHPp is the power generation efficiency of the combined heat and power unit, Δt is the duration of a period (h), Q CHP (t) is the thermal power output of the combined heat and power unit (kW), η CHPq It is the heating efficiency of the combined heat and power unit;
[0019] The model of the gas boiler is expressed as:
[0020]
[0021] In the formula, Q GB (t) is the thermal power output of the gas boiler at time t (kW), G GB (t) is the natural gas flow rate consumed by the gas boiler (m 3 ), η GB is the heating efficiency of the gas boiler;
[0022] The model of the electric boiler is expressed as:
[0023] Q EB (t) = P EB (t)η EB
[0024] In the formula, Q EB (t) is the thermal power output of the electric boiler at time t (kW), P EB (t) is the electric power consumed by the electric boiler (kW), η EB is the heating efficiency of the electric boiler;
[0025] The model of electric energy storage is expressed as:
[0026]
[0027]
[0028] In the formula, SOC BES (t) is the state of charge of the energy storage at time t, η BES is the charge / discharge coefficient of the electrical energy storage, P BES (t) is the charging / discharging power of the energy storage during time period t (kW). When it is negative, it indicates that the energy storage is charging, and when it is positive, it indicates that the energy storage is discharging. SBES is the capacity of the electric energy storage (kWh), η ch is the charging efficiency of the electric energy storage, η dis is the discharge efficiency of the electric energy storage;
[0029] The relationship between indoor air heat change and indoor temperature change can be expressed as:
[0030]
[0031] In the formula, ΔQ(t) is the change in indoor air heat, ρ is the air density, C is the specific heat capacity of air, V is the volume of indoor air, T in (t) is the average indoor temperature at time t;
[0032] Based on the heat storage characteristics of the building and the energy conservation relationship, the heat balance equation of the building is established, and the building heat storage model is expressed as:
[0033]
[0034] The heat sources shown in the formula mainly include the following parts. The first item represents the heat transferred between the building exterior wall and the outside world, where k wall is the heat transfer coefficient of the building exterior wall (W / (m 2 ·K)) indicates the amount of heat transferred through a unit area of the wall per unit time for every 1 degree difference between indoor and outdoor temperatures, F wall is the area of the building's exterior wall (m 2 ), T out (t) is the outdoor ambient temperature (℃), and the second term represents the heat transferred between the building's exterior windows and the outside world, where k win is the heat transfer coefficient of the building's exterior windows (W / (m 2 ·K)), F win is the building exterior window area (m 2 ), the third term represents the heat transferred by solar thermal radiation, S C L is the building shading coefficient, and its value is related to factors such as whether there is a sunshade and glass material. air,h (t) Temperature control load generated by using building thermal storage to control indoor temperature (kW);
[0035] After electric vehicles are aggregated, they can be dispatched in a unified manner, which simplifies the complexity of calculation. The model of electric vehicle aggregates is expressed as:
[0036]
[0037]
[0038] In the formula, E jh (t) and P jh(t) respectively represent the electric vehicle polymer power and charging / discharging power at time t, and They represent the set of electric vehicles arriving and leaving at time t, represents the power of the i-th electric car when it arrives, It represents the power of the i-th electric car when it leaves, and its value should be kept between the anxious remaining power and the maximum power.
[0039] Furthermore, the objective function of the multi-energy microgrid optimization scheduling problem is:
[0040]
[0041] In the formula, C G (t) is the cost of natural gas consumption at time t, C E (t) is the cost of electricity exchange between the system and the external grid at time t, C BES (t) is the depreciation cost of charging and discharging of electric energy storage, C T (t) is the penalty cost of indoor temperature discomfort at time t, C B (t) is the subsidy cost of electric vehicles, and the operation of the multi-energy microgrid includes T time periods in total;
[0042] Cost of natural gas consumption C G (t) is expressed as:
[0043] C G (t) = ε gas (t)[G CHP (t)+G GB (t)]
[0044] In the formula, ε gas (t) is the unit price of natural gas purchased during period t, and G is the natural gas consumption;
[0045] The cost of electricity exchange between the system and the external grid C E (t) is expressed as:
[0046]
[0047] Where P grid (t) is the power (kW) of the system interacting with the external power grid during period t, P grid (t) is the timing indicating that the system purchases electricity from the external power grid, P grid When (t) is negative, it means that the system sells electricity to the external power grid, ε bu (t) is the price of electricity purchased from the external power grid during period t, ε se (t) is the price of electricity sold by the system to the external power grid during period t. gridWhen (t)≥0, that is, when the system purchases electricity from the external power grid, the value in the bracket on the right side of the equal sign is ε bu (t)P grid (t), when P grid When (t) < 0, that is, when the system sells electricity to the external power grid, the bracket on the right side of the equal sign is ε se (t)P grid (t);
[0048] The depreciation cost of charging and discharging of electric energy storage C BES (t) can be expressed as:
[0049] C BES (t) = ρ BES |P BES (t)|
[0050] In the formula, ρ BES is the depreciation cost coefficient of charging and discharging of electric energy storage;
[0051] Indoor temperature discomfort penalty cost C T (t) is expressed as:
[0052]
[0053] In the formula, σ T is the conversion coefficient between indoor temperature discomfort and currency, and are the lower and upper limits of the indoor temperature, Set the value for the preferred indoor temperature;
[0054] The power company subsidizes electric vehicles according to the discharge power of electric vehicles. The subsidy cost is C B (t) is expressed as:
[0055]
[0056] In the formula, It represents the maximum charging power of the electric vehicle aggregate, which is a negative value; It represents the maximum discharge power of the electric vehicle aggregate, which is a positive value.
[0057] Furthermore, the constraints in S2 include electric power balance constraints, thermal power balance constraints, external energy interaction power constraints, equipment operation constraints, equipment ramp constraints, and indoor temperature constraints:
[0058] Electric power balance constraints:
[0059] P CHP (t)+P PV (t)+P BES (t)+P grid (t)+Pjh (t) = L e (t)+P EB (t)
[0060] Where, L e (t) represents the daily production and living electricity load (kW);
[0061] Thermal power balance constraints:
[0062] Q CHP (t)+Q GB (t)+Q EB (t)+L air,h (t) = L h (t)
[0063] Where, L h (t) represents the heat energy required for daily production and life (kW);
[0064] External energy interaction power constraints:
[0065]
[0066] G min ≤G CHP (t)+G GB (t)≤G max
[0067] In the formula, and are the upper and lower limits of the power interaction between the system and the external power grid, G max and G min are the maximum and minimum values of gas transmission volume of the external natural gas network, respectively;
[0068] Equipment operation constraints:
[0069]
[0070]
[0071]
[0072]
[0073] In the formula, and They represent the minimum and maximum output power of the combined heat and power unit, and Respectively represent the minimum and maximum values of the energy storage charging / discharging power, and They represent the minimum and maximum values of the thermal power output of the gas boiler, and They represent the minimum and maximum values of the thermal power output of the electric boiler respectively;
[0074] In order to reduce the damage caused by deep charge / discharge to energy storage, the state of charge needs to be limited to a certain range, expressed as:
[0075]
[0076] In the formula, and They respectively represent the upper and lower limits of the state of charge of the electric energy storage;
[0077] Constraints of Electric Vehicle Aggregates:
[0078]
[0079]
[0080] In the formula, and They represent the upper and lower limits of the electric vehicle aggregate power respectively;
[0081] Equipment climbing constraints:
[0082] The output electrical power of the combined heat and power unit, the output thermal power of the gas boiler and the output thermal power of the electric boiler are expressed as:
[0083]
[0084]
[0085]
[0086] In the formula, is the maximum ramp rate of the CHP unit, is the maximum ramp rate of the gas boiler, is the maximum ramp rate of the electric boiler;
[0087] Indoor temperature constraints:
[0088]
[0089] In the formula, and are the lower and upper limits of the indoor temperature respectively.
[0090] Furthermore, the state space of the deep reinforcement learning model is defined as:
[0091] s t =[P PV (t), L e (t), Lh (t), SOC BES (t), ε bu (t), ε gas (t), T in (t), T out (t), t]
[0092] Where P PV (t) is the photovoltaic power generation power, and t is the current scheduling period;
[0093] The action space of the deep reinforcement learning model is defined as:
[0094] a t =[P CHP (t), P BES (t), Q GB (t), Q EB (t), P jh (t)]
[0095] The reward function of the deep reinforcement learning model is defined as:
[0096]
[0097] Where the reward function is scaled by multiplying it by 1 / 1000;
[0098] The above deep reinforcement learning model is trained by the deep deterministic policy gradient algorithm (DDPG). The DDPG algorithm is a reinforcement learning algorithm based on the policy-value framework. It approximates the optimal strategy through a deep neural network. It not only effectively solves the problem of dimensionality curse, but also preserves the information of the entire continuous action domain.
[0099] Furthermore, the current state parameters of the multi-energy microgrid are obtained through a parameter extraction module, wherein the current state parameters are state space variables, including: photovoltaic power generation power, daily life electric load, daily life thermal load, charge state of electric energy storage, electricity purchase price, gas purchase price, indoor temperature, outdoor temperature and current scheduling period t.
[0100] Furthermore, in the action decision module, the current state parameters are passed to the pre-trained deep reinforcement learning model, and the deep reinforcement learning model generates corresponding action quantities based on this. The action quantities include: the output electric power of the cogeneration unit, the charging / discharging power of the electric energy storage, the thermal power output of the gas boiler, the thermal power output of the electric boiler, and the charging / discharging power of the electric vehicle aggregate. In the operation optimization manager, the overall optimal scheduling of the multi-energy microgrid is achieved based on the said action quantities.
[0101] Furthermore, the training process of the pre-trained deep reinforcement learning model includes:
[0102] Initialize the network: Initialize four neural networks, namely the policy network, value network, target policy network and target value network;
[0103] Set up the experience pool: Whenever the agent interacts with the environment, it stores the current state, action, reward, and next state information as an experience tuple in the experience pool;
[0104] Network training: During the value network training process, the current state is used as input, the current action is obtained through the policy network, and the action is applied to the environment to obtain the reward and the next state. Then, the target policy network and the target value network are used to calculate the target policy and target Q value. The loss function is calculated based on the difference between the target Q value and the Q value output by the value network, and the parameters of the value network are optimized by minimizing the loss function. During the policy network training process, the sampling policy gradient is used, and the parameters of the policy network are optimized by maximizing the performance objective function.
[0105] Soft update target network: To maintain the stability of the target network, the target network needs to be updated according to a certain learning rate;
[0106] Iterative training: Repeat the above network training steps until the algorithm converges.
[0107] Furthermore, the loss function L(θ Q ) is expressed as:
[0108] L(θ Q )=E(y t -Q(s t , a t |θ Q )) 2
[0109] In the formula, y t is the target Q value, E() is the expected function, θ Q is the value of the network parameter.
[0110] Furthermore, the target Q value y t It is expressed as:
[0111] y t =r t +γQ′(s t+1 ,π′(s t+1 |θ π′ )|θ Q′ )
[0112] In the formula, θ Q′ and θ π′are the parameters corresponding to the target value network and the target policy network, respectively. Q′ and π′ are the target Q value and the target policy, respectively.
[0113] Furthermore, the updating formula of the value network parameters of the intelligent agent corresponding to the multi-energy microgrid is:
[0114]
[0115] In the formula, μ Q is the learning rate of the value network, is the function representing the gradient calculation;
[0116] L(θ Q ) about θ Q The gradient of is expressed as:
[0117]
[0118] For the policy network, it provides gradient information As the direction of action improvement, in order to update the policy network, the sampled policy gradient is used:
[0119]
[0120] The updating formula of the strategic network parameters of the intelligent agent corresponding to the multi-energy microgrid is:
[0121]
[0122] In the formula, μ π is the policy network learning rate.
[0123] Furthermore, in order to maintain the stability of the target network, the target network needs to be soft-updated;
[0124] The update formula of the target network parameters corresponding to the value network is:
[0125] θ Q′ ←τθ Q +(1-τ)θ Q′
[0126] Where, τ is the soft update coefficient, τ<<1;
[0127] The update formula of the target network parameters corresponding to the strategy network is:
[0128] θ π′ ←τθ π +(1-τ)θ π′
[0129] Adding Gaussian noise to the target policy network can solve the problem of overfitting of the value function of the deterministic policy and improve the robustness and exploratory nature of the network, as shown in the following formula:
[0130] a t =π(s t |θ π )+v t
[0131] In the formula, v t is Gaussian noise. BRIEF DESCRIPTION OF THE DRAWINGS
[0132] Figure 1 It is a multi-energy microgrid structure diagram provided in an example of the present invention;
[0133] Figure 2 It is a schematic diagram of the implementation process of the present invention;
[0134] Figure 3 This is a schematic diagram of the DDPG model training process. DETAILED DESCRIPTION
[0135] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0136] In order to further clarify the purpose, technical solutions and advantages of the embodiments of the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0137] Before introducing in detail a multi-energy microgrid scheduling method with virtual energy storage based on deep reinforcement learning provided by an embodiment of the present invention, an example multi-energy microgrid to which the method is applicable is first described. Figure 1 It is a structural diagram of a multi-energy microgrid provided in an example of the present invention.
[0138] like Figure 1 As shown, the microgrid includes photovoltaic power generation units, combined heat and power units, gas boilers, electric boilers, and electric energy storage. The load side includes electrical loads (daily life electrical loads and electric vehicles) and thermal loads (daily life thermal loads and building thermal storage).
[0139] Figure 2 It is a schematic diagram of the implementation process of the present invention. Figure 2 As shown, the method comprises the following steps:
[0140] S1. Establish a mathematical model of multi-energy microgrid taking into account virtual energy storage;
[0141] S2. Mathematically describe the multi-energy microgrid optimization scheduling problem and establish the objective function and constraints of the multi-energy microgrid optimization scheduling problem;
[0142] S3. Convert the multi-energy microgrid optimization scheduling problem into a Markov decision process and define the state space s of the deep reinforcement learning model. t , action space a t and the reward function r t ;
[0143] S4, collecting current state parameters of the multi-energy microgrid;
[0144] S5. Input the current state parameters into a pre-trained deep reinforcement learning model to obtain the action volume output by the deep reinforcement learning model, and realize the overall optimal scheduling of the multi-energy microgrid based on the action volume.
[0145] Specifically, in S1, each model is built as follows:
[0146] The model of combined heat and power (CHP) unit is expressed as:
[0147]
[0148]
[0149] Where P CHP (t) is the output power of the combined heat and power unit (kW), G CHP (t) is the natural gas flow rate consumed by the cogeneration unit (m 3 ), L NG is the calorific value of gas (kWh / m 3 ), η CHPp is the power generation efficiency of the combined heat and power unit, Δt is the duration of a period (h), Q CHP (t) is the thermal power output of the combined heat and power unit (kW), η CHPq It is the heating efficiency of the combined heat and power unit;
[0150] The model of gas boiler (GB) is expressed as:
[0151]
[0152] In the formula, Q GB (t) is the thermal power output of the gas boiler at time t (kW), G GB (t) is the natural gas flow rate consumed by the gas boiler (m 3 ), η GB is the heating efficiency of the gas boiler;
[0153] The model of electric boiler (EB) is expressed as:
[0154] Q EB (t) = P EB (t)η EB
[0155] In the formula, Q EB (t) is the thermal power output of the electric boiler at time t (kW), P EB (t) is the electric power consumed by the electric boiler (kW), η EB is the heating efficiency of the electric boiler;
[0156] The battery energy storage (BES) model is expressed as:
[0157]
[0158]
[0159] In the formula, SOC BES (t) is the state of charge of the energy storage at time t, η BES is the charge / discharge coefficient of the electrical energy storage, P BES (t) is the charging / discharging power of the energy storage during time period t (kW). When it is negative, it indicates that the energy storage is charging, and when it is positive, it indicates that the energy storage is discharging. S BES is the capacity of the electric energy storage (kWh), η ch is the charging efficiency of the electric energy storage, η dis is the discharge efficiency of the electric energy storage;
[0160] The relationship between indoor air heat change and indoor temperature change can be expressed as:
[0161]
[0162] In the formula, ΔQ(t) is the change in indoor air heat, ρ is the air density, C is the specific heat capacity of air, V is the volume of indoor air, T in (t) is the average indoor temperature at time t;
[0163] Based on the heat storage characteristics of the building and the energy conservation relationship, the heat balance equation of the building is established, and the building heat storage model is expressed as:
[0164]
[0165] The heat sources shown in the formula mainly include the following parts. The first item represents the heat transferred between the building exterior wall and the outside world, where k wall is the heat transfer coefficient of the building exterior wall (W / (m 2·K)) indicates the amount of heat transferred through a unit area of the wall per unit time for every 1 degree difference between indoor and outdoor temperatures, F wall is the area of the building's exterior wall (m 2 ), T out (t) is the outdoor ambient temperature (℃), and the second term represents the heat transferred between the building's exterior windows and the outside world, where k win is the heat transfer coefficient of the building's exterior windows (W / (m 2 ·K)), F win is the building exterior window area (m 2 ), the third term represents the heat transferred by solar thermal radiation, S C L is the building shading coefficient, and its value is related to factors such as whether there is a sunshade and glass material. air,h (t) Temperature control load generated by using building thermal storage to control indoor temperature (kW);
[0166] After electric vehicles are aggregated, they can be dispatched in a unified manner, which simplifies the complexity of calculation. The model of electric vehicle aggregates is expressed as:
[0167]
[0168]
[0169] In the formula, E jh (t) and P jh (t) respectively represent the electric vehicle polymer power and charging / discharging power at time t, and They represent the set of electric vehicles arriving and leaving at time t, represents the power of the i-th electric car when it arrives, It represents the power of the i-th electric car when it leaves, and its value should be kept between the anxious remaining power and the maximum power.
[0170] In S2, the optimal scheduling problem of multi-energy microgrid is described mathematically.
[0171] The objective function of the multi-energy microgrid optimization scheduling problem is:
[0172]
[0173] In the formula, C G (t) is the cost of natural gas consumption at time t, C E (t) is the cost of electricity exchange between the system and the external grid at time t, C BES (t) is the depreciation cost of charging and discharging of electric energy storage, C T (t) is the penalty cost of indoor temperature discomfort at time t, C B(t) is the subsidy cost of electric vehicles, and the operation of the multi-energy microgrid includes T time periods in total;
[0174] Cost of natural gas consumption C G (t) is expressed as:
[0175] C G (t) = ε gas (t)[G CHP (t)+G GB (t)]
[0176] In the formula, ε gas (t) is the unit price of natural gas purchased during period t, and G is the natural gas consumption;
[0177] The cost of electricity exchange between the system and the external grid C E (t) is expressed as:
[0178]
[0179] Where P grid (t) is the power (kW) of the system interacting with the external power grid during period t, P grid (t) is the timing indicating that the system purchases electricity from the external power grid, P grid When (t) is negative, it means that the system sells electricity to the external power grid, ε bu (t) is the price of electricity purchased from the external power grid during period t, ε se (t) is the price of electricity sold by the system to the external power grid during period t. grid When (t)≥0, that is, when the system purchases electricity from the external power grid, the value in the bracket on the right side of the equal sign is ε bu (t)P grid (t), when P grid When (t) < 0, that is, when the system sells electricity to the external power grid, the bracket on the right side of the equal sign is ε se (t)P grid (t);
[0180] The depreciation cost of charging and discharging of electric energy storage C BES (t) can be expressed as:
[0181] C BES (t) = ρ BES |P BES (t)|
[0182] In the formula, ρ BES is the depreciation cost coefficient of charging and discharging of electric energy storage;
[0183] Indoor temperature discomfort penalty cost C T (t) is expressed as:
[0184]
[0185] In the formula, σ T is the conversion coefficient between indoor temperature discomfort and currency, and are the lower and upper limits of the indoor temperature, Set the value for the preferred indoor temperature;
[0186] The power company subsidizes electric vehicles according to the discharge power of electric vehicles. The subsidy cost is C B (t) is expressed as:
[0187]
[0188] In the formula, It represents the maximum charging power of the electric vehicle aggregate, which is a negative value; It represents the maximum discharge power of the electric vehicle aggregate, which is a positive value.
[0189] The constraints of the multi-energy microgrid optimization scheduling problem include electric power balance constraints, thermal power balance constraints, external energy interaction power constraints, equipment operation constraints, equipment climbing constraints and indoor temperature constraints:
[0190] Electric power balance constraints:
[0191] P CHP (t)+P PV (t)+P BES (t)+P grid (t)+P jh (t) = L e (t)+P EB (t)
[0192] Where, L e (t) represents the daily production and living electricity load (kW);
[0193] Thermal power balance constraints:
[0194] Q CHP (t)+Q GB (t)+Q EB (t)+L air,h (t) = L h (t)
[0195] Where, L h (t) represents the heat energy required for daily production and life (kW);
[0196] External energy interaction power constraints:
[0197]
[0198]
[0199] In the formula, and are the upper and lower limits of the power interaction between the system and the external power grid, G max and G min are the maximum and minimum values of gas transmission volume of the external natural gas network, respectively;
[0200] Equipment operation constraints:
[0201]
[0202]
[0203]
[0204]
[0205] In the formula, and They represent the minimum and maximum output power of the combined heat and power unit, and Respectively represent the minimum and maximum values of the energy storage charging / discharging power, and They represent the minimum and maximum values of the thermal power output of the gas boiler, and They represent the minimum and maximum values of the thermal power output of the electric boiler respectively;
[0206] In order to reduce the damage caused by deep charge / discharge to energy storage, the state of charge needs to be limited to a certain range, expressed as:
[0207]
[0208] In the formula, and They respectively represent the upper and lower limits of the state of charge of the electric energy storage;
[0209] Constraints of Electric Vehicle Aggregates:
[0210]
[0211]
[0212] In the formula, and They represent the upper and lower limits of the electric vehicle aggregate power respectively;
[0213] Equipment climbing constraints:
[0214] The output electrical power of the combined heat and power unit, the output thermal power of the gas boiler and the output thermal power of the electric boiler are expressed as:
[0215]
[0216]
[0217]
[0218] In the formula, is the maximum ramp rate of the CHP unit, is the maximum ramp rate of the gas boiler, is the maximum ramp rate of the electric boiler;
[0219] Indoor temperature constraints:
[0220]
[0221] In the formula, and are the lower and upper limits of the indoor temperature respectively.
[0222] In the framework design of deep reinforcement learning (DRL), its core elements can be expressed as state, action, reward and environment. State refers to the current situation faced by the agent. The agent understands the current environment by perceiving state information; action is a series of decisions that the agent can perform based on the current state. These actions will affect the subsequent state of the environment and may cause the agent to receive rewards or penalties; reward is the immediate feedback from the environment after the agent performs an action. The goal of the agent is to learn how to formulate strategies to maximize the accumulated rewards; the environment represents the world outside the agent, which determines the state that the agent can observe, as well as the state transition and reward distribution after the action is performed; the agent needs to constantly interact with the environment and learn how to formulate effective strategies by trying different actions and observing the results. These four elements together constitute the basis of the deep reinforcement learning framework. The agent observes the state of the environment, selects and executes an action, then receives the reward returned by the environment, and updates its internal strategy based on this information. This process is iterative. As the agent continues to interact with the environment and accumulates experience, its strategy will gradually optimize, thereby maximizing the long-term accumulated rewards.
[0223] In S3, the state space of the deep reinforcement learning model is defined as:
[0224] s t =[P PV (t), L e (t), Lh (t), SOC BES (t), ε bu (t), ε gas (t), T in (t), T out (t), t]
[0225] Where P PV (t) is the photovoltaic power generation power, and t is the current scheduling period;
[0226] The action space of the deep reinforcement learning model is defined as:
[0227] a t =[P CHP (t), P BES (t), Q GB (t), Q EB (t), P jh (t)]
[0228] The reward function of the deep reinforcement learning model is defined as:
[0229]
[0230] Where the reward function is scaled by multiplying it by 1 / 1000;
[0231] The above deep reinforcement learning model is trained by the deep deterministic policy gradient algorithm (DDPG). The DDPG algorithm is a reinforcement learning algorithm based on the policy-value framework. It approximates the optimal strategy through a deep neural network. It not only effectively solves the problem of dimensionality curse, but also preserves the information of the entire continuous action domain.
[0232] In S4, the current state parameters of the multi-energy microgrid are obtained through the parameter extraction module, wherein the current state parameters are state space variables, including: photovoltaic power generation power, daily life electric load, daily life heat load, charge state of electric energy storage, electricity purchase price, gas purchase price, indoor temperature, outdoor temperature and current scheduling period t.
[0233] In S5, the current state parameters are passed to the pre-trained deep reinforcement learning model in the action decision module, and the deep reinforcement learning model generates corresponding action quantities based on this. The action quantities include: the output electric power of the cogeneration unit, the charging / discharging power of the electric energy storage, the thermal power output of the gas boiler, the thermal power output of the electric boiler, and the charging / discharging power of the electric vehicle aggregate. The overall optimal scheduling of the multi-energy microgrid is achieved in the scheduling optimization manager based on the said action quantities.
[0234] The DDPG model training process is as follows Figure 3 As shown, the specific process steps include:
[0235] Initialize the network: Initialize four neural networks, namely the policy network, value network, target policy network and target value network;
[0236] Set up the experience pool: Whenever the agent interacts with the environment, it stores the current state, action, reward, and next state information as an experience tuple in the experience pool;
[0237] Network training: During the value network training process, the current state is used as input, the current action is obtained through the policy network, and the action is applied to the environment to obtain the reward and the next state. Then, the target policy network and the target value network are used to calculate the target policy and target Q value. The loss function is calculated based on the difference between the target Q value and the Q value output by the value network, and the parameters of the value network are optimized by minimizing the loss function. During the policy network training process, the sampling policy gradient is used, and the parameters of the policy network are optimized by maximizing the performance objective function.
[0238] Soft update target network: To maintain the stability of the target network, the target network needs to be updated according to a certain learning rate;
[0239] Iterative training: Repeat the above network training steps until the algorithm converges.
[0240] The loss function L(θ Q ) is expressed as:
[0241] L(θ Q )=E(y t -Q(s t , a t |θ Q )) 2
[0242] In the formula, y t is the target Q value, E() is the expected function, θ Q is the value of the network parameter.
[0243] Target Q value y t It is expressed as:
[0244] y t =r t +γQ′(s t+1 ,π′(s t+1 |θ π′ )|θ Q′ )
[0245] In the formula, θ Q′ and θ π′are the parameters corresponding to the target value network and the target policy network, respectively. Q′ and π′ are the target Q value and the target policy, respectively.
[0246] The updating formula of the network parameters of the intelligent agent corresponding to the multi-energy microgrid is:
[0247]
[0248] In the formula, μ Q is the learning rate of the value network, is the function representing the gradient calculation;
[0249] L(θ Q ) about θ Q The gradient of is expressed as:
[0250]
[0251] For the policy network, it provides gradient information As the direction of action improvement, in order to update the policy network, the sampled policy gradient is used:
[0252]
[0253] The updating formula of the strategic network parameters of the intelligent agent corresponding to the multi-energy microgrid is:
[0254]
[0255] In the formula, μ x is the policy network learning rate.
[0256] To maintain the stability of the target network, the target network needs to be soft-updated:
[0257] The update formula of the target network parameters corresponding to the value network is:
[0258] θ Q′ ←τθ Q +(1-τ)θ Q′
[0259] Where, τ is the soft update coefficient, τ<<1;
[0260] The update formula of the target network parameters corresponding to the policy network is:
[0261] θ π′ ←τθ π +(1-τ)θ π′
[0262] Adding Gaussian noise to the target policy network can solve the problem of overfitting of the value function of the deterministic policy and improve the robustness and exploratory nature of the network, as shown in the following formula:
[0263] a t =π(s t |θ π )+v t
[0264] In the formula, v t is Gaussian noise.
[0265] Compared with the prior art, the present invention has the following advantages:
[0266] The existing technology has not fully evaluated and developed the adjustable potential of user-side flexible loads, resulting in insufficient utilization of user-side resources. The present invention conducts in-depth research on the flexible regulation capability of virtual energy storage, establishes a mathematical model of a multi-energy microgrid containing electric vehicles and building thermal storage to reflect the adjustable potential and dynamic characteristics of virtual energy storage, and integrates virtual energy storage into the multi-energy microgrid optimization scheduling model. On the premise of ensuring user comfort, the multi-energy microgrid energy supply side, electric vehicles and indoor temperature are coordinated and managed to achieve the overall optimization scheduling of the multi-energy microgrid.
[0267] It is difficult for existing technologies to effectively deal with the impact of multiple uncertain factors in multi-energy microgrids. The traditional multi-energy microgrid scheduling methods that rely on accurate predictions of renewable energy and loads or complex mathematical models are difficult to accurately respond to the problem of random fluctuations in source and load. The present invention proposes a multi-energy microgrid scheduling method with virtual energy storage based on deep reinforcement learning, and its scheduling strategy can be adaptively adjusted according to the real-time status. Through continuous interaction with the operating environment, the deep reinforcement learning algorithm can gradually grasp the laws of source and load fluctuations and the characteristics of dynamic changes in the operating environment, thereby formulating a more reasonable and effective scheduling strategy.
[0268] The present invention solves the problem that the existing technology fails to give full play to the flexible regulation capability of virtual energy storage and is difficult to respond to random fluctuations of source and load in real time, realizes the coordinated economic operation and intelligent regulation and management of both the source and load sides of the multi-energy microgrid under uncertain environment, and provides theoretical support and technical guidance for comprehensively improving the intelligence and efficiency of new energy systems.
[0269] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the present invention. Although the present invention has been described in detail with reference to the above embodiments, a person skilled in the art should recognize that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the basic concept and essential features of the present invention. These modifications or equivalents are deemed to be included in the protection scope defined by the claims of the present invention.
Claims
1. A multi-energy microgrid scheduling method with virtual energy storage based on deep reinforcement learning, It is characterized in that include: S1. Establish a mathematical model of multi-energy microgrid taking into account virtual energy storage; S2. Mathematically describe the multi-energy microgrid optimization scheduling problem and establish the objective function and constraints of the multi-energy microgrid optimization scheduling problem; S3. Convert the multi-energy microgrid optimization scheduling problem into a Markov decision process and define the state space, action space and reward function of the deep reinforcement learning model; S4, collecting current state parameters of the multi-energy microgrid; S5. Input the current state parameters into a pre-trained deep reinforcement learning model to obtain the action volume output by the deep reinforcement learning model, and realize the overall optimized operation of the multi-energy microgrid based on the action volume.
2. The method according to claim 1, It is characterized in that S1 establishes a mathematical model of a multi-energy microgrid taking into account virtual energy storage. The microgrid includes energy supply, conversion and storage equipment. The energy supply equipment is a photovoltaic generator set; the energy conversion equipment includes a combined heat and power unit (CHP), a gas boiler (GB), and an electric boiler (EB); the energy storage equipment is a battery energy storage (BES); the load side includes thermal load and electrical load, among which the thermal load includes daily life thermal load and building thermal storage, and the electrical load includes daily life electrical load and electric vehicle (EV). The various models are built as follows: The model of the combined heat and power unit is expressed as: Where P CHP (t) is the output power of the combined heat and power unit (kW), G CHP (t) is the natural gas flow rate consumed by the cogeneration unit (m 3 ), L NG is the calorific value of gas (kWh / m 3 ), η CHPp is the power generation efficiency of the combined heat and power unit, Δt is the duration of a period (h), Q CHP (t) is the thermal power output of the combined heat and power unit (kW), η CHPq It is the heating efficiency of the combined heat and power unit; The model of the gas boiler is expressed as: In the formula, Q GB (t) is the thermal power output of the gas boiler at time t (kW), G GB (t) is the natural gas flow rate consumed by the gas boiler (m 3 ), η GB is the heating efficiency of the gas boiler; The model of the electric boiler is expressed as: Q EB (t)=P EB (t)η EB In the formula, Q EB (t) is the thermal power output of the electric boiler at time t (kW), P EB (t) is the electric power consumed by the electric boiler (kW), η EB is the heating efficiency of the electric boiler; The model of electric energy storage is expressed as: In the formula, SOC BES (t) is the state of charge of the energy storage at time t, η BES is the charge / discharge coefficient of the electrical energy storage, P BES (t) is the charging / discharging power of the energy storage during time period t (kW). When it is negative, it indicates that the energy storage is charging, and when it is positive, it indicates that the energy storage is discharging. S BES is the capacity of the electrical energy storage (1Wh), η ch is the charging efficiency of the electric energy storage, η dis is the discharge efficiency of the electric energy storage; The relationship between indoor air heat change and indoor temperature change can be expressed as: In the formula, ΔQ(t) is the change in indoor air heat, ρ is the air density, C is the specific heat capacity of air, V is the volume of indoor air, T in (t) is the average indoor temperature at time t; Based on the heat storage characteristics of the building and the energy conservation relationship, the heat balance equation of the building is established, and the building heat storage model is expressed as: The heat sources shown in the formula mainly include the following parts. The first item represents the heat transferred between the building exterior wall and the outside world, where k wall is the heat transfer coefficient of the building exterior wall (W / (m 2 ·K)) indicates the amount of heat transferred through a unit area of the wall per unit time for every 1 degree difference between indoor and outdoor temperatures, F wall is the area of the building's exterior wall (m 2 ), T out (t) is the outdoor ambient temperature (℃), and the second term represents the heat transferred between the building's exterior windows and the outside world, where k win is the heat transfer coefficient of the building's exterior windows (W / (m 2 ·K)), F win is the building exterior window area (m 2 ), the third term represents the heat transferred by solar thermal radiation, S C L is the building shading coefficient, and its value is related to factors such as whether there is a sunshade and glass material. air,h (t) Temperature control load generated by using building thermal storage to control indoor temperature (kW); After electric vehicles are aggregated, they can be dispatched in a unified manner, which simplifies the complexity of calculation. The model of electric vehicle aggregates is expressed as: In the formula, E jh (t) and P jh (t) respectively represent the electric vehicle polymer power and charging / discharging power at time t, and They represent the set of electric vehicles arriving and leaving at time t, represents the power of the i-th electric car when it arrives, It represents the power of the i-th electric car when it leaves, and its value should be kept between the anxious remaining power and the maximum power.
3. The method according to claim 1, It is characterized in that The objective function of the multi-energy microgrid optimization scheduling is: In the formula, C G (t) is the cost of natural gas consumption at time t, C E (t) is the cost of electricity exchange between the system and the external grid at time t, C BES (t) is the depreciation cost of charging and discharging of electric energy storage, C T (t) is the penalty cost of indoor temperature discomfort at time t, C B (t) is the subsidy cost of electric vehicles, and the operation of the multi-energy microgrid includes T time periods in total; Cost of natural gas consumption C G (t) is expressed as: C G (t)=ε gas (t)[G CHP (t)+G GB (t)] In the formula, ε gas (t) is the unit price of natural gas purchased during period t, and G is the natural gas consumption; The cost of electricity exchange between the system and the external grid C E (t) is expressed as: Where P grid (t) is the power (kW) of the system interacting with the external power grid during period t, P grid (t) is the timing indicating that the system purchases electricity from the external power grid, P grid When (t) is negative, it means that the system sells electricity to the external power grid, ε bu (t) is the price of electricity purchased from the external power grid during period t, ε se (t) is the price of electricity sold by the system to the external power grid during period t. grid When (t)≥0, that is, when the system purchases electricity from the external power grid, the value in the bracket on the right side of the equal sign is ε bu (t)P grid (t), when P grid When (t) < 0, that is, when the system sells electricity to the external power grid, the bracket on the right side of the equal sign is ε se (t)P grid (t); The depreciation cost of charging and discharging of electric energy storage C BES (t) can be expressed as: C BES (t)=ρ BES |P BES (t)| In the formula, ρ BES is the depreciation cost coefficient of charging and discharging of electric energy storage; Indoor temperature discomfort penalty cost C T (t) is expressed as: In the formula, σ T is the conversion coefficient between indoor temperature discomfort and currency, and are the lower and upper limits of the indoor temperature, Set the value for the preferred indoor temperature; The power company subsidizes electric vehicles according to the discharge power of electric vehicles. The subsidy cost is C B (t) is expressed as: In the formula, It represents the maximum charging power of the electric vehicle aggregate, which is a negative value; It represents the maximum discharge power of the electric vehicle aggregate, which is a positive value.
4. The method according to claim 1, It is characterized in that The constraints in S2 include electric power balance constraints, thermal power balance constraints, external energy interaction power constraints, equipment operation constraints, equipment ramp constraints, and indoor temperature constraints: Electric power balance constraints: P CHP (t)+P PV (t)+P BES (t)+P grid (t)+P jh (t)=L e (t)+P EB (t) Where, L e (t) represents the daily production and living electricity load (kW); Thermal power balance constraints: Q CHP (t)+Q GB (t)+Q EB (t)+L air,h (t)=L h (t) Where, L h (t) represents the heat energy required for daily production and life (kW); External energy interaction power constraints: G min ≤G CHP (t)+G GB (t)≤G max In the formula, and are the upper and lower limits of the power interaction between the system and the external power grid, G max and G min are the maximum and minimum values of gas transmission volume of the external natural gas network, respectively; Equipment operation constraints: In the formula, and They represent the minimum and maximum output power of the combined heat and power unit, and Respectively represent the minimum and maximum values of the energy storage charging / discharging power, and They represent the minimum and maximum values of the thermal power output of the gas boiler, and They represent the minimum and maximum values of the thermal power output of the electric boiler respectively; In order to reduce the damage caused by deep charge / discharge to energy storage, the state of charge needs to be limited to a certain range, expressed as: In the formula, and They respectively represent the upper and lower limits of the state of charge of the electric energy storage; Constraints of Electric Vehicle Aggregates: In the formula, and They represent the upper and lower limits of the electric vehicle aggregate power respectively; Equipment climbing constraints: The output electrical power of the combined heat and power unit, the output thermal power of the gas boiler and the output thermal power of the electric boiler are expressed as: In the formula, is the maximum ramp rate of the CHP unit, is the maximum ramp rate of the gas boiler, is the maximum ramp rate of the electric boiler; Indoor temperature constraints: In the formula, and are the lower and upper limits of the indoor temperature respectively.
5. The method according to claim 1, It is characterized in that The state space of the deep reinforcement learning model is defined as: Where P PV (t) is the photovoltaic power generation power, and t is the current scheduling period; The action space of the deep reinforcement learning model is defined as: a t =[P CHP (t),P BES (t),Q GB (t),Q EB (t),P jh (t)] The reward function of the deep reinforcement learning model is defined as: Where the reward function is scaled by multiplying it by 1 / 1000; The above deep reinforcement learning model is trained by the deep deterministic policy gradient algorithm (DDPG). The DDPG algorithm is a reinforcement learning algorithm based on the policy-value framework. It approximates the optimal strategy through a deep neural network. It not only effectively solves the problem of dimensionality curse, but also preserves the information of the entire continuous action domain.
6. The method according to claim 1, It is characterized in that The current state parameters of the multi-energy microgrid are obtained through a parameter extraction module, wherein the current state parameters are state space variables, including: photovoltaic power generation power, daily life electric load, daily life heat load, charge state of electric energy storage, electricity purchase price, gas purchase price, indoor temperature, outdoor temperature and current scheduling period t.
7. The method according to claim 1, It is characterized in that In the action decision module, the current state parameters are passed to the pre-trained deep reinforcement learning model, and the deep reinforcement learning model generates corresponding action quantities based on this. The action quantities include: the output electric power of the cogeneration unit, the charging / discharging power of the electric energy storage, the thermal power output of the gas boiler, the thermal power output of the electric boiler, and the charging / discharging power of the electric vehicle aggregate. In the operation optimization manager, the overall optimized operation of the multi-energy microgrid is achieved based on the said action quantities.
8. The method according to claim 7, It is characterized in that The training process of the pre-trained deep reinforcement learning model includes: S81, Initialize network: Initialize 4 neural networks, namely policy network, value network, target policy network and target value network; S82, set up experience pool: whenever the agent interacts with the environment, the information such as the current state, action, reward and next state is stored in the experience pool as an experience tuple; S83. Network training: During the value network training process, the current state is used as input, the current action is obtained through the policy network, and the action is applied to the environment to obtain the reward and the next state. Then, the target policy network and the target value network are used to calculate the target policy and the target Q value. The loss function is calculated based on the difference between the target Q value and the Q value output by the value network, and the parameters of the value network are optimized by minimizing the loss function. During the policy network training process, the sampled policy gradient is used, and the parameters of the policy network are optimized by maximizing the performance objective function. S84, soft update target network: In order to maintain the stability of the target network, the target network needs to be updated according to a certain learning rate; S85, iterative training: repeat the above network training steps until the algorithm converges.
9. The method according to claim 8, It is characterized in that The loss function L(θ Q ) is expressed as: L(θ Q )=E(y t -Q(s t ,a t |θ Q )) 2 In the formula, y t is the target Q value, E() is the expected function, θ Q is the value of the network parameter.
10. The method according to claim 9, It is characterized in that The target Q value y t It is expressed as: y t =r t +γQ′(s t+1 ,π′(s t+1 |θ π’ )|θ Q′ ) In the formula, θ Q′ and θ π′ are the parameters corresponding to the target value network and the target policy network, respectively. Q′ and π′ are the target Q value and the target policy, respectively.
11. The method according to claim 8, It is characterized in that The updating formula of the network parameters of the intelligent agent corresponding to the multi-energy microgrid is: In the formula, μ Q is the learning rate of the value network, is the function representing the gradient calculation; L(θ Q ) about θ Q The gradient of is expressed as: For the policy network, it provides gradient information As the direction of action improvement, in order to update the policy network, the sampled policy gradient is used: The updating formula of the strategic network parameters of the intelligent agent corresponding to the multi-energy microgrid is: In the formula, μ π is the policy network learning rate.
12. The method according to claim 8, It is characterized in that To maintain the stability of the target network, the target network needs to be soft-updated; The update formula of the target network parameters corresponding to the value network is: i Q′ ←tth Q +(1-τ)θ Q′ Where, τ is the soft update coefficient, τ<<1; The update formula of the target network parameters corresponding to the strategy network is: i π′ ←tth π +(1-τ)θ π′ Adding Gaussian noise to the target policy network can solve the problem of overfitting of the value function of the deterministic policy and improve the robustness and exploratory nature of the network, as shown in the following formula: a t =π(s t |θ π )+v t In the formula, v t is Gaussian noise.
Citation Information
Cited By
Energy storage equipment operation state identification method based on internal and external environment monitoring
CN119253109A
Intelligent scheduling method of multi-element energy storage system based on deep reinforcement learning
CN120258474A
