[EI Recurrence] Dynamic pricing and energy management of multi-virtual power plants in master-slave game based on meta-model optimization algorithm (Matlab code implementation)

Welcome to this blog

Advantages of bloggers:Blog content should be as thoughtful and logical as possible for the convenience of readers.

Motto:He who travels a hundred miles is half as good as ninety.

The directory of this article is as follows:

Table of Contents

1 Overview

2 Operation results

3 References

4 Matlab code, data, articles


1 Overview

At present, domestic and foreign scholars have done research on the generation dispatching [2-3] and bidding model [4-5] of virtual power plants based on a single stakeholder.

Did a lot of research. If more social capital participates in the power market, each VPP may belong to different stakeholders. Driven by individual rationality, each interest subject pursues the maximization of its own interests, and the traditional single-subject optimization scheduling method will be difficult to apply [6]. Based on the above considerations, there have been studies using game theory to analyze the interest balance relationship between VPPs and different subjects within them [7-11]. However, most of the above literature focuses on studying the game relationship between VPP under the premise of given transaction price. This article introduces a distribution system operator (DSO), establishes a master-multiple-slave game optimization model between DSO and multiple VPPs, studies the interaction between DSO dynamic pricing and VPP operation strategies, and realizes energy management of multiple virtual power plants.

The master-slave game model is a type of equilibrium constrained equilibrium optimization problem, in which the lower-level game problem is a constraint of the upper-level optimization problem.

components, so the model is complex, nonlinear, and non-convex [12]. At present, the main methods for solving the equilibrium solution of the master-slave game include numerical optimization methods based on KarushKuhn-Tucker (KKT) conditions [13-15] and heuristic intelligent algorithms [16-19]. The KKT conditional method can simplify the model, but it requires the lower layer model to be a convex programming problem, and the upper layer requires all the parameter information of the lower layer, which involves privacy issues. The heuristic intelligent algorithm only needs to exchange a small amount of information between the upper and lower layers and can protect the privacy of the lower layer. However, it requires a large number of calls to the lower layer game model, which is complex in calculation and inefficient.

In order to deal with the above problems, this paper proposes an optimization algorithm based on meta-model, which introduces the Kriging meta-model into solving the master-slave blog for the first time.

Equilibrium solution of the game, in order to improve computing efficiency while protecting VPP privacy. The meta-model-based optimization algorithm is an optimization mechanism that drives the addition of sample points based on historical data to approach the local or global optimal solution. It can improve the shortcomings of traditional heuristic intelligent algorithms that require complex numerical simulations. It is currently used in aviation such as aircraft design. It is most widely used in the aerospace field [20] and has preliminary applications in power systems. Literature [21] uses Kriging element model to fit random wind speed and random response of power system transient simulation. Literature [22] and [23] use Kriging element model to replace power flow calculation and study the optimal economic operation and reactive power optimization of active distribution network respectively.

In summary, this paper considers that DSO and VPP have different interest needs, and establishes a multi-VPP dynamic pricing and energy management system based on the master-slave game.

theoretical model. A game equilibrium algorithm based on the Kriging meta-model is proposed. During the solution process, the Kriging meta-model is established to replace the energy management model inside the VPP. The particle swarm optimization algorithm is used to search for excellent sampling points, and the Kriging model is updated and modified to avoid complex calculations of the lower game model. Improve optimization efficiency. Finally, through numerical example analysis, the effectiveness of the model and algorithm proposed in this article is verified.

See Part 4 for detailed article explanation.

2 Operation results

Part of the code:

function [P_VPP_s,P_VPP_b,Out]=Fun_VPP1(lambda_DAb,lambda_DAs)
% Calculate the lower VPP transaction sub-process
%% Decision variable initialization
P_VPP_b=sdpvar(1,24); %VPP purchased electricity from the operator
P_VPP_s=sdpvar(1,24); %VPP’s electricity sales to operators
P_VPP=sdpvar(1,24); %VPP’s transaction power with the operator
P_MT=sdpvar(1,24); %Generated power of MT in VPP
P_ES=sdpvar(1,24); % energy storage charge and discharge power in VPP, timing is discharge
P_IL=sdpvar(1,24); %Interruptible load in VPP
P_W=sdpvar(1,24); %actual wind power output in VPP
S_ES=sdpvar(1,24); %State of charge of the power storage device in VPP
theta=binvar(1,24); %VPP and operator’s transaction power status variable
%% Import electrical load and wind power output
P_LD=[2.2,1.8,3,6,5.8,5.2,5.6,3.8,2.5,2.7,3,2.6,2.2,2.1,4.2,5.8,6.2,6.3,6.5,6.6,6.3,6.2,6,5.7 ];
P_Wmax=[2,1.5,1.6,1.8,1.3,0.6,2.8,3.3,3.9,4,3.3,2.9,2.7,2,0.2,3.2,5.1,3.1,1.8,2,1.3,1 2,3.8] ;
%% Import constraints
C=[];
C=[C,
   P_VPP==P_VPP_b-P_VPP_s, %VPP trades electricity with the operator. When it is positive, it means buying electricity, when it is negative, it means selling electricity.
   P_VPP + P_MT + P_ES + P_IL + P_W==P_LD, %VPP’s internal electrical power balance constraint
   0<=P_VPP_s<=theta*10, % sets the maximum power sales between VPP and operators to 10MW
   0<=P_VPP_b<=(1-theta)*10, % sets the maximum power purchased by VPP and operators to 10MW
   0<=P_MT<=6, %MT’s output power upper and lower limits
   -3.5<=P_MT(2:24)-P_MT(1:23)<=3.5, %MT’s climbing constraint
   -0.6<=P_ES<=0.6, % upper and lower limit power constraints of energy storage charge and discharge
   S_ES(1)==0.4-P_ES(1)/1, % SoC constraint of the energy storage device in the 0-1 period, taking the initial SoC as 0.4
   S_ES(2:24)==S_ES(1:23)-P_ES(2:24)/1, % SoC constraints of energy storage device in period 1-24
   0.2<=S_ES<=0.9, %SoC status upper and lower limit constraints
   S_ES(24)==0.4, the final state SoC of % energy storage is equal to the initial state value
   0<=P_IL<=0.1*P_LD, % upper and lower limit constraints of interruptible load
   0<=P_W<=P_Wmax, % wind turbine output upper and lower limit constraints
  ];
