Background technology
The aperiodicity step-out does not take place after being meant that electric system is subjected to little interference in the electric system small interference stability, automatically restores to the ability of initial running status.Always have little interference in the Operation of Electric Systems process inevitably, the small signal stability simulation analysis that carries out electric system judges that whether stable system under the given method of operation, is one of most important task of fundamental sum in the Power System Analysis.
The electric system small interference stability simulation relates generally to the nonlinear dynamic system that numerous dynamic elements such as generator and excitation system thereof, dynamic load (as induction motor and synchronous motor), DC transmission system, power electronic element (as FACTS) and power transmission network, static load etc. are formed.By means of the achievement of enriching of linear system signature analysis, Liapunov (Lyaponov) linearization technique has obtained to use widely in power system small signal stability analysis.This method is based upon on the basis of the characteristic root (pattern) of linearization state space equation formula of analytic system and proper vector (mode) thereof, near nonlinear differential equation linearization operating point with the system dynamics behavior, calculate eigenwert, left and right sides proper vector and damping ratio, electromechanical circuit relevance ratio, participation factors and the eigenwert sensitivity etc. of linearized system state matrix, thus the behavioural characteristic of analysis and judgement electric system under little interference.
Yet along with the continuous expansion of electric system scale, the scale of small interference stability computational analysis and calculated amount also significantly increase thereupon.Concerning the electric system of 10,000 emulation buses, the sparse matrix scale of finding the solution after differential-Algebraic Equation set linearization that small interference stability calculates is more than tens thousand of rank at present.Use the microcomputer of current main-stream configuration, the small interference stability simulation of the such scale of serial computing is consuming time more than 5 minutes, and counting yield is lower.
Parallel calculating method is one of main method that solves electric system Computer Simulation speed.Parallel computation is based on a simple idea: N platform computing machine should be able to provide N times of computing power, finishes in the time of 1/N no matter the speed of current computer how, can be expected the problem of being found the solution.Obviously, this is an ideal situation, because the problem of being found the solution all can not be broken down into fully independently various piece under normal conditions, but need carry out data necessary exchange and synchronous.Under existing technology, clock speed and instruction throughput etc. are difficult under the Moore's Law restriction a big progress to the classic method of improving cpu performance as promoting.The performance boost of novel chip in recent years will mainly be started with from multinuclear and two aspects of buffer memory, and that wherein attractes attention the most surely belongs to multi-core technology.The approach that processor performance all will improve in main processor manufacturer such as Intel, AMD turns to a plurality of processing engine of integration from improving dominant frequency, and multi-core processor has become the developing direction of following processor technology.In the microcomputer that adopts many core CPU processor, in save as shared formula, many CPU processor computer of this hardware structure and shared drive is very similar.Therefore, parallel algorithm also is similar.For the parallel algorithm of many CPU processor of shared drive, owing to do not consider Distributed Calculation between many computing machines, and when only considering the parallel computation of same computer-internal, so parallel algorithm mainly is divided into multi-process and multithreading two classes.
In order to satisfy the needs of small interference stability program parallel computation in Windows and two kinds of operating systems of Linux, this method is selected the parallel processing function of linux system, and realizes cross-platform parallel computation by cygwin.Cygwin is a unix simulated environment of moving on windows platform, is the free software of cygnus solutions company exploitation.The source code code of executable program also can be carried out under Windows by behind the cygwin compiling link under the Linux, and it is basic identical to carry out efficient.
In (SuSE) Linux OS, a process (Process) is equivalent to a task (Task), from the angle of operating system kernel, process is the base unit of management of system resource (CPU, internal memory, file etc.), is the running environment that program provided for moving; From user perspective, process is a dynamic implementation of application program.Process has one section executable program, special-purpose system stack space, privately owned " process control block (PCB) " (being the task_struct data structure) and storage space independently.Kernel spacing is created thread at user's space with pthread by the process simulation thread, and thread is the least unit that program is carried out.A process needs a thread at least and executes instruction.Thread also has one section executable program, special-purpose system stack space, privately owned " process control block (PCB) ", but does not have the storage space of oneself.
The key distinction of thread and process is: thread can not be carried out separately, and it has to operate in the process that is in active state; A plurality of threads are shared same process all resources except that CPU, each cooperation of cross-thread permission task and exchanges data.
It is littler than process expense to create thread, and communication is also simple than the communication process between multi-process between multithreading.In brief, thread is nothing but an execution context of process.During a usually independent program run, default comprise a main thread, main thread provides the start-up point of program, the single-threaded situation of one process that Here it is with the form (as the main function) of function address.If create a plurality of threads in the main function, then during this program run, operating system is the different CPU time sheet of each thread distribution, and dispatches according to thread priority.Because each timeslice time is very short, look to seem that each thread is concurrent execution that in fact synchronization has only a thread in operation, the situation of Here it is one process multithreading.
If with a plurality of processes of fork () function creation (SuSE) Linux OS under, and each process only adopts a main thread of acquiescence, then during program run, by kernel dispatching operating system, CPU is distributed to each process use, the situation of multi-process that Here it is.
Hence one can see that, though the parallel efficiency calculation of multithreading is greater than the multi-process program, its shortcoming is to carry out a large amount of reprogrammings to the existing serial program, the part that is fit to parallel computation in the program become multithreading realize.Though and multi-process program execution efficient is low slightly, do not need can use the mode of multitask to realize parallel computation to existing serial program programming, program realizes simple and reliable.
Calculate for the large-scale electrical power system small interference stability, must adopt Partial Feature value-based algorithm (Arnoldi algorithm that the present invention adopts implicit expression to restart), need adopt a plurality of search points (generally about 20) to calculate respectively to the low-frequency oscillation zone of being concerned about, each search point calculates the eigenwert in the certain zone of this search point on the complex coordinate plane on every side, promptly calculates the eigenwert near the zone of each search point.As long as the suitable search point of some is set, then the stack of the region of search of these search points has just covered the zone of whole care.The calculating of these search points is separate, therefore, uses the parallel calculating method of multi-process to have obvious superiority, is having now on the ripe serial computing procedure basis, only need write the core cpu distribution and the scheduler program of search point and can realize.After the calculating of all search points finishes, merge the result of all single search points, just can obtain the complete result of the problem of finding the solution.
Summary of the invention
The objective of the invention is to overcome the shortcoming of the complicated loaded down with trivial details inefficiency of simulation calculation in the prior art, a kind of simple high-efficiency reliable small interference stability simulation method of electric power system is provided.
In small interference stability simulation method of electric power system, at first calculate the number of search point, distribute search point calculation task to core cpu automatically according to the core cpu number then.Owing to be multi-process, the search point of each core calculates and the serial computing process is identical.This method can directly be utilized existing serial computing program, by simple programming, can realize parallel computation.Its advantage is that programming is simple, and reliability height, and have the googol value and calculate and data-handling capacity can improve simulation velocity greatly under the prerequisite that guarantees the correct and simulation accuracy of result.
Technical scheme of the present invention is: a kind of small interference stability simulation method of electric power system, walk abreast with multi-core processor and to find the solution the problem of same emulation, the PROBLEM DECOMPOSITION that is about to the same emulation that the past found the solution by the single-processor serial becomes several independently calculation tasks, is distributed to each processor and carries out concurrent operation.
Said method comprises the following step:
Step 101: parallel computation begins;
Step 102: the number of statistics search point;
Step 103:, generate the calculation task (N 〉=2) of N search point according to the core cpu number N;
Step 104: the fork () function that calls under the (SuSE) Linux OS generates N process;
Step 105: each subprocess calls the calculation task that corresponding C PU independently carries out its search point set simultaneously;
Step 106: judge whether that all subprocesss all carry out end;
Step 107: the result of calculation of collecting subprocess;
Step 108: output.
Wherein: step 101: parallel computation begins to comprise:
(1) electrification system load flow and stable data file are as input, at first move the trend program and obtain the trend destination file, obtain dynamic element number, node number, grid line way and the trend parameter of analytic system from the trend destination file, determine system's basic structure, the initialization system variable, obtain the required dynamic element parameter of system's analysis on Small Disturbance Stability, initialization system parameter array by stablizing data file then;
(2) each element of initialization, the parameter matrix of computing element, all kinds of parameters of obtaining by above-mentioned (1), set up the element object instance of each dynamic element in the system, the element class that different dynamic elements is corresponding different is obtained each instance parameter, and is calculated the coefficient matrices A of each dynamic element
i, B
i, C
i, D
i
The dynamic perfromance of electric system is described by one group of nonlinear differential equation group and one group of non-linear algebraic equation group:
At equilibrium point x
0Near linearization, the non-state vector of definition status vector sum is as follows:
ΔX=[x
1,x
2,...,x
m]
T
ΔY=[x
m+1,x
m+2,...,x
n]
T
Obtain the matrix form of system:
Wherein, the coefficient matrices A of certain dynamic element (supposing that this original paper has k the differential equation, a h algebraic equation)
i, B
i, C
i, D
iFor:
(3) with the coefficient matrices A of each element
i, B
i, C
i, D
iMerge, promptly obtain big system matrix J
A, J
B, J
C, J
D:
Form the augmented state matrix A in conjunction with network admittance matrix then
B
E wherein
1, E
2Be network node voltage matrix, I
1, I
2Be node injection current matrix, Y is a network admittance matrix.
Step 102: the number of statistics search point comprises:
Restart the number of searching for point in the Arnoldi algorithm control information according to user-defined care regional extent and implicit expression, form the information of all search points of total system;
Step 103: according to the core cpu number N, the eigenvalue calculation task that generates N search point comprises:
According to the core cpu number N, the search points that total system is all are divided into N part;
Step 104: the fork () function that calls under the (SuSE) Linux OS generates N process;
Step 105: each subprocess call simultaneously corresponding C PU independently carry out its search point set calculation task comprise:
N serial simulation process arranged in this step, also is that N serial simulated program calculates at the same time, and the startup of this N process realizes by the process transfer Function e xeclp () under the (SuSE) Linux OS;
Step 106: judging whether that all subprocesss are all carried out finishes to comprise:
This step is called waitpid () function under the (SuSE) Linux OS and is judged whether that all subprocesss all carry out end, as long as there is a subprocess not finish, program will continue to wait for, wait until that always all subprocesss all carry out end, and program just enters into next step;
Step 107: the result of calculation of collecting subprocess comprises:
After each subprocess calculating, the existence of a plurality of result of calculation files is arranged and cause inconvenience on the result checks, to same linearization matrix, the result of different CPU core searching and computing is merged into a result, when above-mentioned all subprocesss are all carried out end, program will be collected the result of calculation of subprocess, and it is merged into a destination file.
Step 108: output comprises:
After program calculating finishes, the result is exported by text mode, forms mode and graphics mode.
Wherein, the dynamic element described in the step 101 comprises generator, excitation system, speed regulator, prime mover, dynamic load element (as induction motor and synchronous motor), wind-powered electricity generation machine, DC transmission system, power electronic element (as FACTS) etc.
The invention has the beneficial effects as follows: at home and abroad electric system small interference stability simulation field proposes to use the parallel computation emulation mode of many core CPU multi-process first.In emulation, can select to call suitable process number automatically according to the core cpu number, thereby under the prerequisite of correct simulation accuracy in the assurance result, shortened simulation time greatly, improved efficiency of programs, it is low and can not make full use of the defective of CPU data to have overcome existing small interference stability simulation method of electric power system efficient that can only serial computing.
Embodiment
Below, 1 describe a kind of small interference stability simulation method of electric power system of the present invention in detail with reference to the accompanying drawings.
Electric system is an advanced dynamic system with differential equation.The ideal situation of Operation of Electric Systems is that at any time system can continuously power to load with constant voltage and frequency.Yet this ideal is unpractical in real system, and in fact electric system is subjected to the impact of some interference constantly.Whether electric system is suffered after the little interference stable relevant with several factors, mainly comprises: the electrical link tightness degree of each element and characteristic of various control device or the like in initial launch state, the transmission system.In modern power systems, be subjected to influence of various factors and restriction, some power supply location bases are away from load center, and the long distance powedr transmission equivalent reactance is bigger, and through-put power is generally also very big; The generator single-machine capacity increases, and the synchronous reactance value that generator is relative increases, and the unit set inertia time constant reduces; Interacted system interconnection transmission capacity increases, the system reserve capacity relative deficiency; Use quick high-gain excitation control etc.Owing to above these a series of reasons, the stability intrinsic to electric system itself can exert an influence, and occurs the low-frequency oscillation of negative damping type easily, even causes more serious stability disruption accidents such as interacted system off-the-line.
In theory, the small signal stability of electric system is equivalent to the progressive stability of general dynamics system under the Lyaponov meaning.The Lyaponov linearization technique is relevant with the local stability of nonlinear system, from intuitively understanding, should have a similar characteristic to its linearization is approximate when nonlinear system is moved among a small circle.Current, the method that is used to study the complicated electric power system small interference stability mainly is based on the small disturbance method of Lyaponov first-order approximation method.This method principle is as follows:
The dynamic perfromance of electric system is described by one group of nonlinear differential equation group and one group of non-linear algebraic equation group:
(formula 1)
At equilibrium point x
0Near linearization is shown its initial value and little increment sum to each argument table:
x
i=x
I0+ Δ x
i(formula 2)
With the gained system of equations at equilibrium point x
0Near be launched into Taylor series, and omit the secondary and the high-order term of each little increment:
(formula 3)
The non-state vector of definition status vector sum is as follows:
ΔX=[x
1,x
2,...,x
m]
T
ΔY=[x
m+1,x
m+2,...,x
n]
T
(formula 3) write as matrix form:
(formula 4)
Wherein, the coefficient matrices A of certain dynamic element (supposing that this original paper has k the differential equation, a h algebraic equation)
i, B
i, C
i, D
iFor:
Coefficient matrices A with each element
i, B
i, C
i, D
iMerge, promptly obtain big system matrix J
A, J
B, J
C, J
D:
The non-state variable of cancellation in formula (4):
(formula 5)
(formula 5) is exactly the state equation of describing linear system, and wherein A is that n * n maintains matrix number, is called the state matrix of this system.
For the linear system of being described by state equation, its small signal stability is by all eigenwert decisions of state matrix.Here do not add proof and draw Lyaponov first stability theorem: if all characteristic roots of lienarized equation (formula 5) all have negative real part, then the equilibrium state of original system is asymptotically stable; If the characteristic root of lienarized equation (formula 5) has at least a root to have positive real part, then the equilibrium state of original system is unsettled; If it is zero situation (being called critical condition) that the characteristic root of lienarized equation (formula 5) has real part, the stability of then former nonlinear system (formula 5) can not be judged from lienarized equation (formula 5), and secondary and the more influence of high-order term in the necessary consideration full scale equation expansion.For the electric system of actual motion, the system stability of analyzing under the critical condition there is no much meanings, can look it and be the limiting case of small interference stability.Therefore, analytic system can be summed up as the problem of whole eigenwerts of finding the solution state matrix A in the small signal stability problem of certain operating point.
So the general process of power system small signal stability analysis can be summed up as:
1) steady-state value (being the value of equilibrium point) of each variable under the given steady-state operation situation of calculating;
2) to describing the differential-algebraic equation of transient state process, near steady-state value, carry out linearization;
3) form state matrix A, and judge the stability of system according to the character of its eigenwert.
The method of finding the solution the eigenwert of state matrix A has a lot, what the present invention used is that implicit expression restarts Arnoldi algorithm, be a kind of very effective full dimensional feature value part eigenvalue calculation method, be suitable for the eigenvalue calculation in the large-scale electrical power system small interference stability simulation.
The large-scale power system analysis on Small Disturbance Stability generally only needs computing system underdamping and instability (pattern), especially for low-frequency oscillation problem, only requires and calculates underdamping rotor vacillation pattern, i.e. critical eigenvalue.Critical eigenvalue is not to be the eigenwert of system state matrix norm maximum, can not directly use implicit expression to restart Arnoldi algorithm and carry out efficient calculation.Therefore, restart the critical eigenvalue of Arnoldi algorithm computing system, must carry out the pre-service of state matrix earlier in order to utilize implicit expression.
The preconditioning technique of matrix is by matrixing A
t=f (A) is with the critical eigenvalue λ of original matrix
iBe transformed to matrix A
tThe dominant characteristics value, and the latter can efficiently find the solution with sparse features value analytical approach.
The displacement converter technique of inverting is the most frequently used preconditioning technique, and its is mapped to the dominant characteristics value of battle array after the conversion with near the eigenwert the original matrix translation point, has increased near the degree of separation of the eigenwert of original matrix translation point simultaneously.Its variation is:
A
t=(A-qI)
-1(formula 6)
Wherein q is plural displacement, establishes matrix A
tEigenwert and individual features vector be respectively λ
tAnd X
t, then:
A
tX
t=(A-qI)
-1X
t=λ
tX
t(formula 7)
Can get by following formula:
(formula 8)
Obvious matrix A and matrix A
tProper vector equate and following relation to be arranged between the eigenwert of the two:
(formula 9)
As seen, in the A battle array the several characteristic value of the most close q be mapped to A
tThe several characteristic value of mould maximum in the battle array, and proper vector is constant.If can obtain A
tPreceding r the eigenwert that modulus successively decreases, then they are A middle distance q r from the near to the remote eigenwerts, this obviously is adapted to our needed selection signature analysis.Because this conversion has increased the distance between the eigenwert of shining upon, thereby improved the convergence of special gust of value method for solving; Yet, in order to obtain all critical eigenvalues, thereby need repeatedly displacement to scan the whole imaginary axis, this just needs to do some redundant computation inevitably.
The translation point that displacement is inverted in the converter technique is referred to as to search for a little in the present invention.In the electric system small interference stability simulation, need obtain near the eigenwert a series of search points, be concerned about regional eigenwert thereby obtain institute.
After finishing the calculating of a search point, being the center of circle with the search point on complex plane then, is the circle of radius with the center of circle to the maximum linear distance in the eigenvalue distribution point of finding, and it is round to be called search.If calculate convergence, then will not exist in the search circle and leak root (leakage root refer to omit the eigenwert that does not calculate); Do not restrain if calculate,, may have the leakage root in the search circle though the eigenwert that calculates is accurately.In order to search all eigenwerts of being concerned about in the zone, often need the repeatedly eigenvalue calculation of a plurality of search points.
The example of search circle as shown in Figure 2.The two sub-eigenvalue searching and computing results that shown two search points among the figure: two search point coordinate are respectively C1 and C2, and the eigenwert number of search is respectively that 4 and 5, twice calculating all obtain eigenwert E4.After calculating finishes,, be in two search circles in the center of circle then, have only 8 eigenwerts to exist with C1 and C2 if all restrain during twice searching and computing.If have only the calculating of search point C1 not restrain, then may have the leakage root in the dash area among Fig. 2.
In addition, the state matrix A of system itself is not sparse, but, system's augmented state matrix is but very sparse, based on the above fact, a kind of method of utilizing system's augmented state matrix sparse characteristic solving system eigenwert and proper vector has been proposed, i.e. sparse matrix technology, sparse matrix technology not only can be saved memory headroom, and can reduce calculated amount greatly.By using sparse matrix technology, implicit expression restarts Arnoldi algorithm just really can be used for power system small signal stability analysis.
Small interference stability simulation method of electric power system key step of the present invention is as follows:
Step 101: parallel computation begins;
(1) electrification system load flow and stable data file are as input.At first move the trend program and obtain the trend destination file, obtain dynamic element (generator etc.) number, node number, grid line way and the trend parameter of analytic system, determine system's basic structure, the initialization system variable from the trend destination file.Obtain the required dynamic element parameters such as generator of system's analysis on Small Disturbance Stability, initialization system parameter array by stablizing data file then.
(2) each element of initialization, the parameter matrix of computing element.By all kinds of parameters of obtaining previously, set up the element object instance (the element classes that different dynamic elements is corresponding different) of each dynamic element (generator etc.) in the system; Obtain each instance parameter, and calculate its coefficient matrices A
i, B
i, C
i, D
i
The dynamic perfromance of electric system is described by one group of nonlinear differential equation group and one group of non-linear algebraic equation group:
At equilibrium point x
0Near linearization, the non-state vector of definition status vector sum is as follows:
ΔX=[x
1,x
2,...,x
m]
T
ΔY=[x
m+1,x
m+2,...,x
n]
T
Obtain the matrix form of system:
Wherein, the coefficient matrices A of certain dynamic element (supposing that this original paper has k the differential equation, a h algebraic equation)
i, B
i, C
i, D
iFor:
(3) with the coefficient matrices A of each element
i, B
i, C
i, D
iMerge, promptly obtain big system matrix J
A, J
B, J
C, J
D:
Form the augmented state matrix A in conjunction with network admittance matrix then
B
E wherein
1, E
2Be network node voltage matrix, I
1, I
2Be node injection current matrix, Y is a network admittance matrix.
Step 102: the number of statistics search point;
Restart the number of searching for point in the Arnoldi algorithm control information according to user-defined care regional extent and implicit expression, form the information of all search points of total system.
Step 103:, generate the eigenvalue calculation task of N search point according to the core cpu number N;
According to the core cpu number N, all search points of total system are divided into N part.
Step 104: the fork () function that calls under the (SuSE) Linux OS generates N process;
Step 105: each subprocess calls the calculation task that corresponding C PU independently carries out its search point set simultaneously;
Have N serial simulation process (also being N serial simulated program) to calculate at the same time in this step, the startup of this N process is to realize by the process transfer Function e xeclp () under the (SuSE) Linux OS.
Step 106: judge whether that all subprocesss all carry out end;
This step is called waitpid () function under the (SuSE) Linux OS and is judged whether that all subprocesss all carry out end.As long as there is a subprocess not finish, program will wait for that until all subprocesss are all carried out end, program just enters into next step.
Step 107: the result of calculation of collecting subprocess;
After calculating for fear of each subprocess, the existence of a plurality of result of calculation files is arranged and cause inconvenience on the result checks, to same linearization matrix, the result of different CPU core searching and computing can merge into a result.All carry out end when all subprocesss, program will be collected the result of calculation of subprocess, and it is merged into a destination file.
Step 108: program output.
After program calculating finishes, can the result be exported by text mode, forms mode and graphics mode.The task scheduling of parallel computation and allocation of codes are realized by C Plus Plus.Owing to used management of process and the scheduling function under the (SuSE) Linux OS, so under Windows operating system, code need compile through the cygwin Software tool.
More than be in order to make those of ordinary skills understand the present invention; and the detailed description that the present invention is carried out; but can expect; in the scope that does not break away from claim of the present invention and contained, can also make other variation and modification, these variations and revising all in protection scope of the present invention.