(Article recurrence) Prosumer bidding strategy for new urban power distribution system based on master-slave game

references:

[1] Chen Xiupeng, Li Gengyin, Xia Yong. Prosumer bidding strategy for new urban power distribution system based on master-slave game [J]. Electric Power System Automation, 2019, 43(14):97-104.

1. Basic principles

        Under the competitive power market, there are mainly the following types of entities in the new urban power distribution system: power trading centers and dispatch departments, prosumers, power grid public service enterprises, and ordinary users. Among them, prosumers sell excess electricity to other users of the distribution network. Each prosumer is an independent and rational individual. Prosumers compete with each other, submit bidding curves to the trading center, and pursue the greatest interests of themselves. ization; the role of the power grid public service enterprises has changed. In the traditional distribution network, the power grid enterprises purchase power from the upper-level power grid and are the only power suppliers of the distribution network. However, after the opening of the retail power market, the power grid enterprises own the power distribution operations. rights, mainly providing guaranteed power supply services. On the one hand, it collects network fees from electricity sellers in the distribution network; on the other hand, it maintains power balance when the power supply within the distribution network is insufficient to ensure the reliability of the power supply and prevent prosumers in the distribution network from "grouping together". ”, the phenomenon of deliberately raising electricity prices occurred.

        The power trading center and dispatching department are the managers and supervisors of the urban power distribution system retail market, ensuring the safe and economic operation of the system and guiding the orderly and healthy development of the power market. The specific dispatching process of the day-ahead market in the distribution network is as follows: prosumers submit bidding curves to the trading center from 15 days before the trading day to 1 day before the trading day. The dispatching center and the trading center have transparent information and cooperate with each other, and communicate with users based on the bidding curves of the prosumers. The electricity demand determines the dispatching output and clearing price of each prosumer. The prosumer bidding process and scheduling process satisfy the master-slave hierarchical structure and can be regarded as a Stackelberg dynamic game process. This paper transforms this practical problem into a two-layer optimization model including a bidding layer and a scheduling layer. The specific process is shown in Figure 1.

        Prosumers are upper-level decision-makers, equivalent to leaders in the game. Through non-cooperative games, they make independent quotations and maximize their own interests as the optimization goal. The general mathematical expression of the prosumer objective function is:

        The dispatching and trading center is the lower-level decision-maker, equivalent to the follower in the Stackelberg game. Based on the prosumer bidding curve and power demand, it optimizes the lowest operating cost on the basis of ensuring the economy and security of power supply in the urban power distribution system. Goal, determine the contribution of each prosumer.

        The general mathematical expression of the objective function is:

1.1 Upper-level prosumer bidding model

        The prosumer i in the new urban power distribution system considered in this article has conventional power generation equipment such as micro gas turbines, as well as new energy power generation equipment such as photovoltaic and wind power.

        For conventional power generation equipment, its power generation cost can be expressed as a quadratic function, that is:

        In an electricity market with imperfect competition, prosumers will not bid according to marginal power generation costs, but will adjust the bidding curve to increase profits. This paper constructs the bidding function of prosumer i based on SFE as :

        Generally speaking, new energy power generation is random and volatile. Since this article aims to study the retail market equilibrium problem caused by competition, uncertainty factors are ignored and predicted values ​​are used. In the actual dispatch process, due to the fast adjustment speed of micro gas turbines, the imbalance caused by new energy power generation can be balanced.

        The dispatching department determines the dispatching output of the prosumer and uses the pay as bid (PAB ) revenue mechanism to settle. The specific revenue goals of prosumer i are:

1.2 Lower layer optimization scheduling model

        In this paper, the power grid public service enterprises and ordinary users are unified managed and controlled by the distribution system dispatching department, so the three are discussed in the lower-level optimization dispatch model.

        1.2.1 Scheduling department optimization operation model

        The goal of optimal dispatching of new urban power distribution systems is to minimize the overall operating economic cost of the system, including power purchase costs, network loss costs and DR compensation costs. The introduction of network loss costs can optimize power flow distribution and reduce operating costs, while DR costs are to encourage implementation Compensation costs provided by incentive policies.

        The dispatching department should meet the following constraints when performing dispatching.

        1.2.2 Power Grid Public Service Enterprise Model