%% Set objective function
C_MT=0.08*P_MT.^2 + 0.9*P_MT + 1.2; % power generation cost of micro gas turbine
C_ES=0.05*P_ES.^2; % energy storage cost
C_IL=1.4*P_IL; %interruptible load cost
C_VPP=sum(lambda_DAb.*P_VPP_b-lambda_DAs.*P_VPP_s) + sum(C_MT + C_ES + C_IL); %VPP’s total operating cost
%% Solver configuration and solution
ops=sdpsettings('solver','cplex','verbose',0,'usex0',0);
ops.cplex.mip.tolerances.mipgap=1e-6;
result=solvesdp(C,C_VPP,ops);
%% data output
P_VPP_b=double(P_VPP_b);
P_VPP_s=double(P_VPP_s);

Out = [P_VPP;P_MT;P_ES;P_IL;P_W;-P_LD];
end

function [P_VPP_s,P_VPP_b,Out]=Fun_VPP1(lambda_DAb,lambda_DAs)
% Calculate the lower VPP transaction sub-process
%% Decision variable initialization
P_VPP_b=sdpvar(1,24); %VPP purchased electricity from the operator
P_VPP_s=sdpvar(1,24); %VPP’s electricity sales to operators
P_VPP=sdpvar(1,24); %VPP’s transaction power with the operator
P_MT=sdpvar(1,24); %Generated power of MT in VPP
P_ES=sdpvar(1,24); % energy storage charge and discharge power in VPP, timing is discharge
P_IL=sdpvar(1,24); %Interruptible load in VPP
P_W=sdpvar(1,24); %actual wind power output in VPP
S_ES=sdpvar(1,24); %State of charge of the power storage device in VPP
theta=binvar(1,24); %VPP and operator’s transaction power status variable
%% Import electrical load and wind power output
P_LD=[2.2,1.8,3,6,5.8,5.2,5.6,3.8,2.5,2.7,3,2.6,2.2,2.1,4.2,5.8,6.2,6.3,6.5,6.6,6.3,6.2,6,5.7 ];
P_Wmax=[2,1.5,1.6,1.8,1.3,0.6,2.8,3.3,3.9,4,3.3,2.9,2.7,2,0.2,3.2,5.1,3.1,1.8,2,1.3,1 2,3.8] ;
%% Import constraints
C=[];
C=[C,
P_VPP==P_VPP_b-P_VPP_s, %VPP trades electricity with the operator. When it is positive, it means buying electricity, when it is negative, it means selling electricity.
P_VPP + P_MT + P_ES + P_IL + P_W==P_LD, %VPP’s internal electrical power balance constraint
0<=P_VPP_s<=theta*10, % sets the maximum power sales between VPP and operators to 10MW
0<=P_VPP_b<=(1-theta)*10, % sets the maximum power purchased by VPP and operators to 10MW
0<=P_MT<=6, %MT’s output power upper and lower limits
-3.5<=P_MT(2:24)-P_MT(1:23)<=3.5, %MT’s climbing constraint
-0.6<=P_ES<=0.6, % upper and lower limit power constraints of energy storage charge and discharge
S_ES(1)==0.4-P_ES(1)/1, % SoC constraint of the energy storage device in the 0-1 period, taking the initial SoC as 0.4
S_ES(2:24)==S_ES(1:23)-P_ES(2:24)/1, % SoC constraints of energy storage device in period 1-24
0.2<=S_ES<=0.9, %SoC status upper and lower limit constraints
S_ES(24)==0.4, the final state SoC of % energy storage is equal to the initial state value
0<=P_IL<=0.1*P_LD, % upper and lower limit constraints of interruptible load
0<=P_W<=P_Wmax, % wind turbine output upper and lower limit constraints
];
%% Set objective function
C_MT=0.08*P_MT.^2 + 0.9*P_MT + 1.2; % power generation cost of micro gas turbine
C_ES=0.05*P_ES.^2; % energy storage cost
C_IL=1.4*P_IL; %interruptible load cost
C_VPP=sum(lambda_DAb.*P_VPP_b-lambda_DAs.*P_VPP_s) + sum(C_MT + C_ES + C_IL); %VPP’s total operating cost
%% Solver configuration and solution
ops=sdpsettings(‘solver’,’cplex’,’verbose’,0,’usex0′,0);
ops.cplex.mip.tolerances.mipgap=1e-6;
result=solvesdp(C,C_VPP,ops);
%% data output
P_VPP_b=double(P_VPP_b);
P_VPP_s=double(P_VPP_s);

Out = [P_VPP;P_MT;P_ES;P_IL;P_W;-P_LD];
end

3 References

Some content in the article is quoted from the Internet, and the source will be indicated or cited as a reference. It is inevitable that there will be some unfinished information. If there is anything inappropriate, please feel free to contact us to delete it.

[1] Dong Lei, Tu Shuqin, Li Ye, et al. Dynamic pricing and energy management of multi-virtual power plants in master-slave game based on meta-model optimization algorithm [J]. Power Grid Technology, 2020, 44(03): 973-983.DOI: 10.13335/j.1000-3673.pst.2019.2244.

4 Matlab code, data, articles