Micro-grid harmonic suppression method based on particle swarm optimization algorithm
Technical field
Project of the present invention is related to a kind of micro-grid harmonic suppression method, particularly a kind of micro-grid harmonic suppression method Ji Yu particle group optimizing (Particle Swarm Optimization, PSO) algorithm.
Background technology
Micro-capacitance sensor is a kind of new structure of new forms of energy application, has highly important effect.The nonlinear-load producing because the power electronic equipments such as inverter run in microgrid, namely what is often called " harmonic wave ", the normal operation to power electronic equipments such as inverters has a strong impact on, simultaneously, harmonic current can make the constant temperature of equipment improve, and directly influences the service life of equipment.The method of micro-grid harmonic suppression at present has a lot, is generally speaking divided three classes, and the first kind is harmonic wave essence suppression technology, including active mode(Produce the inverter only producing very little harmonic wave)And passive mode(Wave filter is installed near wave source);Equations of The Second Kind is the application of Instantaneous Power Theory, theoretical and immature;3rd class is the fusion of intelligent Neural Network and harmonics restraint, and when harmonic content change is excessive, effect is unsatisfactory.In the first rahmonic essence suppression technology, the means installing wave filter are most commonly seen, also maximally efficient, its technology relative maturity, are suitable for commonly used.Wherein, passive filter(LC wave filter)Have the advantages that structure is simple, with low cost, operational reliability is higher, operating cost is relatively low, be still the harmonic wave management method being widely used so far.
At present, the method optimizing LC filter parameter in micro-grid system has a lot, is summed up and can be divided into two classes:One class is that classical algorithm mainly includes Nonlinear Programming Method, QUADRATIC PROGRAMMING METHOD FOR, linear programming method and interior point method etc.;Another kind of is artificial intelligence optimization's algorithm, mainly includes genetic algorithm, simulated annealing, TABU search, particle group optimizing and various Evolutionary Programming Method.The topmost advantage of first kind method is that to calculate rapid, convergence reliable, but needs some assumed conditions, such as continuous, can lead and unimodal etc..When solving some problems, need for integer variable to be considered as continuous variable participation optimization calculating, after obtaining optimal solution, carry out consolidation again.For large-scale real system, the error being produced by consolidation is usually unacceptable.In Equations of The Second Kind method, genetic algorithm is most widely used, optimization problem can not be led and seriality requires, only need a fitness function or performance indications, and there is global convergence, its major defect is the needs that " Premature Convergence " problem and convergence rate are difficult to meet real-time control.Particle group optimizing (Particle Swarm Optimization, PSO) algorithm as a kind of new based on Swarm Intelligent Computation method, solving to show powerful advantage when classic optimisation algorithm is difficult to such as discontinuous, non-differentiability the non-linear morbid state optimization problem and the combinatorial optimization problem that solve.Compared with other evolution algorithms,It has the advantages that thought is simple, easily realize, adjustable parameter is less and application effect is obvious, than wide in therefore applying in optimizing micro-grid system filter parameter.
At present, PSO is in micro-grid system Optimal Filter parameter tuning, need the exact relationship between known filter parameter and object function harmonic wave rate, so micro-grid system is converted into equation of state or transmission function, then runs PSO program and obtain filtering parameter optimal value.But, in the case of micro-grid system internal structure complexity, the equation of state of micro-grid system or transmission function are difficult to directly obtain, and this is accomplished by equation of state or the transmission function spending the more time for calculating micro-grid system, thus increasing amount of calculation, or even impact optimization efficiency.
Content of the invention
Micro-grid system need to be converted into equation of state or transmission function when optimizing micro-grid system filtering parameter for existing PSO, thus the problems such as calculating leading to is complicated, efficiency is impacted, the present invention provides a kind of amount of calculation little, the higher method based on PSO algorithm optimization micro-grid system filtering parameter of efficiency.Micro-grid harmonic suppression method flow chart based on PSO optimized algorithm is as shown in Figure 1.
Based on the micro-grid harmonic suppression method of PSO optimized algorithm, comprise the following steps:
1), initiation parameter;
2), initialization particle(The potential solution that each particle represents problem is the parameter of L, C in wave filter)Position, speed, call microgrid analogue system program fitness, and initialization fitness value Present;
3), particle position and speed are updated;
4), call microgrid analogue system program fitness, more new particle fitness value Present;
5), fitness evaluation, more new individual history extreme value pbest;
6), update global extremum gbest.
Further, step(1)Including:
1-1), the maximum iteration time determining in PSO program, population, the value of number of dimensions, Studying factors and inertia weight;
1-2), determine need optimize parameter approximate range.
Further, step(2)The position of initialization particle, speed, call microgrid analogue system program fitness, and initialize comprising the following steps that of adaptive value:
2-1), initialization particle current location;
2-2), initialization particle present speed;
2-3), call microgrid analogue system program fitness;
2-4), according to initialized location calculate fitness value Present;
2-5), remember each particle history optimal value be pbest;
2-6), note global optimum be gbest.
Further, step(2-3)Middle microgrid analogue system program fitness write comprise the following steps that:
A1), microgrid analogue system can be opened by open_system function;
A2), the parameter value of L and C in the LC wave filter optimizing will be needed in microgrid simulink analogue system to be set to variable by set_param function, be designated as l and c;
A3), pass through sim function operation microgrid analogue system;
A4), determine that the object function as inspection parameter quality standard is micro-grid harmonic rate according to filter parameter to be optimized, object function micro-grid harmonic rate is write out in programming, is likewise provided as a variable and is designated as THD;
Further, step(3)Including:
3-1), determine whether iterationses reach the upper limit, if reaching the upper limit, whole optimization process terminates;If not reaching the upper limit, jump to step(3-2);
3-2), according to formula(1)Obtain particle rapidity to update:
According to formula(2)Obtain particle position to update:
Wherein i=1,2 ..., N is particle number,It is speed in kth time iteration for the particle,It is position in kth time iteration for the particle i,It is personal best particle in kth time iteration for the particle i, be also denoted as pbest;x*It is global optimum position in kth time iteration for the particle i, be also denoted as gbest;R1 and r2 is the random number being uniformly distributed between [0,1], c1 and c2 is accelerated factor, and ω is inertial factor.Further, step(4)Including:
4-1), call microgrid analogue system program fitness again;
4-2), more new particle fitness value present.
Further, step(5)Including:
5-1), whether history optimal value pbest is better than according to conditional judgment particle current adaptive value present, if present is better than pbest, jump to step(5-2)If being not better than, jumping to step(6);
5-2), the value being replaced with the value of present in pbest, as current particle optimal value.
Further, step(6)Including:
6-1), see whether algorithm meets termination condition, if being unsatisfactory for, jump to step(3-1)If meeting, jumping to step(6-2);
6-2), update global extremum gbest, and export the optimal value of the parameter of gbest and LC wave filter.
The technology design of the present invention is:When with PSO program optimization micro-grid system filter parameter, the present invention only needs known filter parameter to be optimized and the micro-grid harmonic rate as object function, directly write microgrid analogue system program fitness, flow chart is as shown in Figure 2, open microgrid analogue system with open_system function first, and the LC filter parameter that need to be optimized with set_param function sets is variable, then control the operation of microgrid analogue system with sim function, finally obtain object function micro-grid harmonic rate with programming.After the completion of microgrid analogue system program fitness is write, using PSO routine call microgrid analogue system program fitness.PSO program often obtains filter parameter values, and micro-grid system just runs the value once obtaining object function.This is a process that constantly optimizing constantly emulates, in actual applications can be according to the further perfect procedure of specific operation conditions.
It is an advantage of the invention that:When optimizing micro-grid system filter parameter with PSO, again micro-grid system need not be converted into equation of state or transmission function, also need not known to need between the filter parameter that optimizes and object function micro-grid harmonic rate definite relation, but only need to know micro-grid system filter parameter to be optimized and as the good and bad object function of evaluating.Therefore, the present invention can effectively reduce amount of calculation, improve PSO and optimize micro-grid system filter parameter efficiency, thus reaching effective effect suppressing micro-grid harmonic.
Brief description
The micro-grid harmonic suppression method flow chart based on PSO optimized algorithm for the Fig. 1
Fig. 2 microgrid analogue system program fitness flow chart
The argument structure figure of Fig. 3 PSO algorithm optimization micro-grid system median filter
Fig. 4 is grid-connected to be optimized and load outputs voltage-contrast figure that empirically value method obtains to isolated island PSO
The load outputs voltage-contrast figure that Fig. 5 isolated island optimizes to grid-connected PSO and empirically value method obtains
Specific embodiment
1st, project implementation mode
Based on the micro-grid harmonic suppression method of PSO optimized algorithm, comprise the following steps:
1), initiation parameter;
1-1), the maximum iteration time determining in PSO program, population(Each particle represents a potential solution of problem), the value of number of dimensions, Studying factors and inertia weight;
1-2), determine need optimize parameter approximate range.
2), the initialization position of particle, speed, call microgrid analogue system program fitness, and initialization adaptive value;
2-1), initialization particle current location;
2-2), initialization particle present speed;
2-3), call microgrid analogue system program fitness;
Microgrid analogue system program fitness write comprise the following steps that:
A1), microgrid analogue system can be opened by open_system function;
A2), the parameter value of L and C in the LC wave filter optimizing will be needed in microgrid simulink analogue system to be arranged to variable by set_param function, be designated as l and c respectively;
A3), pass through sim function operation microgrid analogue system;
A4), determine that the object function as inspection parameter quality standard is micro-grid harmonic rate according to filter parameter to be optimized, object function micro-grid harmonic rate is write out in programming, is likewise provided as a variable and is designated as THD;
2-4), according to initialized location calculate fitness value Present;
2-5), remember each particle history optimal value be pbest;
2-6), note global optimum be gbest.
3), particle position and speed are updated;
3-1), determine whether iterationses reach the upper limit, if reaching the upper limit, whole optimization process terminates;If not reaching the upper limit, jump to step(3-2);
3-2), according to formula(1)Obtain particle rapidity to update:
According to formula(2)Obtain particle position to update:
Wherein i=1,2 ..., N is particle number,It is speed in kth time iteration for the particle,It is position in kth time iteration for the particle i,It is personal best particle in kth time iteration for the particle i, be also denoted as pbest;x*It is global optimum position in kth time iteration for the particle i, be also denoted as gbest;R1 and r2 is the random number being uniformly distributed between [0,1], c1 and c2 is accelerated factor, and ω is inertial factor.
4), call microgrid analogue system program fitness, more new particle fitness value Present;
4-1), call microgrid analogue system program fitness again;
4-2), more new particle fitness value present.
5), fitness evaluation, more new individual history extreme value pbest;
5-1), whether history optimal value pbest is better than according to conditional judgment particle current adaptive value present, if present is better than pbest, jump to step(5-2)If being not better than, jumping to step(6);
5-2), the value being replaced with the value of present in pbest, as current particle optimal value.
6), update global extremum gbest;
6-1), see whether algorithm meets termination condition, if being unsatisfactory for, jump to step(3-1)If meeting, jumping to step(6-2);
6-2), update global extremum gbest, and export the optimal value of the parameter of gbest and LC wave filter.
2nd, analysis of cases
Microgrid analogue system includes the micro- source of two direct currents, a bulk power grid, and the argument structure figure that PSO optimizes micro-grid system median filter is as shown in Figure 3.Verify the feasibility of the present invention using this analogue system, and be compared with the LC filter parameter being obtained using empirical value method, prove the present invention by grid-connected to isolated island and isolated island to grid-connected two kinds of different situations under, it can optimize the parameter of LC wave filter in micro-grid system effectively, reduces the harmonic wave rate of microgrid load end output voltage.
A), case 1
When initial, micro-grid connection is run, and simulation time is 0.1s, two micro- source powering loads together with bulk power grid, one of micro- source is disconnected with load in 0.05s, another micro- source provides electric energy for load always, and bulk power grid disconnects in 0.07s, and microgrid enters island operation state.Empirically value method obtains L value for 0.000014, C value is 0.0075, and harmonic wave rate is 0.0606.After PSO optimizes L, C parameter, L value is 0.0000103, C value is 0.0098, and harmonic wave rate is 0.0469.It is as shown in Figure 4 that PSO Optimal Filter parameter gained A, B, C three-phase waveform and empirical value method obtain filter parameter gained A, B, C three-phase waveform simulation result comparison diagram.
B), case 2
When initial, piconet island runs, and simulation time is 0.1s, micro- source powering load, and accessing another micro- source in 0.05s provides electric energy to load together, and bulk power grid accesses in 0.07s, and microgrid enters grid-connected state.Empirically value method obtains L value for 0.000017, C value is 0.006, and harmonic wave rate is 0.0517.After PSO optimizes L, C parameter, L value is 0.000011, C value is 0.009, and harmonic wave rate is 0.0322.It is as shown in Figure 5 that PSO Optimal Filter parameter gained A, B, C three-phase waveform and empirical value method obtain filter parameter gained A, B, C three-phase waveform simulation result comparison diagram.
In above-mentioned case, filter parameter gained A, B, C three-phase comparison of wave shape is obtained by PSO Optimal Filter parameter gained A, B, C three-phase waveform in Fig. 4 and empirical value method, can find that the inventive method can make load end harmonic wave of output voltage rate be reduced to 4.69% from 6.06% after optimizing microgrid filter parameter, effectively reduce load end harmonic wave of output voltage rate from the grid-connected handoff procedure to isolated island for the microgrid;Equally, filter parameter gained A, B, C three-phase comparison of wave shape is obtained by PSO Optimal Filter parameter gained A, B, C three-phase waveform in Fig. 5 and empirical value method, can find that the inventive method can make load end harmonic wave of output voltage rate be reduced to 3.22% from 5.17% after optimizing microgrid filter parameter, effective reduction microgrid load end harmonic wave of output voltage rate to grid-connected handoff procedure from isolated island.So, no matter microgrid is that the inventive method is all effective and feasible for optimization micro-grid system filter parameter, reduction load outputs voltage harmonic rate to isolated island switching or isolated island to grid-connected switching from grid-connected.
Content described in this specification embodiment is only enumerating of the way of realization to inventive concept; protection scope of the present invention is not construed as being only limitted to the concrete form that embodiment is stated, protection scope of the present invention also and in those skilled in the art according to present inventive concept it is conceivable that equivalent technologies mean.