1.2.3 Ordinary user model

        The development of energy interconnection technology allows users in the distribution system to participate in DR. DR can be divided into price-based DR and incentive-based DR. Using real time price (RTP) to settle users' electricity bills can fully mobilize users' DR capabilities. RTP is an important electricity price-based DR project that optimally guides power grid operations and market operations through price signals .

        By affecting the node load in the power flow constraints of the underlying dispatch model, users further affect the dispatching output and income of prosumers and thus participate in the game, preventing the collective monopoly of prosumers from occurring during the game and resulting in unreasonable prices. The final reduction in electricity costs for users by participating in DR is:

2. Master-slave game model solution process 

2.1 Prosumer bidding master-slave game model

        In the urban distribution network, each prosumer is an independent stakeholder. The dispatch department arranges the contribution of prosumers based on the prosumer bidding curve, and determines the unbalanced power provided by the power grid public service enterprise and the load adjustment of user participation in demand response. quantity. The prosumers adjust the bidding curve based on the dispatching output arranged by the dispatching department to increase the income from electricity sales. The relationship between prosumers and the dispatching department is a Stackelberg dynamic game under complete information. The bidding strategies between prosumers and consumers influence each other, which is a non-cooperative game under complete information. Finally, the game between each prosumer and the power grid dispatching department can be constructed as a Nash- Stackelberg game model. Usually, a game includes three factors: the player, the player's strategy, and income.

        The existence of the Nash equilibrium solution of this game is difficult to prove mathematically, but the power flow constraints of the lower dispatch model can be convexly relaxed to transform it into a second-order cone planning problem. The specific process is shown in Appendix A, Section A2. At this time, when the prosumer bidding strategy is given, the lower-level model can determine the unique optimal scheduling result, so the optimal response of each prosumer always exists, which means that the Nash equilibrium model of the game model exists.

2.2 Solution process

        The optimization objectives of the upper and lower layers of the model are inconsistent and the variable solution results influence each other. This paper uses a method combining the improved particle swarm optimization algorithm and the CPLEX solver to iteratively solve the equilibrium solution of the model. For the upper-level prosumer non-cooperative game model, the particle swarm optimization algorithm is used to solve the optimal bidding strategy of the prosumer in the iterative process. This improved particle swarm optimization algorithm redefines the weight coefficient and learning factor in the iterative process of particle position and speed. Its adaptive adjustment can be realized to improve the convergence speed and avoid falling into local optimum. The improvement process is shown in Appendix A3 . For the lower-level optimization scheduling model, the CPLEX solver is used to solve the problem based on the YALMIP platform to ensure the computational efficiency and optimality of the solution.

        The specific solution process is as follows.

3. Programming ideas

3.1 Parameter and variable definition

Table 1 Related parameters

Table 2  Upper level decision variables

Table 3  Lower level decision variables

3.2 Programming ideas

        Based on the interpretation of the literature content, the following programming ideas can be designed:

        Step 1: Enter required data

        This step is relatively simple. Most of the data used in the case analysis can be found in the original text, and other data can be assumed by yourself. Then enter all the required data in the format defined in Table 1.

        Step 2 : Improve the particle swarm algorithm

        Refer to the improvement ideas in the article and write the code to improve the particle swarm algorithm. Regarding the Sphere function, the comparison between the improved particle swarm algorithm and the basic particle swarm algorithm is as follows:

        Basic particle swarm algorithm:

        Improved particle swarm algorithm:

        It shows that the improved particle swarm algorithm is indeed better.

        Step 3 : Lower layer optimization scheduling code

        The article is a two-layer game problem. In order to facilitate debugging, it is generally necessary to first ensure that the lower-layer optimization scheduling problem is solved correctly, and then combine it with the upper-layer optimization to solve it iteratively. From the mathematical model point of view, the lower-level optimal dispatch is an optimal power flow problem based on mixed integer second-order cone programming (MISOCP), which is similar to my previous blog ( distribution network reconstruction based on mixed integer second-order cone programming (MISOCP) ) The model in this article is basically the same. The difference is that the model in this article has no topological variables (that is, no reconstruction is considered), and the node electricity price is added as a variable.

        Step 4 : Upper-level particle swarm algorithm

        In the upper-level particle swarm algorithm, there is only one decision variable a_G, which represents the bidding strategy of the producer and marketer, and the output strategy of the producer and marketer is obtained through the lower-level optimization scheduling. The upper-level objective function is to maximize the benefits of multiple producers and sellers, which is essentially a multi-objective optimization. However, the article does not specifically tell what optimization method is used. In the code, I directly maximize the overall benefits of the three producers and sellers as Optimize goals and convert multiple goals into single goals.

        Step 5 : Iterative optimization of upper and lower layers

        Through the iterative solution of upper and lower layer optimization, the optimal solution of the master-slave game is obtained.

        Step 6 : Output optimization results

        Find the final optimization result according to the chart form given in the article.

