A rooftop photovoltaic installed capacity optimization method based on improved artificial fish swarm algorithm
By improving the artificial fish swarm algorithm and multi-objective optimization algorithm, combined with satellite image data and mathematical models, the rooftop photovoltaic installed capacity is optimized, solving the problem of poor rooftop photovoltaic installation efficiency in the existing technology, and realizing the efficient development and economical development of rooftop resources. , Maximization of social benefits.
Patent Information
- Application Number
- CN202410355870.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-03-27
AI Technical Summary
Existing technology is difficult to effectively optimize rooftop photovoltaic installed capacity, resulting in poor economic and social benefits, and it is difficult to prioritize the development of rooftop photovoltaic resources.
Using an improved artificial fish swarm algorithm combined with deep learning and multi-objective optimization algorithms, the rooftop photovoltaic installed capacity is optimized through satellite image data and mathematical models to maximize economic benefits and optimize social benefits.
It improves the optimization accuracy and speed of rooftop photovoltaic installed capacity, ensures priority development of roofs with large roof areas and good light intensity, and maximizes the economic and social benefits of rooftop photovoltaic installations in the province.
Smart Images

Figure CN118278565B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of photovoltaic roof resource prediction, and in particular relates to a method for optimizing roof photovoltaic installed capacity based on an improved artificial fish swarm algorithm. Background Art
[0002] With the advancement of the dual carbon goals, the proportion of new energy is increasing. Among them, solar energy, as a renewable energy, has become one of the most important renewable energy sources in the world. Photovoltaic power generation is the main new energy source. It is hoped that more solar energy can be developed within a limited space. The roof has good lighting conditions and has a large amount of land resources. Rooftop photovoltaic installation will not occupy tight land resources. In the case of shortage of energy resources and land resources, the development of rooftop solar photovoltaic can effectively solve the problems of urban energy demand and land shortage. The development of rooftop photovoltaics in the province is a long-term planning project. Rooftops with rich roof resources and good lighting conditions need to be developed first, and rooftops that are difficult to develop or have low income need to be developed later or not at all. Therefore, an effective rooftop photovoltaic installed capacity planning optimization strategy is urgently needed to promote the construction of photovoltaic roofs throughout the province. Summary of the invention
[0003] Purpose of the invention: In order to overcome the shortcomings of the prior art, a method for optimizing rooftop photovoltaic installed capacity based on an improved artificial fish swarm algorithm is provided, which integrates deep learning to extract information and a multi-objective optimization algorithm to solve the problem of rooftop installed capacity, aiming to achieve the maximum economic benefit and the best social benefit of rooftop photovoltaic installation in the province, and to give priority to the development of roofs with large roof area and good light intensity.
[0004] Technical solution: To achieve the above purpose, the present invention provides a method for optimizing rooftop photovoltaic installed capacity based on an improved artificial fish swarm algorithm, comprising the following steps:
[0005] S1: Collect roof satellite images to form a roof satellite image dataset, and obtain roof photovoltaic installed capacity information data based on the roof satellite image dataset;
[0006] S2: Based on the information data obtained, a mathematical model is established that takes into account various factors affecting rooftop photovoltaic installed capacity;
[0007] S3: Use the improved artificial fish swarm algorithm to solve the mathematical model, calculate and optimize the rooftop photovoltaic installed capacity, and achieve maximum economic and optimal social benefits.
[0008] Furthermore, the step S1 specifically includes:
[0009] A1: Collect satellite images of urban building roofs;
[0010] In order to obtain the effective area of roofs in various regions, satellite images of urban building roofs are collected, and the effective installed area of roofs in various regions is calculated through image recognition. To ensure the accuracy of the recognition results, the satellite images must be as clear as possible; contain geographic location information to facilitate roof location positioning; and satellite images must be regular and of consistent size to facilitate splicing and overall visualization.
[0011] A2: Classify the collected images and divide them into images of buildings with roofs and images of buildings without roofs through labels;
[0012] A3: Based on the semantic segmentation method, images of buildings with roofs are identified and classified. Roofs are divided into three categories: industrial and commercial park roofs, community high-rise roofs and bungalow roofs, and rural roofs. The effective installation area of the three types of roofs is calculated.
[0013] A4: Based on the PVsyst software, the light radiation in each region is calculated to obtain the photovoltaic installable capacity and photovoltaic radiation intensity in each region.
[0014] Furthermore, the mathematical model in step S2 includes an economic benefit model and a social benefit model.
[0015] Economic benefits include the investment in photovoltaics, the purchase, installation, and maintenance of photovoltaic power generation devices, and the price of cables and conductors. These are the initial investments for installing photovoltaic components. The installation difficulty and cost vary according to the type of roof. Economic benefits also include the income from electricity bills. The income from electricity bills for different types of roofs is also different. The income from photovoltaics is mainly the value of electricity bills. The higher the return on investment, the better the benefit of the roof. The return on investment refers to the ratio of the net income generated by a photovoltaic project during its life cycle to the investment cost. The difference between the net income generated by a photovoltaic project during its life cycle and the investment cost can also be used to judge the economic benefits.
[0016] The method for establishing the economic benefit model is as follows:
[0017] B1: Constructing a mathematical model for investment expenditure
[0018] Investment cost: The cost of power generation projects For project investors, the static total investment of rooftop distributed photovoltaic power generation projects mainly includes: pre-construction fees, supervision fees, equipment fees, construction and installation engineering fees, roof rental, etc. The construction of rooftop distributed photovoltaic power generation projects in the province involves a variety of roofs. For the roofs of residential high-rise buildings, bungalows, industrial and commercial and rural houses, the investment price of installing photovoltaics is different for different roof types. The development of residential roofs is difficult, and it takes a high cost to transport photovoltaic modules to high-rise buildings. The overall construction cost of such rooftop distributed photovoltaic power generation projects is between 3.0 and 3.5 yuan / W; most of the houses in industrial and commercial parks are large-span steel structure factories, and their roofs are mainly insulated colored steel tile roofs. Some roofs need secondary reinforcement. The overall construction cost of such rooftop distributed photovoltaic power generation projects is between 2.3 and 3 yuan / W; the roofs of bungalows and rural houses are mainly red tile sloping roofs, and a few are concrete flat roofs. The overall construction cost of such rooftop distributed photovoltaic power generation projects is between 2 and 2.8 yuan / W. Based on the above information, a mathematical model of investment costs can be constructed
[0019]
[0020] in, The total cost of installing photovoltaic power on the roofs of region i is: The cost of installing photovoltaics on the roofs of commercial and industrial buildings in region i, The cost of installing photovoltaic power on the roofs of high-rise buildings in the area i community, The cost of installing photovoltaics on the roofs of bungalows in region i;
[0021]
[0022] in, is the effective installation area of the roof of the industrial and commercial building in region i, C I The cost of installing a system on the roof of an industrial or commercial building;
[0023]
[0024] in, is the effective installation area of the high-rise rooftops in the community in region i, C H The cost of installing power on the roofs of high-rise buildings in the community;
[0025]
[0026] in, The effective installation area of bungalows and rural roofs in region i, C B Installation costs for bungalows and rural rooftops;
[0027] B2: Constructing a mathematical model for maintenance costs
[0028] Maintenance costs: The installed rooftop photovoltaic system may be affected by the external environment and cause a series of failures. Considering a series of costs such as the later maintenance of photovoltaic components, the investment cost is corrected with a correction coefficient of K1. The corrected equation is:
[0029]
[0030] in, is the total cost of installing photovoltaic power on the roof of region i after correction, and K1 is the maintenance correction factor;
[0031] B3: Constructing a mathematical model for power generation revenue
[0032] Power generation income: The income of rooftop distributed photovoltaic power generation projects mainly involves factors such as horizontal radiation and electricity prices.
[0033] Annual total horizontal radiation: The total solar radiation on the horizontal surface in each region is different in one year. The annual total horizontal radiation is calculated using solar energy measurement software.
[0034] Electricity price: Distributed photovoltaic power generation projects built on bungalows and rural roofs mainly adopt the "full grid-connected" model, while distributed photovoltaic power generation projects built on the roofs of high-rise buildings in residential areas and industrial and commercial parks mainly adopt the "self-generation for self-use, surplus power grid-connected" model. Industrial and commercial parks consume a lot of electricity, and it can be considered that all the electricity generated by photovoltaic modules is "self-generation for self-use". Therefore, the electricity price of rooftop distributed photovoltaic power generation projects can be divided into "self-generation for self-use" electricity price, "surplus power grid-connected" electricity price and "full grid-connected" electricity price. Among them, the "self-generation for self-use" electricity price is the electricity price of the roof owner in the project. The industrial electricity price is between 0.6 and 1.2 yuan / kWh, and the "surplus power grid-connected" or "full grid-connected" electricity price is 0.391 yuan / kWh. Based on the above information, the mathematical formula of the photovoltaic rooftop power generation revenue model can be constructed:
[0035]
[0036] The electricity revenue from all rooftop PV in region i is: The electricity revenue brought by the commercial and industrial rooftop photovoltaics in region i, The electricity revenue brought by photovoltaic power generation on the rooftops of high-rise buildings in the community in region i, The electricity revenue generated by photovoltaic power generation on bungalows and rural rooftops in region i;
[0037]
[0038] Among them, P1 is the electricity price in the self-generation and self-use mode, R iis the total annual horizontal radiation of the photovoltaic roof in region i, 25% is the power generation efficiency of the photovoltaic module, including the photovoltaic radiation conversion efficiency, photovoltaic module heat generation and other losses;
[0039]
[0040] Among them, P2 is the electricity price under the mode of 50% self-generation for self-use and 50% surplus power for grid connection;
[0041]
[0042] Among them, P3 is the electricity price under the full grid-connected mode;
[0043] B4: Constructing a mathematical model for maximizing economic benefits:
[0044]
[0045] Among them, i is 1 to n, and the economic benefits of all regions combined are the best. Considering the loss of photovoltaic panels, only the costs generated in 15 years are selected, X i is the area of photovoltaic installation to be installed in region i, is the total effective area where photovoltaic power can be installed in region i; M1 is the economic benefit, and the ultimate goal is to maximize the economic benefit.
[0046] A social benefit model for photovoltaic roofs is established, taking into account the environmental performance of the photovoltaic system and the impact of the photovoltaic system on local communities and residents. The present invention pays more attention to the photovoltaic system's balance of grid stability and grid supply and demand balance, hoping that the electricity generated by photovoltaics will just meet the incremental electricity demand, and achieve the best environmental protection and user electricity experience. The present invention compares the incremental electricity demand with the amount of electricity generated by the photovoltaic system, and the smallest difference in the supply and demand balance of the entire province is the best. The amount of electricity increased by photovoltaics cannot exceed the upper limit of the grid's carrying capacity, otherwise it may cause a series of problems such as peak power outages and device losses.
[0047] The method of establishing the social benefit model is as follows:
[0048] C1: Constructing a mathematical model for supply and demand balance: Selecting the historical photovoltaic capacity increase as the standard for supply and demand balance, and predicting the photovoltaic and load increments to obtain this year's photovoltaic capacity to be installed, the following mathematical model can be established:
[0049] S i =|X i -F i |#(11)
[0050] Among them, S i is the deficit of supply and demand balance in region i, reflected in social benefits, F iThe predicted increase in rooftop PV capacity in the region this year based on historical PV installed capacity;
[0051] C2: Constructing a grid carrying capacity model: Considering the limited carrying capacity of the grid, an inequality constraint is imposed on the above model. It is required that the increment of photovoltaic roofs in each region does not exceed the photovoltaic carrying capacity that the grid can access. An inequality constraint model can be established:
[0052] X i ≤U i #(12)
[0053] Among them, U i The upper limit of the grid carrying capacity is obtained by integrating the historical growth of photovoltaic installed capacity and load, as well as the upper limit of grid transformer carrying capacity and other factors that affect the grid carrying capacity;
[0054] C3: Constructing a social benefit model: Based on the above mathematical models of social benefits, the social benefit mainly considers the balance of electricity consumption. The social benefit is obtained by superimposing the balance of supply and demand in various regions of the province. The social benefit is optimal, and the following mathematical model is obtained:
[0055]
[0056] Among them, i ranges from 1 to n, and it is hoped that the social benefits obtained by adding up all regions will be optimal. is the social benefit of region i, and M2 is the overall social benefit.
[0057] The present invention uses an artificial fish school algorithm. The basic idea of the artificial fish school algorithm is that artificial fish find places with more food through foraging, clustering, chasing and other behaviors. The more artificial fish there are, the greater the food concentration is. Therefore, finding the location with the richest food concentration in the environment is the global optimal solution.
[0058] An artificial fish swarm containing n fish can be represented as a set {AF1, AF2, ..., AF n}, the state of the ith artificial fish can be represented as vector X i =(x i1 , x i2 , …, x in ), x in It is represented as the optimization variable of the jth (j=1, 2, ..., n) dimension. f represents the objective function, Y i =f(X i ) indicates state X i There are five important parameters in the artificial fish swarm algorithm, namely, the population size N, the visual field Visual of the artificial fish, the step length Step, the crowding factor δ and the number of repetitions Try_number. i When the current state is better than Xi The corresponding state is poor, then the artificial fish moves towards X i Move the step value in the direction of X next , otherwise look for other states within the field of view to update the state.
[0059] Furthermore, in step S3, in order to balance the global search capability and the local convergence speed to meet the optimization requirements of rooftop photovoltaic installed capacity, the mathematical model optimization of rooftop photovoltaic installed capacity is faster and the global optimization capability is stronger. The artificial fish school algorithm is improved. The solution optimization process of the improved artificial fish school algorithm is specifically as follows:
[0060] D1: Initialize parameters and generate initial fish school:
[0061] Set the population size N, the number of iterations T, and the maximum number of iterations T max , visual field Visual, crowding factor δ, number of trials Try_number, inertia weight w, acceleration factors c1 and c2, after initializing the parameters, use Tent chaotic mapping to initialize the population within the required range, so that each artificial fish covers the entire initial solution space as evenly as possible;
[0062] D2: Initialize the bulletin board:
[0063] Record the current status of each fish, compare the function value of each artificial fish, select the one with the best function value as the current optimal solution and record it on the bulletin board;
[0064] D3: Calculate the artificial fish's field of view and inertia weight:
[0065] Calculate the artificial fish's field of view and inertia weight by referring to the field of view and inertia weight update formula;
[0066] D4: Execute mobile strategy:
[0067] The improved movement strategy is executed for each artificial fish in turn. After each movement behavior is executed, it is compared with the value on the bulletin board. If the function value of the current state of the artificial fish is better than the value on the bulletin board, the function value of the current optimal state of the artificial fish is recorded on the bulletin board as the optimal solution.
[0068] D5: Determine whether to combine mutation operation in the artificial fish movement strategy:
[0069] If the artificial fish does not obtain an objective function value better than the bulletin board after executing the movement strategy, then introduce the mutation operation and random reverse learning strategy and continue to execute step D6; otherwise, jump to step D7;
[0070] D6: Introducing mutation operations and random reverse learning strategies:
[0071] The best historical position of the artificial fish in the bulletin board is taken to replace the current worst artificial fish, so as to form a new fish school; the best artificial fish in the new fish school is subjected to chaotic mutation, and the remaining artificial fish are subjected to Gaussian mutation, and the position of the artificial fish is updated by mutation operation to determine whether the position of the mutated artificial fish is better. If the mutated individual is better, the mutated individual is used to replace the original individual, and then the random reverse learning strategy is executed; if the mutated individual is not better than the best position, the random reverse learning strategy is still executed; after the fish school executes the random reverse strategy, a comparison is also performed to determine whether the state of the artificial fish after executing the reverse learning strategy is better than the best historical position of the artificial fish. If so, the original individual is replaced to update the population, if not, the population is directly updated, and the next round of iteration is continued to execute step D4.
[0072] D7: Determine whether the algorithm is terminated: If the number of iterations T ≥ T max , the algorithm ends and outputs the optimal solution; otherwise, continue to iterate, execute D3 and D4, and T=T+1.
[0073] Furthermore, the improved mobile strategy in step D4 is specifically:
[0074] Artificial fish have four movement behaviors: foraging behavior Prey, swarm behavior Swarm, chasing behavior Follow, and random behavior Move;
[0075] Foraging behavior Prey: In the process of algorithm optimization for foraging behavior, artificial fish AF i The current status is X i , randomly moves within its perceived distance Visual and transforms into X j , compare the objective function values Y corresponding to the two states i , Y j , if Y is satisfied i <Y j , then X i To X j Move; otherwise, perform a cyclic search to update the state of the artificial fish; if the artificial fish is still not found after trying Try_number, a random behavior will occur within the field of view;
[0076] X j =X i +Visual*Rand( )#(14)
[0077]
[0078]
[0079] Among them, the Rand( ) function is used to generate random numbers. The vision Visual represents the visual range of the artificial fish, that is, the perception distance of the artificial fish. The step length Step represents the maximum moving distance of the artificial fish each time it tries to move. Try_number is the number of repetitions, representing the maximum number of attempts of the artificial fish before moving;
[0080] Swarm behavior: In swarm behavior, fish will move closer to the area with more fish. However, too concentrated fish will lead to the emergence of local extrema. Therefore, a crowding factor δ is introduced to adjust the aggregation degree of the fish school. Let the artificial fish AF i The current state is X i , the visual range is d ij <Visual, the number of partners in the current neighborhood is nf, and the state of the central position is X c . If Y c / nf > δY i , then X i Moves towards X j , otherwise, execute the foraging behavior;
[0081]
[0082] Follow behavior: The follow behavior simulates the process of an artificial fish finding the artificial fish with the optimal food degree within the visual range and approaching it. Let the artificial fish AF i The current state is X i , the visual range is d ij <Visual, the number of partners in the current neighborhood is nf, the optimal value in the current neighborhood is Y j , and the state corresponding to the optimal value is X j . If Y c / nf > δY i , then X i Moves towards X j , otherwise, execute the foraging behavior;
[0083]
[0084] Random behavior Move: The random behavior is a default behavior of the foraging behavior, representing the random movement of the artificial fish. When the foraging behavior fails to find a better state after Try_number attempts, the artificial fish X i Can move randomly within the visual range (i.e., d ij <Visual) and reach a new state through Move;
[0085]
[0086] After the artificial fish swarm is initialized, each artificial fish will choose one of the four basic behaviors to perform in each iteration. The usual practice is to use the trial and error method to simulate the four behaviors separately, and then select the one with the best state after iteration as the actual behavior to be performed. The optimization process of the artificial fish swarm algorithm is achieved by approaching the optimal value step by step like this.
[0087] Furthermore, in step D1, the tent chaotic map is used to initialize the population. Before the algorithm starts to execute, AFSA uses a simple random data generation method to initialize the solution space, just like the traditional swarm intelligence algorithm and other meta-heuristic optimization algorithms. This simple random process has great randomness, which is not conducive to obtaining a stable and individual diverse initial solution space. The uneven distribution of the population can easily cause the solution process to fall into the local optimum, which ultimately affects the convergence speed and final result of the algorithm. Chaotic mapping has good randomness and ergodicity, can maintain the diversity of the population, is conducive to the meta-heuristic optimization algorithm to get rid of local traps, and improve the global search ability of the algorithm.
[0088] Chaotic time series is a digital sequence that describes a complex system arranged in time. It is the main manifestation of chaotic discrete conditions and is often used to describe the dynamic characteristics of complex systems and reveal the evolution laws of complex systems. Chaotic optimization is to use chaotic systems to generate chaotic time series, and to use the pseudo-randomness of chaotic motion, initial value sensitivity and other characteristics to improve the ergodicity of the algorithm, thereby improving the optimization efficiency.
[0089] Using chaotic mapping to initialize the population can make the population more evenly distributed in space, thereby expanding the search range of the algorithm, thereby improving the convergence speed and solution accuracy of the algorithm. A large number of experiments have shown that among the 10 commonly used chaotic mappings, the tent chaotic mapping has the best performance, so the present invention uses the tent chaotic mapping to initialize the population of the AFSA algorithm.
[0090] Tent mapping has a simple structure, relatively even distribution, and good convenience. Its expression is as follows:
[0091]
[0092] x n is the population individual before chaotic mapping, x n+1 It is the population individual after chaotic mapping. According to research, when u=0.5, the uniformity of its Tent chaotic mapping is the best. Therefore, the Tent chaotic mapping can be defined as:
[0093]
[0094] Although the Tent chaotic mapping can make the initial population as evenly distributed as possible in the solution space, it is easy to have problems in small cycle periods and fixed points, which makes the Tent chaotic mapping fall into a non-random cycle and affects the solution speed. To solve this problem, the present invention introduces random variables to improve the Tent chaotic mapping. The improved chaotic sequence expression is:
[0095]
[0096] Where N is the number of particles in the chaotic sequence, and rand(0,1) represents a random number in the range of [0, 1].
[0097] Further, in step D3: based on the improvement of the fish school behavior of PSO, in the standard artificial fish school algorithm, the artificial fish has a strong search ability in the field, and its movement direction is mainly determined by the better position obtained by searching in the field, and has nothing to do with the global optimal position. The global optimization ability of the artificial fish school algorithm is poor, and it may even fall into the local optimal solution, so that the accuracy of the solution obtained is not high. In order to make the artificial fish escape the limitation of the scope of the field and enhance the autonomous consciousness of the artificial fish, the inertia mechanism in the particle swarm PSO algorithm is introduced here, so that the algorithm can continue to explore new fields due to the effect of the inertia mechanism when it is temporarily trapped in the local optimal solution, thereby improving the global optimization ability. After the inertia mechanism is introduced into the foraging behavior, tail-chasing behavior, and clustering behavior of the artificial fish, the memory mechanism in PSO is used to compare the current position with the optimal position of the individual history to decide whether to move. This change can reduce the blindness of the movement of the artificial fish. The speed and position update formulas of the standard particle swarm algorithm are as follows:
[0098] v id =wv id +c1r1[gbest-x id ]+c2r2[pbest id -x id ]#(twenty three)
[0099] x id =x id +v id #(twenty four)
[0100] Among them, x i =(x i1 ,x i2 ,…,x iD ) is the current position of particle i, v i =(v i1 ,v i2 ,…,v iD ) is the velocity of particle i, pbest i =(pbest i1 , pbest i2, …, pbest iD ) is the global historical optimal position of the particle swarm, gbest is the global historical optimal position of the particle swarm, w is the inertia weight, c1, c2 are acceleration factors, r1, r2 are random numbers uniformly distributed between [0, 1].
[0101] According to the speed and position update formula of the standard particle swarm algorithm, the movement strategy of the artificial fish school can be further updated to achieve algorithm improvement.
[0102] Furthermore, in step D5, as the artificial fish swarm algorithm is continuously iterated, the artificial fish will gradually gather near the extreme point in the neighborhood, which is prone to premature phenomenon. Due to the lack of a jump-out mechanism, the algorithm is likely to fall into a local optimum, so that the final optimal result cannot be obtained. Considering the above problems, the present invention uses Gaussian mutation and chaotic mutation to optimize the artificial fish swarm algorithm, as follows:
[0103] Gaussian mutation: Gaussian mutation (GM) is a mutation operation that makes the artificial fish jump out of the local extreme value, which can enhance the search ability of the algorithm. When performing Gaussian mutation, it mainly uses a mean μ and variance σ 2 A random number from a normal distribution is used to replace the original gene value, and a random vector that follows a normal distribution is used to act on the original state of the individual to generate a new position. The Gaussian probability density formula is as follows:
[0104]
[0105] Among them, μ represents the expectation of variable x, σ 2 is the variance of x, σ is called the standard deviation, and the above formula is usually recorded as x~N(μ,σ 2 ); when μ=1、σ=0, x~N(0,1), it obeys the standard normal distribution; Gaussian variation can be defined as follows:
[0106] X i|next =X i *[1+N(0,1)]#(26)
[0107] Among them, X i is the current state of the artificial fish, X i|next is the state of the artificial fish after Gaussian mutation, N(0,1) is a random function that obeys the standard Gaussian distribution;
[0108] From the Gaussian distribution characteristics, we can see that most mutation operators are distributed around the original position, which is equivalent to conducting a small-scale neighborhood search around the original position, which is beneficial to improving the optimization accuracy of the algorithm and escaping from the local optimal solution; and there are a few mutation operators far away from the current position, which increases the diversity of the population, is conducive to exploring potential areas, speeds up the probability of the algorithm escaping from the local optimal position, and improves the convergence trend of the algorithm.
[0109] Chaotic mutation: Chaotic mapping has good randomness and traversal properties, which can prevent the population from traversing all states repeatedly and ensure the diversity of the population. In the later stage of iteration, chaotic mapping can be used to enable the population trapped in the local optimal position to obtain a new state, better explore the potential area, and ensure the convergence speed of the algorithm in the later stage. If the population is initialized with chaotic mapping and then adjusted with chaotic mapping, although the population can be updated to a certain extent, the same chaotic mapping often has a large number of repeated points, which will cause the adjustment to fail; if multiple chaotic mappings are used, the adverse effects of repeated points can be avoided. The previous article has used the Tent chaotic mapping to initialize the population. Here, a one-dimensional Logistic mapping different from the Tent mapping will be used to generate a chaotic sequence. The one-dimensional Logistic mapping is defined as follows:
[0110] x n+1 =μx n (1-x n )#(27)
[0111] Among them, x n ∈[0,1]; μ is the Logistic control parameter, and its value range is μ∈[3.56,4];
[0112] When x n ∈[0,1], μ∈[3.56,4], the Logistic map is in a chaotic state; and when x n ∈[0,1], μ=4, the Logistic map is in a completely chaotic state.
[0113] Furthermore, the random reverse learning strategy in step D5 is specifically:
[0114] Combined with the random reverse learning strategy, the reverse learning strategy generates a corresponding reverse solution based on the current solution in the process of population optimization, and iterates by comparing the objective function values of the current solution and the reverse solution. In this process, the search of the reverse solution space is beneficial to expand the search range, allowing the algorithm to escape from local extreme values and enhance its global optimization ability; the definition of the reverse solution is as follows: if there is a point X in the n-dimensional coordinate system, and X∈[X min ,X max ], then its reverse solution X can be calculated by the formula:
[0115] X=X min +X max -X#(28)
[0116] Corresponding to the artificial fish swarm algorithm, the reverse solution can be defined as: the state of an artificial fish is X = (x1, x2, ..., x n ), the corresponding reverse solution is X=(x1,x2,…,x n ), the k-th dimension of the former is x k ,
[0117] x k ∈[a k ,b k ],a k and b k x k The lower and upper limits of the latter (the reverse solution) are x k , x k It can be calculated by the formula;
[0118] x k =a k +b k -x k #(29)
[0119] Since the proposal of reverse learning, reverse learning strategies and their improved strategies have been widely used in various optimization algorithms.
[0120] Since the distance between the reverse solution generated by the reverse learning strategy and the current solution is a fixed value and lacks randomness, the random reverse learning strategy will be used in the present invention to increase the diversity of the search space population and reduce the possibility of the population falling into a local extreme value; the random reverse learning strategy (Random Opposition-based Learning, ROBL) adds a random number of 0,1 on the basis of reverse learning to increase the diversity of the reverse solution space population; the random reverse solution calculation formula is as follows:
[0121] X i|next =X imax +X imin -r*X i #(30)
[0122] Among them, X i is the position of the artificial fish school, X imin and X imax are the upper and lower limits of the artificial fish position, and r is a random number between [0, 1].
[0123] The present invention improves the artificial fish swarm algorithm: Since the basic artificial fish swarm algorithm optimization algorithm has problems such as slow convergence speed and imbalance between global search and local search, the present invention proposes a series of improvement strategies to reduce the adverse effects caused by the inherent defects of the algorithm. The specific improvement strategies are as follows:
[0124] (1) First, the chaotic sequence is generated using the Tent chaotic map to initialize the population so that the initial solutions are distributed as evenly as possible in the solution space, laying a good foundation for global optimization.
[0125] (2) Then, the speed and position update formula of the particle swarm is used to optimize the movement strategy of the artificial fish swarm. The memory mechanism of the particle swarm is introduced to compare the current position with the individual historical optimal position to determine whether to move, thereby reducing the blindness of the artificial fish movement;
[0126] (3) Secondly, consider the mutation stage to avoid the artificial fish swarm strategy from falling into the local optimum. Considering the above problems, this paper will use Gaussian mutation and chaotic mutation to optimize the artificial fish swarm algorithm;
[0127] (4) Combining with the random reverse learning strategy is beneficial for the artificial fish swarm algorithm to expand the search range, enable the algorithm to escape from local extreme values, and enhance its global optimization ability.
[0128] When the algorithm falls into a local optimum in the later stage of running, the worst artificial fish is replaced by the historical best fish on the bulletin board to form a new intermediate fish school. The historical best fish in the intermediate fish school is subjected to chaotic mutation, and the remaining artificial fish are subjected to Gaussian mutation, followed by random reverse learning, so as to increase the algorithm's ability to get rid of local extreme values in the later stage of iteration.
[0129] Beneficial effects: Compared with the prior art, the present invention applies the improved artificial fish swarm algorithm to the planning and optimization of rooftop photovoltaic installed capacity. The improved artificial fish swarm algorithm has higher convergence accuracy, faster convergence speed, and stronger optimization ability. The algorithm is used to solve the established mathematical model, and integrates deep learning to extract information and multi-objective optimization algorithm to solve the rooftop installed capacity problem, aiming to achieve the maximum economic benefit and optimal social benefit of rooftop photovoltaic installation in the province, and to give priority to the development of roofs with large roof area and good light intensity. BRIEF DESCRIPTION OF THE DRAWINGS
[0130] Figure 1 is a flow chart of the method of the present invention;
[0131] Figure 2 To improve the solution optimization process of artificial fish swarm algorithm;
[0132] Figure 3 Schematics optimized for chaos;
[0133] Figure 4This is a graph showing the optimization calculation results of the province's photovoltaic installed capacity obtained in this embodiment. DETAILED DESCRIPTION
[0134] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0135] The present invention provides a method for optimizing rooftop photovoltaic installed capacity based on an improved artificial fish swarm algorithm. Figure 1 As shown, it includes the following steps:
[0136] S1: Collect roof satellite images to form a roof satellite image dataset, and obtain roof photovoltaic installed capacity information data based on the roof satellite image dataset;
[0137] S2: Based on the information data obtained, a mathematical model is established that takes into account various factors affecting rooftop photovoltaic installed capacity;
[0138] S3: Use the improved artificial fish swarm algorithm to solve the mathematical model, calculate and optimize the rooftop photovoltaic installed capacity, and achieve maximum economic and optimal social benefits.
[0139] Step S1 specifically includes:
[0140] A1: Collect satellite images of urban building roofs;
[0141] In order to obtain the effective area of roofs in various regions, satellite images of urban building roofs are collected, and the effective installed area of roofs in various regions is calculated through image recognition. To ensure the accuracy of the recognition results, the satellite images must be as clear as possible; contain geographic location information to facilitate roof location positioning; and satellite images must be regular and of consistent size to facilitate splicing and overall visualization.
[0142] A2: Classify the collected images and divide them into images of buildings with roofs and images of buildings without roofs through labels;
[0143] A3: Based on the semantic segmentation method, images of buildings with roofs are identified and classified. Roofs are divided into three categories: industrial and commercial park roofs, community high-rise roofs and bungalow roofs, and rural roofs. The effective installation area of the three types of roofs is calculated.
[0144] A4: Based on the PVsyst software, the light radiation in each region is calculated to obtain the photovoltaic installable capacity and photovoltaic radiation intensity in each region.
[0145] The mathematical model in step S2 includes an economic benefit model and a social benefit model.
[0146] Economic benefits include the investment in photovoltaics, the purchase, installation, and maintenance of photovoltaic power generation devices, and the price of cables and conductors. These are the initial investments for installing photovoltaic components. The installation difficulty and cost vary according to the type of roof. Economic benefits also include the income from electricity bills. The income from electricity bills for different types of roofs is also different. The income from photovoltaics is mainly the value of electricity bills. The higher the return on investment, the better the benefit of the roof. The return on investment refers to the ratio of the net income generated by a photovoltaic project during its life cycle to the investment cost. The difference between the net income generated by a photovoltaic project during its life cycle and the investment cost can also be used to judge the economic benefits.
[0147] The method for establishing the economic benefit model is as follows:
[0148] B1: Constructing a mathematical model for investment expenditure
[0149] Investment cost: The cost of power generation projects For project investors, the static total investment of rooftop distributed photovoltaic power generation projects mainly includes: pre-construction fees, supervision fees, equipment fees, construction and installation engineering fees, roof rental, etc. The construction of rooftop distributed photovoltaic power generation projects in the province involves a variety of roofs. For the roofs of residential high-rise buildings, bungalows, industrial and commercial and rural houses, the investment price of installing photovoltaics is different for different roof types. The development of residential roofs is difficult, and it takes a high cost to transport photovoltaic modules to high-rise buildings. The overall construction cost of such rooftop distributed photovoltaic power generation projects is between 3.0 and 3.5 yuan / W; most of the houses in industrial and commercial parks are large-span steel structure factories, and their roofs are mainly insulated colored steel tile roofs. Some roofs need secondary reinforcement. The overall construction cost of such rooftop distributed photovoltaic power generation projects is between 2.3 and 3 yuan / W; the roofs of bungalows and rural houses are mainly red tile sloping roofs, and a few are concrete flat roofs. The overall construction cost of such rooftop distributed photovoltaic power generation projects is between 2 and 2.8 yuan / W. Based on the above information, a mathematical model of investment costs can be constructed
[0150]
[0151] in, The total cost of installing photovoltaic power on the roofs of region i is: The cost of installing photovoltaics on the roofs of commercial and industrial buildings in region i, The cost of installing photovoltaic power on the roofs of high-rise buildings in the area i community, The cost of installing photovoltaics on the roofs of bungalows in region i;
[0152]
[0153] in, is the effective installation area of the roof of the industrial and commercial building in region i, C IThe cost of installing a system on the roof of an industrial or commercial building;
[0154]
[0155] in, is the effective installation area of the high-rise rooftops in the community in region i, C H The cost of installing power on the roofs of high-rise buildings in the community;
[0156]
[0157] in, The effective installation area of bungalows and rural roofs in region i, C B Installation costs for bungalows and rural rooftops;
[0158] B2: Constructing a mathematical model for maintenance costs
[0159] Maintenance costs: The installed rooftop photovoltaic system may be affected by the external environment and cause a series of failures. Considering a series of costs such as the later maintenance of photovoltaic components, the investment cost is corrected with a correction coefficient of K1. The corrected equation is:
[0160]
[0161] in, is the total cost of installing photovoltaic power on the roof of region i after correction, and K1 is the maintenance correction factor;
[0162] B3: Constructing a mathematical model for power generation revenue
[0163] Power generation income: The income of rooftop distributed photovoltaic power generation projects mainly involves factors such as horizontal radiation and electricity prices.
[0164] Annual total horizontal radiation: The total solar radiation on the horizontal surface in each region is different in one year. The annual total horizontal radiation is calculated using solar energy measurement software.
[0165] Electricity price: Distributed photovoltaic power generation projects built on bungalows and rural roofs mainly adopt the "full grid-connected" model, while distributed photovoltaic power generation projects built on the roofs of high-rise buildings in residential areas and industrial and commercial parks mainly adopt the "self-generation for self-use, surplus power grid-connected" model. Industrial and commercial parks consume a lot of electricity, and it can be considered that all the electricity generated by photovoltaic modules is "self-generation for self-use". Therefore, the electricity price of rooftop distributed photovoltaic power generation projects can be divided into "self-generation for self-use" electricity price, "surplus power grid-connected" electricity price and "full grid-connected" electricity price. Among them, the "self-generation for self-use" electricity price is the electricity price of the roof owner in the project. The industrial electricity price is between 0.6 and 1.2 yuan / kWh, and the "surplus power grid-connected" or "full grid-connected" electricity price is 0.391 yuan / kWh. Based on the above information, the mathematical formula of the photovoltaic rooftop power generation revenue model can be constructed:
[0166]
[0167] The electricity revenue from all rooftop PV in region i is: The electricity revenue brought by the commercial and industrial rooftop photovoltaics in region i, The electricity revenue brought by photovoltaic power generation on the rooftops of high-rise buildings in the community in region i, The electricity bill benefits brought by photovoltaic power generation on bungalows and rural roofs in region i;
[0168]
[0169] Among them, P1 is the electricity price in the self-generation and self-use mode, R i is the total annual horizontal radiation of the photovoltaic roof in region i, 25% is the power generation efficiency of the photovoltaic module, including the photovoltaic radiation conversion efficiency, photovoltaic module heat generation and other losses;
[0170]
[0171] Among them, P2 is the electricity price under the mode of 50% self-generation for self-use and 50% surplus power for grid connection;
[0172]
[0173] Among them, P3 is the electricity price under the full grid-connected mode;
[0174] B4: Constructing a mathematical model for maximizing economic benefits:
[0175]
[0176] Among them, i is 1 to n, and the economic benefits of all regions combined are the best. Considering the loss of photovoltaic panels, only the costs generated in 15 years are selected, X i is the area of photovoltaic installation to be installed in region i, is the total effective area where photovoltaic power can be installed in region i; M1 is the economic benefit, and the ultimate goal is to maximize the economic benefit.
[0177] A social benefit model for photovoltaic roofs is established, taking into account the environmental performance of the photovoltaic system and the impact of the photovoltaic system on local communities and residents. The present invention pays more attention to the photovoltaic system's balance of grid stability and grid supply and demand balance, hoping that the electricity generated by photovoltaics will just meet the incremental electricity demand, and achieve the best environmental protection and user electricity experience. The present invention compares the incremental electricity demand with the amount of electricity generated by the photovoltaic system, and the smallest difference in the supply and demand balance of the entire province is the best. The amount of electricity increased by photovoltaics cannot exceed the upper limit of the grid's carrying capacity, otherwise it may cause a series of problems such as peak power outages and device losses.
[0178] The method of establishing the social benefit model is:
[0179] C1: Constructing a mathematical model for supply and demand balance: Selecting the historical photovoltaic capacity increase as the standard for supply and demand balance, and predicting the photovoltaic and load increments to obtain this year's photovoltaic capacity to be installed, the following mathematical model can be established:
[0180] S i =|X i -F i |#(11)
[0181] Among them, S i is the deficit of supply and demand balance in region i, reflected in social benefits, F i The predicted increase in rooftop PV capacity in the region this year based on historical PV installed capacity;
[0182] C2: Constructing a grid carrying capacity model: Considering the limited carrying capacity of the grid, an inequality constraint is imposed on the above model. It is required that the increment of photovoltaic roofs in each region does not exceed the photovoltaic carrying capacity that the grid can access. An inequality constraint model can be established:
[0183] X i ≤U i #(12)
[0184] Among them, U i The upper limit of the grid carrying capacity is obtained by integrating the historical growth of photovoltaic installed capacity and load, as well as the upper limit of grid transformer carrying capacity and other factors that affect the grid carrying capacity;
[0185] C3: Constructing a social benefit model: Based on the above mathematical models of social benefits, the social benefit mainly considers the balance of electricity consumption. The social benefit is obtained by superimposing the balance of supply and demand in various regions of the province. The social benefit is optimal, and the following mathematical model is obtained:
[0186]
[0187] Among them, i ranges from 1 to n, and it is hoped that the social benefits obtained by adding up all regions will be optimal. is the social benefit of region i, and M2 is the overall social benefit.
[0188] The present invention uses an artificial fish school algorithm. The basic idea of the artificial fish school algorithm is that artificial fish find places with more food through foraging, clustering, chasing and other behaviors. The more artificial fish there are, the greater the food concentration is. Therefore, finding the location with the richest food concentration in the environment is the global optimal solution.
[0189] An artificial fish swarm containing n fish can be represented as a set [AF1, AF2, …, AFn}, the state of the ith artificial fish can be represented as vector X i =(x i1 , x i2 , …, x in ), x in It is represented as the optimization variable of the jth (j=1, 2, ..., n) dimension. f represents the objective function, Y i =f(X i ) indicates state X i There are five important parameters in the artificial fish swarm algorithm, namely, the population size N, the visual field Visual of the artificial fish, the step length Step, the crowding factor δ and the number of repetitions Try_number. i When the current state is better than X i The corresponding state is poor, then the artificial fish moves towards X i Move the step value in the direction of X next , otherwise look for other states within the field of view to update the state.
[0190] In step S3, in order to balance the global search capability and local convergence speed to meet the optimization requirements of rooftop photovoltaic installed capacity, the mathematical model optimization of rooftop photovoltaic installed capacity is faster and the global optimization capability is stronger. The artificial fish swarm algorithm is improved, such as Figure 2 As shown in the figure, the optimization process of the improved artificial fish swarm algorithm is as follows:
[0191] D1: Initialize parameters and generate initial fish school:
[0192] Set the population size N, the number of iterations T, and the maximum number of iterations T max , visual field Visual, crowding factor δ, number of trials Try_number, inertia weight w, acceleration factors c1 and c2, after initializing the parameters, use Tent chaotic mapping to initialize the population within the required range, so that each artificial fish covers the entire initial solution space as evenly as possible;
[0193] D2: Initialize the bulletin board:
[0194] Record the current status of each fish, compare the function value of each artificial fish, select the one with the best function value as the current optimal solution and record it on the bulletin board;
[0195] D3: Calculate the artificial fish's field of view and inertia weight:
[0196] Calculate the artificial fish's field of view and inertia weight by referring to the field of view and inertia weight update formula;
[0197] D4: Execute mobile strategy:
[0198] The improved movement strategy is executed for each artificial fish in turn. After each movement behavior is executed, it is compared with the value on the bulletin board. If the function value of the current state of the artificial fish is better than the value on the bulletin board, the function value of the current optimal state of the artificial fish is recorded on the bulletin board as the optimal solution.
[0199] D5: Determine whether to combine mutation operation in the artificial fish movement strategy:
[0200] If the artificial fish does not obtain an objective function value better than the bulletin board after executing the movement strategy, then introduce the mutation operation and random reverse learning strategy and continue to execute step D6; otherwise, jump to step D7;
[0201] D6: Introducing mutation operations and random reverse learning strategies:
[0202] The best historical position of the artificial fish in the bulletin board is taken to replace the current worst artificial fish, so as to form a new fish school; the best artificial fish in the new fish school is subjected to chaotic mutation, and the remaining artificial fish are subjected to Gaussian mutation, and the position of the artificial fish is updated by mutation operation to determine whether the position of the mutated artificial fish is better. If the mutated individual is better, the mutated individual is used to replace the original individual, and then the random reverse learning strategy is executed; if the mutated individual is not better than the best position, the random reverse learning strategy is still executed; after the fish school executes the random reverse strategy, a comparison is also performed to determine whether the state of the artificial fish after executing the reverse learning strategy is better than the best historical position of the artificial fish. If so, the original individual is replaced to update the population, if not, the population is directly updated, and the next round of iteration is continued to execute step D4.
[0203] D7: Determine whether the algorithm is terminated: If the number of iterations T ≥ T max , the algorithm ends and outputs the optimal solution; otherwise, continue to iterate, execute D3 and D4, and T=T+1.
[0204] The improved mobile strategy in step D4 is specifically:
[0205] Artificial fish have four movement behaviors: foraging behavior Prey, swarm behavior Swarm, chasing behavior Follow, and random behavior Move;
[0206] Foraging behavior Prey: In the process of algorithm optimization for foraging behavior, artificial fish AF i The current status is X i , randomly moves within its perceived distance Visual and transforms into X j , compare the objective function values Y corresponding to the two states i , Y j , if Y is satisfied i <Y j , then X i To X jMove; otherwise, perform a loop search and then update the state of the artificial fish; if not found after Try_number attempts, perform random behavior within the field of view;
[0207] X j = X i + Visual * Rand() #(14)
[0208]
[0209]
[0210] Among them, the Rand() function is used to generate random numbers. The field of view Visual represents the visual range of the artificial fish, that is, the perception distance of the artificial fish. The step size Step represents the maximum movement distance of the artificial fish each time it tries to move. Try_number is the number of repetitions, indicating the maximum number of attempts of the artificial fish before moving;
[0211] Swarm behavior: In swarm behavior, fish will move closer to areas with more fish. However, too concentrated a fish swarm will lead to the emergence of local extrema. Therefore, a crowding factor δ is introduced to adjust the aggregation degree of the fish swarm; assume the artificial fish AF i The current state is X i , the field of view is d ij < Visual, the number of partners in the current neighborhood is nf, and the state of the central position is X c . If Y c / nf > δY i , then X i Moves towards X j , otherwise, perform foraging behavior;
[0212]
[0213] Follow behavior: The follow behavior simulates the process of an artificial fish finding and approaching the artificial fish with the optimal food degree within the field of view; assume the artificial fish AF i The current state is X i , the field of view is d ij < Visual, the number of partners in the current neighborhood is nf, and the optimal value in the current neighborhood is Y j , the state corresponding to the optimal value is X j , if Y c / nf > δY i , then X i Moves towards X j , otherwise, perform foraging behavior;
[0214]
[0215] Random behavior Move: The random behavior is a default behavior of the foraging behavior, representing the random movement of the artificial fish; when the foraging behavior fails to find a better state after Try_number attempts, the artificial fish X i can move randomly within the visual field (i.e., d ij <Visual) and reach a new state through Move;
[0216]
[0217] After the artificial fish swarm is initialized, at each iteration, each artificial fish will select one of the four basic behaviors to execute. Usually, the trial method is adopted to simulate the four behaviors separately, and then the one with the best state after iteration is selected as the actual executed behavior. The optimization process of the artificial fish swarm algorithm is achieved by approaching the optimal value step by step like this.
[0218] In step D1, the Tent chaotic map is used to initialize the population. Before the AFSA algorithm starts to execute, like traditional swarm intelligence algorithms and other meta-heuristic optimization algorithms, it uses a simple random data generation method to initialize the solution space. This simple random process has great randomness, which is not conducive to obtaining a stable and diverse initial solution space. The uneven distribution of the population is likely to cause the solution process to fall into a local optimum, ultimately affecting the convergence speed and final result of the algorithm. The chaotic map has good randomness and ergodicity, which can maintain the diversity of the population, help the meta-heuristic optimization algorithm get rid of local traps, and improve the global search ability of the algorithm.
[0219] The chaotic time series is a digital sequence arranged according to time that describes a complex system and is the main manifestation of the discrete situation of chaos. It is often used to describe the dynamic characteristics of complex systems and reveal the evolution laws of complex systems. Chaotic optimization is to use the chaotic system to generate chaotic time series and utilize the pseudo-randomness and initial value sensitivity of chaotic motion to improve the ergodicity of the algorithm, thereby enhancing the optimization efficiency. The main principle of chaotic optimization is as Figure 3 shown.
[0220] Initializing the population using the chaotic map can make the population more evenly distributed in space, thereby expanding the search range of the algorithm, and improving the convergence speed and solution accuracy of the algorithm. A large number of experiments show that among the 10 commonly used chaotic maps at present, the tent chaotic map has the best performance. Therefore, the present invention uses the Tent chaotic map to initialize the population of the AFSA algorithm.
[0221] The Tent map has a simple structure, a relatively uniform distribution, and good convenience. Its expression is as follows:
[0222]
[0223] x n is the population individual before chaotic mapping, x n+1 It is the population individual after chaotic mapping. According to research, when u=0.5, the uniformity of its Tent chaotic mapping is the best. Therefore, the Tent chaotic mapping can be defined as:
[0224]
[0225] Although the Tent chaotic mapping can make the initial population as evenly distributed as possible in the solution space, it is easy to have problems in small cycle periods and fixed points, which makes the Tent chaotic mapping fall into a non-random cycle and affects the solution speed. To solve this problem, the present invention introduces random variables to improve the Tent chaotic mapping. The improved chaotic sequence expression is:
[0226]
[0227] Where N is the number of particles in the chaotic sequence, and rand(0,1) represents a random number in the range of [0, 1].
[0228] In step D3: Based on the improvement of fish school behavior of PSO, in the standard artificial fish school algorithm, the artificial fish has a strong search ability in the field, and its movement direction is mainly determined by the better position obtained by searching in the field, and has nothing to do with the global optimal position. The global optimization ability of the artificial fish school algorithm is poor, and it may even fall into the local optimal solution, so that the accuracy of the solution obtained is not high. In order to make the artificial fish escape the limitation of the scope of the field and enhance the autonomous consciousness of the artificial fish, the inertia mechanism in the particle swarm PSO algorithm is introduced here, so that the algorithm can continue to explore new fields due to the effect of the inertia mechanism when it is temporarily trapped in the local optimal solution, thereby improving the global optimization ability. After introducing the inertia mechanism in the foraging behavior, tail-chasing behavior, and clustering behavior of artificial fish, the memory mechanism in PSO is used to compare the current position with the optimal position of the individual history to decide whether to move. This change can reduce the blindness of the movement of artificial fish. The speed and position update formulas of the standard particle swarm algorithm are as follows:
[0229] v id =wv id +c1r1[gbest-x id ]+c2r2[pbest id -x id ]#(twenty three)
[0230] x id =x id +v id #(twenty four)
[0231] Among them, x i =(x i1 ,xi2 ,…,x iD ) is the current position of particle i, v i =(v i1 ,v i2 ,…,v iD ) is the velocity of particle i, pbest i =(pbest i1 , pbest i2 , …, pbest iD ) is the global historical optimal position of the particle swarm, gbest is the global historical optimal position of the particle swarm, w is the inertia weight, c1, c2 are acceleration factors, r1, r2 are random numbers uniformly distributed between [0, 1].
[0232] According to the speed and position update formula of the standard particle swarm algorithm, the movement strategy of the artificial fish school can be further updated to achieve algorithm improvement.
[0233] In step D5, as the artificial fish swarm algorithm continues to iterate, the artificial fish will gradually gather near the extreme point in the neighborhood, which is prone to premature phenomenon. Due to the lack of a jump-out mechanism, the algorithm is likely to fall into a local optimum, so that the final optimal result cannot be obtained. Considering the above problems, the present invention uses Gaussian mutation and chaotic mutation to optimize the artificial fish swarm algorithm, as follows:
[0234] Gaussian mutation: Gaussian mutation (GM) is a mutation operation that makes the artificial fish jump out of the local extreme value, which can enhance the search ability of the algorithm. When performing Gaussian mutation, it mainly uses a mean μ and variance σ 2 A random number from a normal distribution is used to replace the original gene value, and a random vector that follows a normal distribution is used to act on the original state of the individual to generate a new position. The Gaussian probability density formula is as follows:
[0235]
[0236] Among them, μ represents the expectation of variable x, σ 2 is the variance of x, σ is called the standard deviation, and the above formula is usually recorded as x~N(μ,σ 2 ); when μ=1、σ=0, x~N(0,1), it obeys the standard normal distribution; Gaussian variation can be defined as follows:
[0237] x i|next =X i *[1+N(0,1)]#(26)
[0238] Among them, X i is the current state of the artificial fish, X i|nextis the state of the artificial fish after Gaussian mutation, N(0,1) is a random function that obeys the standard Gaussian distribution;
[0239] From the Gaussian distribution characteristics, we can see that most mutation operators are distributed around the original position, which is equivalent to conducting a small-scale neighborhood search around the original position, which is beneficial to improving the optimization accuracy of the algorithm and escaping from the local optimal solution; and there are a few mutation operators far away from the current position, which increases the diversity of the population, is conducive to exploring potential areas, speeds up the probability of the algorithm escaping from the local optimal position, and improves the convergence trend of the algorithm.
[0240] Chaotic mutation: Chaotic mapping has good randomness and traversal properties, which can prevent the population from traversing all states repeatedly and ensure the diversity of the population. In the later stage of iteration, chaotic mapping can be used to enable the population trapped in the local optimal position to obtain a new state, better explore the potential area, and ensure the convergence speed of the algorithm in the later stage. If the population is initialized with chaotic mapping and then adjusted with chaotic mapping, although the population can be updated to a certain extent, the same chaotic mapping often has a large number of repeated points, which will cause the adjustment to fail; if multiple chaotic mappings are used, the adverse effects of repeated points can be avoided. The previous article has used the Tent chaotic mapping to initialize the population. Here, a one-dimensional Logistic mapping different from the Tent mapping will be used to generate a chaotic sequence. The one-dimensional Logistic mapping is defined as follows:
[0241] x n+1 =μx n (1-x n )#(27)
[0242] Among them, x n ∈[0,1]; μ is the Logistic control parameter, and its value range is μ∈[3.56,4];
[0243] When x n ∈[0,1], μ∈[3.56,4], the Logistic map is in a chaotic state; and when x n ∈[0,1], μ=4, the Logistic map is in a completely chaotic state.
[0244] The random reverse learning strategy in step D5 is specifically:
[0245] Combined with the random reverse learning strategy, the reverse learning strategy generates a corresponding reverse solution based on the current solution in the process of population optimization, and iterates by comparing the objective function values of the current solution and the reverse solution. In this process, the search of the reverse solution space is beneficial to expand the search range, allowing the algorithm to escape from local extreme values and enhance its global optimization ability; the definition of the reverse solution is as follows: if there is a point X in the n-dimensional coordinate system, and X∈[X min ,Xmax ], then its reverse solution X can be calculated by the formula:
[0246] X=X min +X max -X#(28)
[0247] Corresponding to the artificial fish swarm algorithm, the reverse solution can be defined as: the state of an artificial fish is X = (x1, x2, ..., x n ), the corresponding reverse solution is X=(x1,x2,…,x n ), the k-th dimension of the former is x k ,
[0248] x k ∈[a k ,b k ],a k and b k x k The lower and upper limits of the latter (the reverse solution) are x k , x k It can be calculated by the formula;
[0249] x k =a k +b k -x k #(29)
[0250] Since the proposal of reverse learning, reverse learning strategies and their improved strategies have been widely used in various optimization algorithms.
[0251] Since the distance between the reverse solution generated by the reverse learning strategy and the current solution is a fixed value and lacks randomness, the random reverse learning strategy will be used in the present invention to increase the diversity of the search space population and reduce the possibility of the population falling into a local extreme value; the random reverse learning strategy (Random Opposition-based Learning, ROBL) adds a random number of 0,1 on the basis of reverse learning to increase the diversity of the reverse solution space population; the random reverse solution calculation formula is as follows:
[0252] X i|nexy =X imax +X imin -r*X i #(30)
[0253] Among them, X i is the position of the artificial fish school, X imin and X imax are the upper and lower limits of the artificial fish position, and r is a random number between [0, 1].
[0254] The present invention improves the artificial fish swarm algorithm: Since the basic artificial fish swarm algorithm optimization algorithm has problems such as slow convergence speed and imbalance between global search and local search, the present invention proposes a series of improvement strategies to reduce the adverse effects caused by the inherent defects of the algorithm. The specific improvement strategies are as follows:
[0255] (1) First, the chaotic sequence is generated using the Tent chaotic map to initialize the population so that the initial solutions are distributed as evenly as possible in the solution space, laying a good foundation for global optimization.
[0256] (2) Then, the speed and position update formula of the particle swarm is used to optimize the movement strategy of the artificial fish swarm. The memory mechanism of the particle swarm is introduced to compare the current position with the individual historical optimal position to determine whether to move, thereby reducing the blindness of the artificial fish movement;
[0257] (3) Secondly, consider the mutation stage to avoid the artificial fish swarm strategy from falling into the local optimum. Considering the above problems, this paper will use Gaussian mutation and chaotic mutation to optimize the artificial fish swarm algorithm;
[0258] (4) Combining with the random reverse learning strategy is beneficial for the artificial fish swarm algorithm to expand the search range, enable the algorithm to escape from local extreme values, and enhance its global optimization ability.
[0259] When the algorithm falls into a local optimum in the later stage of running, the worst artificial fish is replaced by the historical best fish on the bulletin board to form a new intermediate fish school. The historical best fish in the intermediate fish school is subjected to chaotic mutation, and the remaining artificial fish are subjected to Gaussian mutation, followed by random reverse learning, so as to increase the algorithm's ability to get rid of local extreme values in the later stage of iteration.
[0260] Based on the above content, in order to verify the effectiveness of the method of the present invention, the above method of the present invention is combined with the project requirements in this embodiment to calculate and optimize the planning of rooftop photovoltaic installation capacity in Jiangsu Province. The 13 cities in Jiangsu Province are set as different regions to optimize the photovoltaic installed capacity of the whole province. The results are as follows: Figure 4 As shown, the blue part of the data is the historical growth forecast data, and the orange part is the photovoltaic installed capacity data of each province after optimization by the improved artificial fish swarm algorithm. It can be seen that the photovoltaic installed capacity of each city has been optimized.
Claims
1. A method for optimizing rooftop photovoltaic installed capacity based on an improved artificial fish swarm algorithm, characterized in that: The steps include: S1: Collect roof satellite images to form a roof satellite image dataset, and obtain roof photovoltaic installed capacity information data based on the roof satellite image dataset; S2: Based on the information data obtained, a mathematical model is established that takes into account various factors affecting rooftop photovoltaic installed capacity; S3: Use the improved artificial fish swarm algorithm to solve the mathematical model, calculate and optimize the rooftop photovoltaic installed capacity, and achieve the maximum economic and social benefits; The mathematical model in step S2 includes an economic benefit model and a social benefit model; The method for establishing the economic benefit model in step S2 is: B1: Constructing a mathematical model of investment expenditure: in, The total cost of installing photovoltaic power on the roofs of region i is: The cost of installing photovoltaics on the roofs of commercial and industrial buildings in region i, The cost of installing photovoltaic power on the roofs of high-rise buildings in the area i community, The cost of installing photovoltaics on the roofs of bungalows in region i; in, is the effective installation area of the roof of industrial and commercial buildings in region i, C I The cost of installing a system on the roof of an industrial or commercial building; in, is the effective installation area of the high-rise rooftops in the community in region i, C H The cost of installing power on the roofs of high-rise buildings in the community; in, The effective installation area of bungalows and rural roofs in region i, C B Installation costs for bungalows and rural rooftops; B2: Constructing a mathematical model of maintenance costs: in, is the total cost of installing photovoltaic power on the roof of region i after correction, and K1 is the maintenance correction factor; B3: Constructing a mathematical model of power generation income: The electricity revenue from all rooftop PV in region i is: The electricity revenue brought by the commercial and industrial rooftop photovoltaics in region i, The electricity revenue brought by photovoltaic power generation on the rooftops of high-rise buildings in the community in region i, The electricity revenue generated by photovoltaic power generation on bungalows and rural rooftops in region i; Among them, P1 is the electricity price in the self-generation and self-use mode, R i is the total annual horizontal radiation of the photovoltaic roof in region i, 25% of which is the power generation efficiency of the photovoltaic modules; Among them, P2 is the electricity price under the mode of 50% self-generation for self-use and 50% surplus power for grid connection; Among them, P3 is the electricity price under the full grid-connected mode; B4: Constructing a mathematical model for maximizing economic benefits: Among them, i is 1 to n, and the economic benefits of all regions combined are the best. Considering the loss of photovoltaic panels, only the costs generated in 15 years are selected, X i is the area of photovoltaic installation to be installed in region i, is the effective area of photovoltaic installation in region i; M1 is the economic benefit, and the ultimate goal is to maximize the economic benefit; The method for establishing the social benefit model in step S2 is: C1: Constructing a mathematical model for supply and demand balance: Selecting the historical photovoltaic capacity increase as the standard for supply and demand balance, and predicting the photovoltaic and load increments to obtain this year's photovoltaic capacity to be installed, the following mathematical model can be established: S i =|X i -F i |#(11) Among them, S i is the deficit of supply and demand balance in region i, reflected in social benefits, F i The predicted increase in rooftop PV capacity in the region this year based on historical PV installed capacity; C2: Constructing a grid carrying capacity model: Considering the limited carrying capacity of the grid, an inequality constraint is imposed on the above model. It is required that the increment of photovoltaic roofs in each region does not exceed the photovoltaic carrying capacity that the grid can access. An inequality constraint model can be established: X i ≤U i #(12) Among them, U i The upper limit of the grid carrying capacity is obtained by integrating the historical growth of photovoltaic installed capacity and load, as well as the upper limit of grid transformer carrying capacity and other factors that affect the grid carrying capacity; C3: Constructing a social benefit model: Combining the above mathematical models of social benefits, the supply and demand balance deficits of various regions in the province are superimposed to obtain social benefits. The social benefits are optimal, and the following mathematical model is obtained: Among them, i ranges from 1 to n, and it is hoped that the social benefits obtained by adding up all regions will be optimal. is the social benefit of region i, M2 is the overall social benefit; The specific solution and optimization process of the improved artificial fish swarm algorithm in step S3 is: D1: Initialize parameters and generate initial fish school: Set the population size N, the number of iterations T, and the maximum number of iterations T max , visual field Visual, crowding factor δ, number of trials Try_number, inertia weight w, acceleration factors c1 and c2, after initializing the parameters, use Tent chaotic mapping to initialize the population within the required range; D2: Initialize the bulletin board: Record the current status of each fish, compare the function value of each artificial fish, select the one with the best function value as the current optimal solution and record it on the bulletin board; D3: Calculate the artificial fish's field of view and inertia weight: Calculate the artificial fish's field of view and inertia weight by referring to the field of view and inertia weight update formula; D4: Execute mobile strategy: The improved movement strategy is executed for each artificial fish in turn. After each movement behavior is executed, it is compared with the value on the bulletin board. If the function value of the current state of the artificial fish is better than the value on the bulletin board, the function value of the current optimal state of the artificial fish is recorded on the bulletin board as the optimal solution. D5: Determine whether to combine mutation operation in the artificial fish movement strategy: If the artificial fish does not obtain an objective function value better than the bulletin board after executing the movement strategy, then introduce the mutation operation and random reverse learning strategy and continue to execute step D6; otherwise, jump to step D7; D6: Introducing mutation operations and random reverse learning strategies: The best artificial fish historical position in the bulletin board is replaced with the worst artificial fish currently, so as to form a new fish school; the best artificial fish in the new fish school is subjected to chaotic mutation, and the rest of the artificial fish are subjected to Gaussian mutation, and the position of the artificial fish is updated by mutation operation to determine whether the position of the mutated artificial fish is better. If the mutated individual is better, the mutated individual is used to replace the original individual, and then the random reverse learning strategy is executed; if the mutated individual is not better than the best position, the random reverse learning strategy is still executed; after the fish school executes the random reverse strategy, a comparison is also performed to determine whether the state of the artificial fish after executing the reverse learning strategy is better than the best historical position of the artificial fish. If so, the original individual is replaced to update the population, if not, the population is directly updated, and the next round of iteration is continued to execute step D4; D7: Determine whether the algorithm is terminated: If the number of iterations T ≥ T max , the algorithm ends and outputs the optimal solution; otherwise, continue iterating, execute D3 and D4, and T=T+1; The improved mobile strategy in step D4 is specifically: Artificial fish have four movement behaviors: foraging behavior Prey, swarm behavior Swarm, chasing behavior Follow, and random behavior Move; Foraging behavior Prey: In the process of algorithm optimization for foraging behavior, artificial fish AF i The current status is X i , randomly moves within its perceived distance Visual and transforms into X j , compare the objective function values Y corresponding to the two states i , Y j , if Y is satisfied i <Y j , then X i To X j Move; otherwise, perform a cyclic search to update the state of the artificial fish; if the artificial fish is still not found after trying Try_number, a random behavior will occur within the field of view; X j =X i +Visual*Rand()#(14) Among them, the Rand() function is used to generate random numbers, the visual field Visual represents the visual range of the artificial fish, that is, the perception distance of the artificial fish, the step length Step represents the maximum moving distance of the artificial fish each time it tries to move, and Try_number is the number of repetitions, which represents the maximum number of attempts of the artificial fish before moving; Swarm behavior: In swarm behavior, fish will move towards areas with more fish. However, excessive concentration of the fish school will lead to the emergence of local extrema. Therefore, a crowding factor δ is introduced to adjust the aggregation degree of the fish school. Let the artificial fish be AF i The current state is X i , and the visual range is d ij <Visual, the number of partners in the current neighborhood is nf, and the state of the central position is X c ; If Y c / nf > δY i , then X i moves towards X j , otherwise, the foraging behavior is executed; 追尾行为Follow: The follow behavior simulates the process of an artificial fish searching for the artificial fish with the optimal food degree within its field of vision and approaching it. Let the artificial fish be AF i The current state is X i , and the field of vision range is d ij <Visual, the number of partners in the current neighborhood is nf, and the optimal value in the current neighborhood is Y j , and the state corresponding to the optimal value is X j , if Y c / nf > δY i , then X i moves towards X j , otherwise, perform the foraging behavior; Random behavior Move: Random behavior is a default behavior of foraging behavior, representing the random movement of the artificial fish; when the foraging behavior tries Try_number and still cannot find a better state, the artificial fish X i Can move randomly within the field of view and reach a new state through Move; After the artificial fish swarm is initialized, each artificial fish will choose one of the four basic behaviors to perform in each iteration; The specific process of initializing the population using the Tent chaotic map in step D1 is: The Tent mapping structure expression is as follows: x n is the population individual before chaotic mapping, x n+1 is the population individual after chaotic mapping. According to research, when u = 0.5, the uniformity of its Tent chaotic mapping is the best, so the Tent chaotic mapping can be defined as: The random variables are introduced to improve the Tent chaotic map. The improved chaotic sequence expression is: Where N is the number of particles in the chaotic sequence, and rand(0,1) represents a random number in the range [0, 1]; The mutation operation in step D5 includes Gaussian mutation and chaotic mutation: Gaussian variation: The Gaussian probability density formula is as follows: Among them, μ represents the expectation of variable x, σ 2 is the variance of x, σ is called the standard deviation, and the above formula is recorded as x~N(μ,σ 2 ); when μ=1、σ=0, x~N(0,1), it obeys the standard normal distribution; Gaussian variation can be defined as follows: X i|next =X i *[1+N(0,1)]#(26) Among them, X i is the current state of the artificial fish, X i|next is the state of the artificial fish after Gaussian mutation, N(0,1) is a random function that obeys the standard Gaussian distribution; From the Gaussian distribution characteristics, we know that most mutation operators are distributed around the original position, which is equivalent to a small-scale neighborhood search around the original position, which is conducive to improving the optimization accuracy of the algorithm and escaping the local optimal solution; and there are a few mutation operators far away from the current position, which increases the diversity of the population, is conducive to exploring potential areas, speeds up the probability of the algorithm escaping from the local optimal position, and improves the convergence trend of the algorithm; Chaotic mutation: A one-dimensional Logistic map different from the Tent map is used to generate a chaotic sequence. The one-dimensional Logistic map is defined as follows: x n+1 =μx n (1-x n )#(27) Among them, x n ∈[0,1]; μ is the Logistic control parameter, and its value range is μ∈[3.56,4]; When x n ∈[0,1], μ∈[3.56,4], the Logistic map is in a chaotic state; and when x n ∈[0,1], μ=4, the Logistic map is in a completely chaotic state; The random reverse learning strategy in step D5 is specifically: Combined with the random reverse learning strategy, the reverse learning strategy generates a corresponding reverse solution based on the current solution during the population optimization process, and iterates by comparing the objective function values of the current solution and the reverse solution; the definition of the reverse solution is as follows: if there is a point X in the n-dimensional coordinate system, and X∈[X min ,X max ], then its reverse solution X can be calculated by the formula: X=X min +X max -X#(28) Corresponding to the artificial fish swarm algorithm, the reverse solution can be defined as: the state of an artificial fish is X = (x1, x2, ..., x n ), the corresponding reverse solution is X=(x1,x2,…,x n ), the k-th dimension of the former is x k , x k ∈[a k ,b k ],a k and b k x k The lower and upper limits of the latter, whose k-th dimension component is x k , x k It can be calculated by the formula; x k =a k +b k -x k #(29) A random reverse learning strategy is used to increase the diversity of the search space population and reduce the possibility of the population falling into a local extreme value. The random reverse learning strategy is to add a random number of 0,1 on the basis of reverse learning to increase the diversity of the reverse solution space population. The calculation formula of the random reverse solution is as follows: X i|next =X imax +X imin -r*X i #(30) Among them, X i is the position of the artificial fish school, X imin and X imax are the upper and lower limits of the artificial fish position, and r is a random number between [0, 1].
2. The method for optimizing rooftop photovoltaic installed capacity based on an improved artificial fish swarm algorithm according to claim 1, characterized in that: The step S1 specifically includes: A1: Collect satellite images of urban building roofs; A2: Classify the collected images into images of buildings with roofs and images of buildings without roofs; A3: Based on the semantic segmentation method, images of buildings with roofs are identified and classified. Roofs are divided into three categories: industrial and commercial park roofs, community high-rise roofs and bungalow roofs, and rural roofs. The effective installation area of the three types of roofs is calculated. A4: Based on the PVsyst software, the light radiation in each region is calculated to obtain the photovoltaic installable capacity and photovoltaic radiation intensity in each region.
