Micro-grid scheduling method based on particle swarm optimization
Through the microgrid scheduling method based on particle swarm algorithm, the problem that the existing technology is difficult to balance electricity consumption costs and user satisfaction is solved, and the optimization of electricity consumption costs and the improvement of user satisfaction is achieved.
Patent Information
- Application Number
- CN202411408793.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-21
AI Technical Summary
The existing microgrid optimization scheduling methods are mainly based on the cost perspective, and it is difficult to effectively balance electricity consumption costs and user satisfaction.
The microgrid scheduling method based on particle swarm algorithm is adopted to determine the unit electricity consumption cost and user satisfaction of various types of power supplies, and to construct an objective function, use the particle swarm algorithm to optimize the electricity consumption combination, and balance the electricity consumption cost and user satisfaction.
The optimization of electricity consumption costs and the improvement of user satisfaction are achieved, which can effectively balance the relationship between the two and improve the overall efficiency and reliability of the microgrid.
Smart Images

Figure CN119496179A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of microgrid scheduling, and in particular to a microgrid scheduling method based on a particle swarm algorithm. Background Art
[0002] A microgrid is a small power generation and distribution system consisting of distributed power sources, energy storage devices, energy conversion devices, loads, etc. A microgrid is an autonomous system that can achieve self-control, protection and management, and can be connected to an external power grid or operated in isolation.
[0003] There are two typical operation modes of microgrids: Under normal circumstances, the microgrid is connected to the distribution network and operated in a networked mode; when a grid fault is detected or the power quality does not meet the requirements, the microgrid will be disconnected from the distribution network in time and operate independently, which is called the island mode. The switching between the two must be smooth and fast. Relative to the external large grid, the microgrid behaves as a single controlled unit and can simultaneously meet the user's requirements for power quality and power supply safety. The power supply inside the microgrid is mainly responsible for energy conversion by power electronic devices and provides necessary control.
[0004] As a new type of power supply system, microgrid is characterized by high efficiency, green, recycling, low carbon and intelligence, and can effectively achieve the balance between supply and demand of green energy in local areas. It is of great significance to promote the green and low-carbon transformation of energy, improve the grid's ability to accept, configure and regulate clean energy, and enhance the clean energy supply capacity. Microgrid optimization and scheduling are of great significance to improving energy supply efficiency, enhancing the reliability and stability of the grid, and improving the economy and sustainable development of the grid. However, at present, the optimization and scheduling of microgrids are usually only optimized from the perspective of cost, with a single optimization method, and it is difficult to effectively balance electricity costs and user satisfaction. Summary of the invention
[0005] To solve the above problems, the present application provides a microgrid scheduling method based on particle swarm algorithm, including:
[0006] Step S1, determining the unit electricity cost of various power sources, wherein the various power sources include at least new energy sources and city power sources, and the new energy sources include at least wind power sources, photovoltaic power sources and energy storage power sources;
[0007] Step S2, initializing parameters related to the energy storage power supply, including at least battery capacity, battery initial SOC value, maximum SOC value, minimum SOC value, and hourly charge and discharge power;
[0008] Step S3, constructing an objective function f using electricity cost and user satisfaction;
[0009] Step S4, initializing the relevant parameters of the particle swarm algorithm, including the inertia factor w, the learning factors c1 and c2, the particle swarm size m, the maximum number of iterations, and the maximum value of the power exchange allowed between the microgrid and the distribution network.
[0010] Each particle in the particle group represents a set of data including the SOC curve of the energy storage power source and the output conditions of other power sources.
[0011] Among them, the SOC change value of the energy storage power supply is used as the speed change of the particle, and the SOC of the energy storage power supply is used as the position of the particle;
[0012] Step S5: for each particle, initialize the output of each power source, including the SOC curve of the energy storage power source, and the output of other power sources;
[0013] Step S6, calculating the total electricity cost and the total amount of unsatisfied load according to the output of each power source and the unit electricity cost, thereby calculating the objective function f and determining the local optimal solution and the global optimal solution F;
[0014] Step S7, using the particle swarm algorithm to update the moving speed and position of each particle in the particle swarm;
[0015] Step S8, return to step S6, update the local optimal solution, and compare it with the global optimal solution obtained in the previous cycle, and take the smaller one to update as the global optimal solution F, until the number of iterations is reached.
[0016] Optionally, the unit electricity cost of the mains power supply complies with a tiered electricity price.
[0017] Optionally, the objective function is f=a1*f1+a2*f2
[0018] Among them, a1 is the electricity cost weight;
[0019] a2 is the user satisfaction weight;
[0020] f1 is the total electricity cost;
[0021] f2 is user satisfaction.
[0022] Optionally, the total electricity cost f1 is calculated based on the unit electricity cost and output of various power sources;
[0023] User satisfaction is characterized by the total amount of unmet load.
[0024] Optionally, for each particle, combined with load requirements, the output of various power sources is determined based on the principle of giving priority to the consumption of new energy sources to supply power to users.
[0025] Optionally, the principle of giving priority to the consumption of renewable energy is that when renewable energy is insufficient, electricity is taken from the distribution network, and when electricity is taken from the distribution network, the condition of not exceeding the maximum allowable exchange power must be met.
[0026] Optionally, update the particle's velocity and position according to the following formula:
[0027] v i+1,j =wv i,j +c1·r1(p i,j -x i,j )+c2·r2(p i,g -x i,j )
[0028] x i+1,j =x i,j +v i+1,j
[0029] Among them, c1 and c2 are learning factors;
[0030] w is the inertia factor;
[0031] Both r1 and r2 represent random numbers between 0 and 1;
[0032] v i,j 、x i,j is the velocity and position of the jth particle in the i-th iteration;
[0033] p i,j It means that in the i-th iteration, the objective function f of the j-th particle among all particles is the minimum value, which is stored in pbest as the local optimal solution;
[0034] p i,g It means comparing the i-th local optimal solution of the iteration with the i-1-th global optimal solution, taking the smaller one as the global optimal solution and storing it in gbest.
[0035] Optionally, a1 and a2 are random numbers between 0 and 1, and the sum of a1 and a2 is 1.
[0036] Optionally, the step of calculating the objective function f and determining a local optimal solution and a global optimal solution refers to:
[0037] The minimum value of the objective function f among all particles is recorded as the local optimal solution in the particle swarm, and initially the objective function values f of all particles are recorded as the global optimal solution F.
[0038] Compared with the prior art, this application has the following beneficial effects:
[0039] (1) This application calculates various types of electricity consumption at cost price, which is conducive to quantifying the electricity consumption of wind power, photovoltaic power, and energy storage, and thus obtaining the optimal electricity cost;
[0040] (2) This application uses load shedding as a quantitative expression of user satisfaction, which is conducive to quantifying the impact of load shedding and considering it in a unified manner;
[0041] (3) This application applies the particle swarm algorithm, which achieves deep optimization of electricity consumption combinations through a large number of iterations of a large number of particles, and can effectively balance electricity costs and user satisfaction levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a flow chart of a microgrid scheduling method based on a particle swarm algorithm according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. 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.
[0044] The microgrid dispatching method based on particle swarm algorithm in this embodiment quantifies the cost of electricity consumption modes such as wind power generation, photovoltaic power generation, city power, and energy storage, and optimizes the charging and discharging process of energy storage power by utilizing the charging and discharging characteristics of energy storage power supply. At the same time, user satisfaction is introduced, and the electricity cost is further reduced by reducing part of the load and sacrificing user satisfaction.
[0045] The microgrid scheduling method based on the particle swarm algorithm of this embodiment can use python to build a microgrid optimization project. The specific execution steps are as follows:
[0046] Step S1, determining the unit electricity cost of various power sources, wherein the various power sources include at least wind power generation power source, photovoltaic power generation power source, mains power source, and energy storage power source, and the various power sources are used to supply power to users. The unit electricity cost of various power sources refers to the unit cost when the power source is used for power supply. For example, the unit electricity cost of wind power generation power source is CostF, the unit electricity cost of photovoltaic power generation power source is CostS, the unit electricity cost of energy storage power source is CostC, the unit electricity cost of mains power source is Pbuys, etc.
[0047] For example, the unit electricity cost CostF of wind power generation is 0.8 yuan / kWh, the unit electricity cost of photovoltaic power generation is 0.5 yuan / kWh, and the unit electricity cost of energy storage power supply is 1 yuan / kWh.
[0048] The unit electricity cost of the mains power supply conforms to the actual situation of the tiered electricity price. For example, if the tiered electricity price is 24 hours a day, the electricity price may be different. Then, the unit electricity cost Pbuys of the mains power supply is an array containing 24 values, as shown in the following table.
[0049] Ladder time period Unit cost (unit: yuan / kWh) 0~1 0.7 1~2 0.7 2~3 0.7 3~4 0.7 4~5 0.7 5~6 0.7 6~7 1.2 7~8 1.2 8~9 1.7 9~10 1.7 10~11 1.7 11~12 1.7 12~13 1.7 13~14 1.7 14~15 1.7 15~16 1.7 16~17 1.7 17~18 1.7 18~19 1.2 19~20 1.2 20~21 1.2 21~22 0.7 22~23 0.7 23~0 0.7
[0050] Step S2, initializing parameters related to the energy storage power supply, including at least the battery capacity XDCRL, the battery initial SOC value SOC_init, the maximum SOC value SOC_max, the minimum SOC value SOC_min, and the hourly charge and discharge power SOC_step.
[0051] Among them, battery capacity is one of the important performance indicators to measure battery performance, and is a unit of measurement that represents the amount of battery reserve power.
[0052] The initial SOC value of the battery refers to the ratio of the current remaining power of the battery to the battery capacity. For example, if the current power is 60% and the battery capacity is 100%, the initial SOC value of the battery is 60%.
[0053] The battery SOC value fluctuates within the ideal range, which can extend the battery life and ensure the battery performance. Therefore, the battery is set with a maximum SOC value and a minimum SOC value, and the battery SOC curve should fluctuate within this range.
[0054] The maximum SOC value refers to the ratio of the maximum remaining battery power to the full battery power. For example, if the maximum remaining battery power is 90% and the battery capacity is 100%, the maximum SOC value is 90%.
[0055] The minimum SOC value refers to the ratio of the minimum remaining battery power to the full battery power. For example, if the minimum remaining battery power is 20% and the battery capacity is 100%, the minimum SOC value is 20%.
[0056] Step S3, constructing an objective function f, wherein the objective function is
[0057] f=a1*f1+a2*f2
[0058] Among them, a1 is the electricity cost weight;
[0059] a2 is the user satisfaction weight;
[0060] a1 and a2 can both be set to 0.5, or they can be set as needed, for example, a1 is 0.4 and a2 is 0.6.
[0061] f1 is a total electricity cost calculation model, which can calculate the total electricity cost based on the unit electricity cost and output (i.e. electricity consumption) of various power sources.
[0062] Specifically, for example, the unit electricity cost CostF of wind power generation is 0.8 yuan / kWh, and the electricity consumption is 1,000 kWh; the unit electricity cost of photovoltaic power generation is 0.5 yuan / kWh, and the electricity consumption is 4,000 kWh; the unit electricity cost of energy storage power is 1 yuan / kWh, and the electricity consumption is 3,000 kWh. The unit electricity cost is multiplied by the electricity consumption to obtain the total electricity cost of this type of power supply.
[0063] Since the electricity cost of the mains power supply complies with the tiered electricity price, the electricity cost for each time period is obtained by multiplying the unit electricity cost in each time period by the electricity consumption in that time period, and the total electricity cost of the mains power supply is obtained by adding up the electricity costs of the 24-hour time period.
[0064] Add up the total electricity costs of the above various power sources to obtain the total electricity cost.
[0065] f2 is a user satisfaction calculation model, which can be specifically represented by the total amount of unmet load within 24 hours.
[0066] For example, during the time period from 13:00 to 14:00, the total load of electricity demand is 10,000 kilowatts, and the total amount of electricity that can be provided by various power sources is 8,000 kilowatts. Then the total amount of unmet load is the difference between 10,000 kilowatts and 8,000 kilowatts, that is, the total amount of unmet load is 2,000 kilowatts.
[0067] Step S4, initialize the relevant parameters of the particle swarm algorithm, including the inertia factor w, the learning factors c1 and c2, the particle swarm size m, the maximum number of iterations iter_num, the maximum velocity max_vel of the particles, the minimum velocity min_vel of the particles, and the maximum value pgridmax of the power exchange allowed between the microgrid and the distribution network.
[0068] The particle swarm optimization algorithm does not need to derive the objective function and has the ability of global retrieval and local optimization. It is a commonly used heuristic optimization algorithm.
[0069] The particle group size m represents the number of particles in the particle group, and each particle represents a set of data including the SOC curve of the energy storage power source within 24 hours and the output of other power sources within 24 hours. The following is to find the most suitable matching situation by iteratively changing the SOC curve and output situation.
[0070] The SOC change value of the energy storage power supply is used as the speed change of the particle, and the SOC of the energy storage power supply is used as the position of the particle.
[0071] Step S5: for each particle, initialize the SOC curve of the energy storage power source within 24 hours, and the output of other power sources within 24 hours.
[0072] Among them, according to the SOC curve of the energy storage power supply within 24 hours, combined with the relevant parameters of the energy storage power supply (i.e., the parameters in step S2), the charge and discharge power of the energy storage power supply in 24 time periods can be calculated. Specifically, for example, the SOC is 80% at 12:00 and the SOC is 70% at 13:00, then the SOC change from 12:00 to 13:00 is 10%, so the charge and discharge power in this time period can be calculated.
[0073] Among them, for each particle, the output of various power sources can be determined based on the load demand within 24 hours and the principle of giving priority to the consumption of new energy sources to supply power to users. Specifically, when the new energy source is insufficient, power is taken from the distribution network, and when power is taken from the distribution network, the condition limit of not exceeding pgridmax must be met, so as to preliminarily determine the output of each power source, and the new energy source refers to the above-mentioned wind power generation power source, photovoltaic power generation power source, and energy storage power source.
[0074] Step S6, calculating the total electricity cost and the total amount of unmet load according to the output of each power source and the unit electricity cost, thereby calculating the objective function f.
[0075] Among the m particles, the minimum value of the objective function f is recorded as the local optimal solution, and the corresponding particle information (SOC value and output of various power sources) is recorded at the same time;
[0076] It should be noted that initially, the objective function values f of all particles are simultaneously recorded as the global optimal solution F.
[0077] Step S7, using the particle swarm algorithm, updates the moving speed (SOC change value) of each particle in the particle swarm, and updates the SOC position of each particle, that is, the original SOC value plus the change value of one step.
[0078] Specifically, the velocity and position of the particle can be updated according to the following formula:
[0079] v i+1,j =wv i,j +c1·r1(p i,j -x i,j )+c2·r2(p i,g -x i,j )
[0080] x i+1,j =x i,j +v i+1,j
[0081] Among them, c1 and c2 are learning factors;
[0082] w is the inertia factor;
[0083] Both r1 and r2 represent random numbers between 0 and 1;
[0084] v i,j 、x i,k is the velocity and position of the jth particle in the i-th iteration;
[0085] p i,j It means that in the i-th iteration, the objective function f of the j-th particle among all particles is the minimum value, which is stored in pbest as the local optimal solution;
[0086] p i,g It means comparing the i-th local optimal solution of the iteration with the i-1-th global optimal solution, taking the smaller one as the global optimal solution and storing it in gbest.
[0087] Step S8, return to step S6, update the local optimal solution, and compare it with the global optimal solution obtained in the previous cycle, take the smaller one and update it as the global optimal solution F, and record the corresponding particle information until the number of iterations is reached. At this time, the global optimal particle is the optimization target.
[0088] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may make various corresponding changes and deformations according to the present invention, but these corresponding changes and deformations shall fall within the protection scope of the claims of the present invention.
Claims
1. A microgrid scheduling method based on particle swarm algorithm, characterized in that: include: Step S1, determining the unit electricity cost of various power sources, wherein the various power sources include at least new energy sources and city power sources, and the new energy sources include at least wind power sources, photovoltaic power sources and energy storage power sources; Step S2, initializing parameters related to the energy storage power supply, including at least battery capacity, battery initial SOC value, maximum SOC value, minimum SOC value, and hourly charge and discharge power; Step S3, constructing an objective function f using electricity cost and user satisfaction; Step S4, initializing the relevant parameters of the particle swarm algorithm, including the inertia factor w, the learning factors c1 and c2, the particle swarm size m, the maximum number of iterations, and the maximum value of the power exchange allowed between the microgrid and the distribution network. Each particle in the particle group represents a set of data including the SOC curve of the energy storage power source and the output of other power sources. Among them, the SOC change value of the energy storage power supply is used as the speed change of the particle, and the SOC of the energy storage power supply is used as the position of the particle; Step S5: for each particle, initialize the output of each power source, including the SOC curve of the energy storage power source and the output of other power sources; Step S6, calculating the total electricity cost and the total amount of unsatisfied load according to the output of each power source and the unit electricity cost, thereby calculating the objective function f and determining the local optimal solution and the global optimal solution F; Step S7, using the particle swarm algorithm to update the moving speed and position of each particle in the particle swarm; Step S8, return to step S6, update the local optimal solution, and compare it with the global optimal solution obtained in the previous cycle, and take the smaller one to update as the global optimal solution F, until the number of iterations is reached.
2. The microgrid dispatching method based on particle swarm algorithm according to claim 1 is characterized in that: The unit electricity cost of the mains power supply complies with the tiered electricity price.
3. The microgrid scheduling method based on particle swarm algorithm according to claim 1 is characterized in that: The objective function is f=a1*f1+a2*f2 Among them, a1 is the electricity cost weight; a2 is the user satisfaction weight; f1 is the total electricity cost; f2 is user satisfaction.
4. The microgrid dispatching method based on particle swarm algorithm according to claim 3 is characterized in that: The total electricity cost f1 is calculated based on the unit electricity cost and output of various power sources; the user satisfaction is characterized by the total amount of unmet load.
5. The microgrid dispatching method based on particle swarm algorithm according to claim 4 is characterized in that: For each particle, the output of various power sources is determined based on load requirements and the principle of giving priority to the consumption of new energy sources to supply power to users.
6. The microgrid dispatching method based on particle swarm algorithm according to claim 5 is characterized in that: The principle of giving priority to the consumption of new energy is that when new energy is insufficient, electricity is taken from the distribution network, and when electricity is taken from the distribution network, the condition of not exceeding the maximum allowable exchange power must be met.
7. The microgrid dispatching method based on particle swarm algorithm according to claim 5 is characterized in that: Update the particle's velocity and position according to the following formula: v i+1,j =wv i,j +c1·r1(p i,j -x i,j )+c2·r2(p i,g -x i,j ) x i+1,j =x i,j +v i+1,j Among them, c1 and c2 are learning factors; w is the inertia factor; Both r1 and r2 represent random numbers between 0 and 1; v i,j 、x i,j is the velocity and position of the jth particle in the i-th iteration; p i,j It means that in the i-th iteration, the objective function f of the j-th particle among all particles is the minimum value, which is stored in pbest as the local optimal solution; p i,g It means comparing the i-th local optimal solution of the iteration with the i-1-th global optimal solution, taking the smaller one as the global optimal solution and storing it in gbest.
8. The microgrid dispatching method based on particle swarm algorithm according to claim 5, characterized in that: a1 and a2 are random numbers between 0 and 1, and the sum of a1 and a2 is 1.
9. The microgrid dispatching method based on particle swarm algorithm according to claim 1, characterized in that: The calculation of the objective function f and determination of the local optimal solution and the global optimal solution refers to: The minimum value of the objective function f among all particles is recorded as the local optimal solution in the particle swarm, and initially the objective function values f of all particles are recorded as the global optimal solution F.
Citation Information
Patent Citations
Layered dynamic control method for hybrid energy storage system
CN107294122A
Micro-grid regulation and control method, system and equipment considering wind and light storage and demand response
CN118646092A