4.Matlab code

%% 清除变量
clc
clear
close all
warning off
 
tic
%% 设置种群参数
parameters;
index = input('选择仿真时刻,1:T=8h,2:T=15h  :');
sizepop = 25;                       % 初始种群个数
dim = 3;                            % 空间维数
ger = 50;                           % 最大迭代次数    
x_max = f_grid*ones(1,dim);         % 位置上限
x_min = zeros(1,dim);               % 位置下限
v_max = 20*ones(1,dim);             % 速度上限
v_min = -20*ones(1,dim);            % 速度下限
wb = 1.5;                           % 惯性权重初值
we = 0.1;                           % 惯性权重末值
c_1b = 1.5;                         % 自我学习因子初值
c_1e = 0.1;                         % 自我学习因子末值
c_2b = 0.1;                         % 群体学习因子初值
c_2e = 1.5;                         % 群体学习因子末值
%% 种群初始化
pop = x_min + rand(sizepop,dim).*(x_max-x_min);     % 初始化种群
pop_v = v_min + rand(sizepop,dim).*(v_max-v_min);   % 初始化种群速度        
pop_zbest = pop(1,:);                               % 初始化群体最优位置
pop_gbest = pop;                                    % 初始化个体最优位置
fitness = zeros(1,sizepop);                         % 所有个体的适应度
fitness_zbest = -inf;                               % 初始化群体最优适应度
fitness_gbest = -inf*ones(1,sizepop);               % 初始化个体最优适应度
%% 初始的适应度
for k = 1:sizepop
    % 计算适应度值
    [Gi,~,~,~,~] = Up_fitnessfun(pop(k,:),index);
    fitness(k) = sum(Gi);
    if fitness(k) > fitness_zbest
        fitness_zbest = fitness(k);
        pop_zbest = pop(k,:);
    end
end
history_pso = zeros(1,ger);            % 粒子群历史最优适应度值
%% 迭代求最优解
iter = 1;
while iter <= ger
    % 更新惯性权重和学习因子
    g = iter;
    g_max = ger;
    w = wb - g/g_max*(wb - we);
    c_1 = c_1e + (c_1b - c_1e)*(1 - acos(-2*g/g_max + 1)/pi);
    c_2 = c_2e + (c_2b - c_2e)*(1 - acos(-2*g/g_max + 1)/pi);
    for k = 1:sizepop
        % 更新速度并对速度进行边界处理 
        pop_v(k,:)= w * pop_v(k,:) + c_1*rand*(pop_gbest(k,:) - pop(k,:)) + c_2*rand*(pop_zbest - pop(k,:));
        for kk = 1:dim
            if  pop_v(k,kk) > v_max(kk)
                pop_v(k,kk) = v_max(kk);
            end
            if  pop_v(k,kk) < v_min(kk)
                pop_v(k,kk) = v_min(kk);
            end
        end
        % 更新位置并对位置进行边界处理
        pop(k,:) = pop(k,:) + pop_v(k,:);
        for kk = 1:dim
            if  pop(k,kk) > x_max(kk)
                pop(k,kk) = x_max(kk);
            end
            if  pop(k,kk) < x_min(kk)
                pop(k,kk) = x_min(kk);
            end
        end
        % 更新适应度值
        [Gi,~,~,~,~] = Up_fitnessfun(pop(k,:),index);
        fitness(k) = sum(Gi);
        if fitness(k) > fitness_zbest
            fitness_zbest = fitness(k);
            pop_zbest = pop(k,:);
 
        end
        if fitness(k) > fitness_gbest(k)
            fitness_gbest(k) = fitness(k);
            pop_gbest(k,:) = pop(k,:);
        end
    end
    history_pso(iter) = fitness_zbest;
    disp(['PSO第',num2str(iter),'次迭代最优适应度=',num2str(fitness_zbest)])
    iter = iter+1;
end
time0 = toc;
 
 
%% 运行结果
show_result;

        The above is only the matlab code for the main function part. The complete matlab code can be obtained from this link (note that Matpower and Yalmip toolbox, as well as the Cplex solver need to be installed to run the code. If there are other solvers, they can be changed in the settings) :

Matlab code of prosumer bidding strategy for new urban power distribution system based on master-slave game

5. Analysis of running results

        Because the original article did not provide complete data, the results are not exactly the same, but the principle is the same.

Guess you like

Origin blog.csdn.net/weixin_44209907/article/details/132794503