A dynamic incremental calculation method of power flow Jacobian matrix and power imbalance
By optimizing the Jacobian matrix calculation process and using the lower triangular cyclic queue of the admittance matrix for dynamic incremental calculation, the problems of slow Jacobian matrix calculation and high storage resource consumption are solved, and more efficient Jacobian matrix and power imbalance calculation are achieved.
Patent Information
- Application Number
- CN202511120879.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-08-12
AI Technical Summary
When faced with the dynamic changes of massive power grid data, the existing technology consumes high storage resources and has slow calculation speed when calculating the Jacobian matrix, and lacks dynamic and refined optimization of the Jacobian matrix and power imbalance.
By redesigning the Jacobian matrix calculation process, the lower triangular admittance value of the current node to the target node is saved in the lower triangular circular queue of the admittance matrix, and the power accumulated value of the target node is dynamically updated to the power accumulated value register. The lower triangular circular queue of the admittance matrix is used to shorten the calculation time of the Jacobian lower triangular matrix, and the parallel pipeline dynamic incremental calculation of the Jacobian matrix and the power imbalance is realized.
It greatly shortens the calculation time and storage resource consumption of the Jacobian matrix, reduces the calculation time and storage resource consumption of the Jacobian matrix of large-scale networks, and improves computing efficiency.
Smart Images

Figure CN120638357B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power flow calculation, in particular to a dynamic incremental calculation method of power flow Jacobian matrix and power imbalance. BACKGROUND
[0002] Power flow calculation is a very important analysis and calculation of power system, which calculates electrical quantities including active power, reactive power and voltage distribution in the power grid under the steady-state operation condition of the power system according to the wiring mode, parameters and operation conditions of the power system. Power flow calculation is also the basis for system safety, stability and reliability analysis, which is used to study various problems raised in system planning and operation. For the planned power system, power flow calculation can verify whether the proposed power system planning scheme can meet the requirements of various operation modes; for the running power system, power flow calculation can predict whether various load changes and network structure changes will endanger the safety of the system, whether the voltage of all buses in the system is within the allowed range, whether various components (lines, transformers, etc.) in the system will be overloaded, and what preventive measures should be taken in advance when overloading may occur.
[0003] The existing document (Nwankpa C, Johnson J, Nagvajara P, et al. FPGA hardware results for power system computation [C] / / 2009 IEEE / PES Power Systems Conference and Exposition. 0 [2023-09-26]. DOI: 10.1109 / PSCE.2009.4839953.) proposes a power flow calculation FPGA system based on Newton-Raphson method by collecting real-time SCADA system network and telemetry data.
[0004] This scheme, in the face of massive data dynamic changes of the power grid, does not utilize the coordinate mapping relationship of admittance matrix and Jacobian matrix when calculating the Jacobian matrix, and lacks dynamic fine optimization of the whole process of Jacobian matrix calculation, which has the disadvantages of high storage resource consumption and slow calculation speed. SUMMARY
[0005] The technical problem to be solved by the present application is to provide a dynamic incremental calculation method of power flow Jacobian matrix and power imbalance, which can shorten the matrix calculation time.
[0006] The technical scheme adopted by the present application to solve the technical problem is: a dynamic incremental calculation method of power flow Jacobian matrix and power imbalance is provided, comprising the following steps:
[0007] Calculating the power partial derivative between the current node from_bus and the target node to_bus by row elements, saving the calculation result to the power partial derivative queue and the voltage partial derivative queue, and storing the relevant lower triangular admittance value of the current node from_bus and the target node to_bus into the lower triangular loop queue of the admittance matrix, and synchronously writing the power accumulation value of the target node to_bus into the power accumulation value register, wherein the number of the current node from_bus is less than the number of the target node to_bus;
[0008] Taking the first data from the lower triangular loop queue of the admittance matrix, comparing whether the column number of the current data is the target node required by the current row; if it is the target node required by the current row, performing the power partial derivative calculation between the node pair, preferentially writing the calculation result into the power partial derivative queue and the voltage partial derivative queue, and synchronously writing the power accumulation value of the target node into the power accumulation value register; if it is not the target node required by the current row, re-writing the data from the end of the queue into the lower triangular loop queue of the admittance matrix; repeating the step until the data in the lower triangular loop queue of the admittance matrix is completed;
[0009] According to the reading order of the data in the admittance matrix, calculating the Jacobian matrix data and the power imbalance;
[0010] When the admittance matrix data of the target node row is read, the two-row data calculation in the Jacobian matrix is completed, and the data in the power partial derivative queue and the voltage partial derivative queue is written into the memory.
[0011] According to the reading order of the data in the admittance matrix, calculating the Jacobian matrix data and the power imbalance, specifically comprising:
[0012] Judging whether the row node number i and the column node number j of the read admittance matrix data are equal;
[0013] If not equal, calculating the power partial derivative of the (i, j) position in the Jacobian matrix and storing it into the power partial derivative queue and the voltage partial derivative queue;
[0014] If equal, after reading all the data of the i-th row, calculating the partial derivative element of the diagonal line and the power and voltage imbalance of the i-th node by reading the accumulation register, and saving the diagonal line data to the Jacobian diagonal line register.
[0015] When calculating the partial derivative element of the diagonal line and the power and voltage imbalance of the i-th node by reading the accumulation register, if the node is a PQ node, the calculation process is as follows:
[0016] Calculating the weighted value of the voltage contribution value to the total power based on the value read in the accumulation register;
[0017] The active power and the reactive power are calculated according to the weighted value of the voltage contribution value to the total power, and the active power imbalance and the reactive power imbalance are calculated according to the obtained active power and reactive power;
[0018] The contribution value of the self-inductance of the current node to the partial derivative of the voltage is calculated.
[0019] The power contribution value is calculated according to the contribution value of the self-inductance of the current node to the partial derivative.
[0020] The partial derivative of the active power to the voltage and the partial derivative of the voltage square to the voltage are calculated according to the power contribution value and the value read from the accumulation register.
[0021] When the diagonal partial derivative element and the i-th node power and voltage imbalance are calculated by reading the accumulation register, if the node is a PU node, the calculation process is as follows:
[0022] The voltage contribution value to the total power is calculated based on the value read from the accumulation register.
[0023] The active power is calculated according to the weighted value of the voltage contribution value to the total power, and the active power imbalance is calculated according to the obtained active power.
[0024] The voltage square of the current node is calculated, and the imbalance of the voltage square is calculated based on the voltage square of the current node.
[0025] The contribution value of the self-inductance of the current node to the partial derivative of the voltage is calculated.
[0026] The power contribution value is calculated according to the contribution value of the self-inductance of the current node to the partial derivative.
[0027] The partial derivative of the active power to the voltage is calculated according to the power contribution value and the value read from the accumulation register, and the partial derivative of the voltage square to the voltage is calculated according to the square of the voltage of the current node.
[0028] The two rows of data in the Jacobian matrix are calculated, specifically, all nodes with column number less than row number are read from the lower triangular circular queue of the inductance matrix, and the power accumulation is calculated, and when the power accumulation of all nodes with column number less than row number is calculated, the data of the inductance matrix is read to calculate the upper triangular part.
[0029] The two rows of data in the Jacobian matrix are calculated, specifically, all nodes with column number less than row number are read from the lower triangular circular queue of the inductance matrix, and the power accumulation is calculated, and when the power accumulation of all nodes with column number less than row number is calculated, the data of the inductance matrix is read to calculate the upper triangular part.
[0030] When the row number read from the lower triangular loop queue of the admittance matrix is less than the row number of the current admittance matrix, and the column number read from the lower triangular loop queue of the admittance matrix is equal to the row number of the current admittance matrix, the current value read from the lower triangular loop queue of the admittance matrix is assigned to the conductance register and the susceptance register, the node voltage corresponding to the column number of the lower triangular admittance value is taken out from the voltage register, the contribution value of the mutual admittance corresponding to the row and column numbers of the current admittance matrix and the partial derivative of the node voltage is calculated, and the total power accumulation is calculated according to the contribution value;
[0031] When the column number read from the lower triangular loop queue of the admittance matrix is not equal to the row number of the current admittance matrix, the read signal of the lower triangular loop queue of the admittance matrix is pulled high, the next data is read, and the current read data is written to the end of the lower triangular loop queue of the admittance matrix again. When the row number search of the lower triangular loop queue of the admittance matrix is completed for all rows, the calculation of the lower triangular part is completed. According to the value of the current remaining data number register of the lower triangular matrix queue, the data in the lower triangular matrix queue is written again. When the value of the data number register is greater than zero, the following steps are repeatedly executed until all the remaining data are written again. The read signal of the lower triangular loop queue of the admittance matrix is pulled high, the first data in the queue is read and saved to the first data register, the write signal of the lower triangular loop queue of the admittance matrix is pulled high, the value of the first data register is written to the end of the lower triangular loop queue of the admittance matrix, and the data number register in the queue is updated.
[0032] The writing of the data in the power partial derivative queue and the voltage partial derivative queue into the memory includes writing the active power queue value and the column index value, specifically:
[0033] The current admittance matrix row data calculation completion signal is pulled high, the read active power partial derivative queue data counter is initialized, and the data division signal is pulled high.
[0034] When the value of the read active power partial derivative queue data counter is less than or equal to the number of data of the current row written into the active power partial derivative queue, the following process is repeatedly executed:
[0035] The active power partial derivative queue read signal is pulled high, the active power value in the current active power partial derivative queue is read and saved to the register P_data, the data in the register P_data is taken out twice and saved to the write data bus of the memory, and then the data on the write data bus is written into the Jacobian first address cell in the memory.
[0036] The active power column index queue read signal is pulled high, the active power column index value in the current active power column index queue is taken out, the active power column index value is saved to the write data bus of the memory, and then the data on the write data bus is written into the Jacobian first address cell in the memory.
[0037] updating the current read active power derivative queue data counter, and clearing the active power derivative queue read signal.
[0038] The writing of the data in the power derivative queue and the voltage derivative queue into the memory comprises writing the reactive power queue value and the column index value, and specifically:
[0039] pulling up the reactive power voltage data segmentation signal, and initializing the read reactive power voltage derivative queue data counter;
[0040] When the value of the read reactive power voltage derivative queue data counter is less than or equal to the number of data in the current row written into the reactive power voltage derivative queue, the following process is repeatedly executed:
[0041] pulling up the reactive power voltage derivative queue read signal, reading the reactive power voltage value in the current reactive power voltage derivative queue, and saving the reactive power voltage value to the register UQ_data, taking out the data in the register UQ_data twice, and saving the data to the write data bus of the memory, and then writing the data on the write data bus into the Jacobian first address cell in the memory;
[0042] pulling up the reactive power voltage column index queue read signal, taking out the reactive power voltage column index value in the current reactive power voltage column index queue, saving the reactive power voltage column index value to the write data bus of the memory, and writing the data on the write data bus into the Jacobian first address cell in the memory;
[0043] updating the current read reactive power voltage derivative queue data counter, and clearing the reactive power voltage derivative queue read signal.
[0044] The technical scheme adopted by the present application to solve the technical problems is: providing an electronic device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the dynamic incremental calculation method of the power flow Jacobian matrix and the power imbalance.
[0045] The technical scheme adopted by the present application to solve the technical problems is: providing a computer readable storage medium, which stores a computer program, wherein the computer program is executed by a processor to implement the steps of the dynamic incremental calculation method of the power flow Jacobian matrix and the power imbalance.
[0046] Advantages
[0047] Compared with the prior art, the present application has the following advantages and positive effects: the present application re-designs the calculation flow of the Jacobian matrix, saves the relevant lower triangular admittance values of the current node to the target node into the lower triangular cyclic queue of the admittance matrix, and dynamically updates the power accumulation value of the target node to the power accumulation value register. The lower triangular cyclic queue of the admittance matrix can greatly shorten the time for searching the admittance matrix during the calculation of the Jacobian lower triangular matrix. By designing the read-write control logic, the parallel pipeline dynamic incremental calculation of the Jacobian matrix and the power imbalance is realized, and the calculation time and storage resource consumption of the large-scale network Jacobian matrix are reduced. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1 is a logic flow chart of the dynamic incremental calculation method of the power flow Jacobian matrix and the power imbalance in the first embodiment of the present application;
[0049] Figure 2 is a schematic diagram of the coordinate transformation and storage structure of the admittance and Jacobian matrix in the first embodiment of the present application;
[0050] Figure 3 is a logic flow chart of the Jacobian matrix data calculation and writing into the memory in the first embodiment of the present application. DETAILED DESCRIPTION
[0051] The present application will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present application and not used to limit the scope of the present application. In addition, it should be understood that after reading the content taught by the present application, those skilled in the art can make various modifications or changes to the present application, and these equivalent forms also fall within the scope defined by the appended claims of the present application.
[0052] The first embodiment of the present application relates to a dynamic incremental calculation method of the power flow Jacobian matrix and the power imbalance, as shown in Figure 1 The method does not need to calculate the admittance matrix first and then calculate the Jacobian matrix. Within the interval of receiving two groups of branch data from the serial port, the upper triangular form of the admittance matrix is calculated step by step through the streaming calculation and saved into the synchronous dynamic random access memory (SDRAM). Then, the row data in the admittance matrix is read from the SDRAM to perform the dynamic incremental calculation of the Jacobian matrix. The calculation flow includes the following steps:
[0053] Step 1, the power partial derivative between the current node from_bus and the target node to_bus is calculated according to the row element, which is the partial derivative of the active power between the nodes to the voltage amplitude of each node and the partial derivative of the reactive power between the nodes to the voltage amplitude of each node. The calculated power partial derivative is saved to the power partial derivative queue derivative_P_FIFO and the voltage partial derivative queue derivative_QU_FIFO, and the related lower triangular admittance value of the current node from_bus to the target node to_bus is stored in the lower triangular Jacoby matrix circulation queue low_tri_jacoby_FIFO, and the power accumulation value of the target node to_bus is written into the power accumulation value register acc_M and acc_N synchronously, wherein the number of the current node from_bus is less than the number of the target node to_bus.
[0054] Step 2, the first data is taken out from the lower triangular Jacoby matrix circulation queue low_tri_jacoby_FIFO, and it is compared whether the column number of the current data is the target node required by the current row; if it is the target node required by the current row, the power partial derivative between the node pair is calculated, and the calculation result is written into the power partial derivative queue derivative_P_FIFO and the voltage partial derivative queue derivative_QU_FIFO preferentially, and the power accumulation value of the target node is written into the power accumulation value register acc_M and acc_N synchronously; if it is not the target node required by the current row, the data is written from the end of the queue to the lower triangular Jacoby matrix circulation queue low_tri_jacoby_FIFO again; this step is repeated until the data in the lower triangular Jacoby matrix circulation queue low_tri_jacoby_FIFO is circulated.
[0055] Step 3, according to the reading order of the data in the Jacoby matrix, the Jacoby matrix data and the power imbalance are calculated; this step specifically includes: judging whether the row node number i and the column node number j of the read data in the Jacoby matrix are equal; if not, the power partial derivative of the (i, j) position in the Jacoby matrix is calculated and stored in the power partial derivative queue and the voltage partial derivative queue; if they are equal, after reading all the data in the i-th row, the partial derivative elements of the diagonal line and the power and voltage imbalance of the i-th node are calculated through reading the accumulation register, and the diagonal line data is saved to the Jacoby diagonal line register.
[0056] The embodiment designs the compressed storage format of the Jacoby matrix (see Figure 2 ), the diagonal line elements in the Jacoby matrix represent the power accumulation value partial derivative of the node pair to other nodes in the row, which is stored in the register diag_jacoby[63:0][2(n-1)-1:0] separately, wherein n represents the number of nodes.
[0057] If (i,j) represents the coordinates in the GB admittance matrix, the corresponding coordinates in the Jacobian matrix are The register delta_PQU[63:0][2(n-1):0] represents the power imbalance and voltage imbalance of all nodes.
[0058] The dynamic incremental calculation mode is designed for the accumulation and partial calculation in the Jacobian matrix and the power imbalance in the power flow calculation. The accumulation value of the voltage of the ith node to the power imbalance is denoted as and , which are represented as follows:
[0059] ;
[0060] wherein, and represent the real part and the imaginary part of the node voltage, and represent the real part and the imaginary part of the element in the admittance matrix. The and are stored in the power accumulation registers acc_M[63:0][n-2:0] and acc_N[63:0][n-2:0], i.e., acc_M[i]← , acc_N[i]← .
[0061] For the ith PQ node, the incremental calculation formula of the active power imbalance and the reactive power imbalance can be represented as:
[0062] ;
[0063] wherein, and are the active power set value and the reactive power set value of the node, respectively.
[0064] When the node number i=j, the incremental calculation formula of the power partial derivative of the diagonal element in the Jacobian matrix is represented as follows:
[0065] .
[0066] The calculation process of the Jacobian matrix and the power imbalance in this step is as follows:
[0067] When the Jacobian matrix computation signal compute_jacoby_sig = 1 is valid, the high admittance matrix queue read signal Rd_GB_FIFO is set to 1, three data are continuously read from the admittance matrix queue GB_FIFO, the admittance matrix element number counter num_data_GB is set to 0, and the admittance matrix row number register GB_row_num is set to 1.
[0068] When Rd_GB_FIFO = 1 and num_data_GB < 3, the data from the admittance matrix queue GB_FIFO are respectively assigned to the conductance register , the susceptance register , and the column number register GB_col_num, i.e. ← read_FIFO[GB_FIFO], ← read_FIFO[GB_FIFO], GB_col_num ← read_FIFO[GB_FIFO], and the admittance matrix element number counter num_data_GB is incremented by 1 each time the queue is read. When num_data_GB = 3, the admittance matrix queue read signal Rd_GB_FIFO is set to 0.
[0069] The voltage value corresponding to node j is taken from the voltage value register voltage_ef[63:0][n-1:0] and , the number of node j is GB_col_num, the high 32 bits ← voltage_ef[GB_col_num][63:32], and the low 32 bits ← voltage_ef[GB_col_num][31:0]. At the same time, the voltage value of node i is taken and stored in the register and , i.e. ← voltage_ef[GB_row_num][63:32], ← voltage_ef[GB_row_num][31:0], and then the node power accumulation sum term and is calculated and stored in the power accumulation sum registers acc_M[i] and acc_N[i]. If GB_row_num = GB_col_num, the record , is recorded.
[0070] The intermediate variable registers , , are set , respectively , , , , , , .
[0071] Finally, the and are stored and accumulated into accumulators acc_M and acc_N with the address of GB_row_num, i.e. acc_M[GB_row_num] <- acc_M[GB_row_num] + Y[i, j] and acc_N[GB_row_num] <- acc_N[GB_row_num] + X[i, j]. .
[0072] Then, the GB_FIFO reading signal Rd_GB_FIFO is pulled high, i.e. Rd_GB_FIFO <- 1, and the next admittance matrix data is read. When the i-th row data is read, the , , of the current node can be calculated. Meanwhile, the power accumulation of other nodes with the number j is dynamically accumulated into the registers acc_M and acc_N.
[0073] The embodiment further provides a node type register node_type[n-1:0], node_type[i]=1 indicates that the ith node is a PQ node, wherein the PQ node refers to a node with given active power P and reactive power Q, and voltage amplitude and voltage phase being to-be-solved quantities; node_type[i]=0 indicates that the ith node is a PV node, wherein the PV node refers to a node with given active power P and voltage amplitude, and reactive power Q and voltage phase being to-be-solved quantities. The node type of the current node numbered as GB_row_num is taken, that is, current_node_type←node_type[GB_row_num], and set_value_P, set_value_Q and set_value_U represent the set values of active power, reactive power and voltage respectively. The data number current_row_num of the current row is read from the admittance matrix row element number queue GB_row_num_FIFO, that is, current_row_num←read_FIFO[GB_row_num_FIFO], when the data reading number counter num_data_GB=3, the value of the read admittance element number register GB_row_num is updated, GB_row_num←GB_row_num+1, and when the counter value GB_row_num=current_row_num, it is indicated that the row data has been read completely.
[0074] Three queues are provided, the derivative_P_FIFO queue stores the partial derivative of active power P to voltage of each row element of the Jacobian matrix, the derivative_QU_FIFO queue indicates the partial derivative of reactive power Q and voltage U to voltage of each row element of the Jacobian matrix, and the lower_tri_GB queue is a circular queue, which stores the record value of the power partial derivative between nodes in the upper triangular element of the GB matrix, and the record value indicates the admittance value of the current row node to other nodes in the lower triangular matrix. After the data of each row of the Jacobian matrix is calculated, the lower triangular part of the next row of the GB admittance matrix to be calculated is taken, and then the remaining elements are written into the tail in turn for use in the next round of calculation.
[0075] The following describes two cases according to the type value of the current node, and the upper triangular and diagonal elements of the Jacobian matrix are calculated respectively. The row number register GB_row_num is initially set as GB_row_num←1, when the Jacobian matrix calculation signal compute_jacoby=1, GB_row_numcong 1 to n-1, the upper triangular part of the GB matrix is taken in turn to calculate.
[0076] If current_node_type = 1, it means that the node is a PQ node, and its calculation process is as follows:
[0077] The active power curren_set_value_P and the reactive power curren_set_value_Q of the current node are set, i.e., curren_set_value_P <- set_value_P[GB_row_num], curren_set_value_Q <- set_value_Q[GB_row_num]. The power accumulation value registers curren_acc_M and current_acc_N of the current GB_row_num row number are recorded, i.e., curren_acc_M <- acc_M[GB_row_num], curren_acc_N <- acc_N[GB_row_num]. Then the active power and the reactive power of the current node are calculated, respectively.
[0078] First, the non-diagonal line part of the upper triangular matrix in the Jacobian matrix is calculated.
[0079] The contribution value of the power accumulation sum curren_acc_M and curren_acc_N to the total power of the voltage and is calculated, and stored in the register acc_Me, the register acc_Mf, the register acc_Ne and the register acc_Nf, i.e., acc_Me <- curren_acc_M, acc_Mf <- curren_acc_M, acc_Ne <- curren_acc_N, acc_Nf <- curren_acc_N. After the above operation, the values in the register acc_Me, the register acc_Mf, the register acc_Ne and the register acc_Nf are the weighted values of the total power. After the above operation, the values in the register acc_Me, the register acc_Mf, the register acc_Ne and the register acc_Nf are the weighted values of the total power.
[0080] Then, the active power and the reactive power are calculated according to the weighted values of the total power of the voltage contribution value, i.e., <- acc_Me + acc_Nf, <- acc_Mf - acc_Ne. Then the active power and the reactive power are calculated, and the active power imbalance and the reactive power imbalance are calculated, respectively. , Finally, the active power imbalance and reactive power unbalance Write to the delta_PQU[63:0][2(n-1)-1:0] register, that is, delta_PQU[2·GB_row_num-1]← ,delta_PQU[2·GB_row_num]← .
[0081] Next, we calculate the diagonal part of the Jacobian matrix:
[0082] Calculate the self-admittance of the current node 、 and voltage 、 The contribution value of the partial derivative is saved in the temporary register Ge, temporary register Gf, temporary register Be, and temporary register Bf, where Ge← ,Gf← ,Be← ,Bf← After the above operation, the values in the temporary registers Ge, Gf, Be, and Bf are the self-admittance of the current node. 、 and voltage 、 Contribution to the partial derivative.
[0083] Then, the power contribution value is calculated according to the contribution value of the current node's self-admittance to the partial derivative, and stored in the power contribution value register contri_Pe, the power contribution value register contri_Pf, the power contribution value register contri_Qe, and the power contribution value register contri_Qf, that is, contri_Pe←-Ge-Bf, contri_Pf←Be-Gf, contri_Qe←Be-Gf, contri_Qf←Ge+Bf. After the above operations, the values in the power contribution value register contri_Pe, the power contribution value register contri_Pf, the power contribution value register contri_Qe, and the power contribution value register contri_Qf are the power contribution values.
[0084] The last power contribution value and the value read from the accumulated sum register are used to calculate the partial derivatives of active power and reactive power with respect to voltage, and are saved to the partial derivative registers derivative_Pe, derivative_Pf, derivative_Qe, and derivative_Qf, respectively, i.e., derivative_Pe <- current_acc_M + contrib_Pe, derivative_Pf <- current_acc_N + contrib_Pf, derivative_Qe <- current_acc_N + contrib_Qe, and derivative_Qf <- current_acc_M + contrib_Qf.
[0085] The following flow is used to store the diagonal values into the Jacobian diagonal register dig_jacoby[63:0][8(n-1)-1:0].
[0086] Figure 2 The shown is the coordinate transformation and storage structure of admittance matrix and Jacobian matrix. The Jacobian element at coordinate (i, j) of the admittance matrix is a 2x2 matrix. The PQ nodes are stored in the four cells at addresses [4i-3, 4i-2, 4i-1, 4i] of the dig_jacoby register in the order of .
[0087] The values of the power with respect to voltage partial derivative registers calculated above are written into the dig_jacoby register at the address of the row node number GB_row_num, i.e., dig_jacoby[4·GB_row_num-3] <- derivative_Pe, dig_jacoby[4·GB_row_num-2] <- derivative_Pf, dig_jacoby[4·GB_row_num-1] <- derivative_Qe, and dig_jacoby[4·GB_row_num] <- derivative_Qf.
[0088] The following is the read-write control flow of the admittance value and Jacobian matrix element queue.
[0089] Whenever the GB admittance value at position (i, j) is taken out, the admittance value is simultaneously stored into the lower_tri_GB_FIFO circular queue. When the node voltage partial derivative calculation is completed, the corresponding partial derivative register is simultaneously written into the Jacobian matrix element queue.
[0090] If the current read out admittance matrix row number value GB_row_num ≠ column number value GB_col_num, the following flow will write the calculated partial derivative to the queue.
[0091] Calculate the mutual admittance at the current admittance matrix (i,j) node , and the voltage and contribution value of the partial derivative, save to temporary registers contrib_Ge, contrib_Gf, contrib_Be, contrib_Bf, i.e. contrib_Ge← , contrib_Gf← , contrib_Be← , contrib_Bf← .
[0092] Then calculate the active power P and the reactive power Q partial derivative of the voltage, save to register derivative_Pe, register derivative_Pf, register derivative_Qe, register derivative_Qf respectively, i.e. derivative_Pe←-contri_Ge-contri_Bf, derivative_Pf←contri_Be-contri_Gf, derivative_Qe←derivative_Pf, derivative_Qf←-derivative_Pe.
[0093] The partial derivative data written to the queue needs to record the column number GB_col_num of the current admittance value, assemble the power partial derivative and the column number value, save to the power partial derivative register derivative_Pe_data, the power partial derivative register derivative_Pf_data, the power partial derivative register derivative_Qe_data, the power partial derivative register derivative_Qf_data to be written to the queue respectively, i.e. derivative_Pe_data←{derivative_Pe,2·GB_col_num-1}, derivative_Pf_data←{derivative_Pf,2·GB_col_num}, derivative_Qe_data←{derivative_Qe, 2·GB_col_num-1}, derivative_Qf_data←{derivative_Qf,2·GB_col_num}.
[0094] The write enable signals for the active power partial derivative queue, reactive power partial derivative queue, and voltage partial derivative queue are simultaneously pulled high (w_derivative_P_FIFO←1, w_derivative_QU_FIFO←1). When these power partial derivatives are not zero, they are written to the queues, executing write_FIFO[derivative_P_FIFO, derivative_Pe_data], write_FIFO[derivative_P_FIFO, derivative_Pf_data], write_FIFO[derivative_P_FIFO,derivative_Qe_data], and write_FIFO[derivative_P_FIFO, derivative_Qf_data], respectively. The write queue signals are then cleared (w_derivative_P_FIFO←0, w_derivative_QU_FIFO←0).
[0095] Assemble the current GB data and save it to the lower triangle temporary register lower_GB[95:0] of the admittance value, where lower_GB←{GB_row_num[15:0],GB_col_num[15:0], [31:0], Pull up the lower triangular admittance matrix GB queue write signal w_lower_tri_GB_FIFO←1, write lower_GB into the circular queue lower_tri_GB_FIFO, write_FIFO[lower_tri_GB_FIFO,lower_GB], update the queue number counter register lower_GB_length←lower_GB_length+1, and finally clear the write queue signal w_lower_tri_GB_FIFO←0.
[0096] If current_node_type=0, it means that the node is a PU node.
[0097] The active power register curren_set_value_P and the voltage register curren_set_value_U of the current node are set, i.e. curren_set_value_P <- set_value_P[GB_row_num], curren_set_value_U <- set_value_U[GB_row_num]. When the node setting value is completed, the read signal is cleared, i.e. Rd_GB_FIFO <- 0, and the counter value is set to 0, i.e. GB_row_num <- 0. The power accumulation value registers curren_acc_M and current_acc_N of the current GB_row_num row number are recorded, i.e. curren_acc_M <- acc_M[GB_row_num], curren_acc_N <- acc_N[GB_row_num].
[0098] First, the non-diagonal line part of the upper triangle of the Jacobian matrix is calculated.
[0099] The PU node only needs to calculate the contribution value of the active power P to the total power. First, the contribution value of the power accumulation sum curren_acc_M and curren_acc_N to the voltage and is calculated to the total power, i.e. acc_Me <- · curren_acc_M, acc_Nf <- · curren_acc_N.
[0100] Then, the active power , is calculated according to the contribution value of the voltage to the total power, i.e. acc_Me + acc_Nf, and then the active power imbalance , is calculated according to the obtained active power.
[0101] Then, the voltage square sum of the current node is calculated and saved to the voltage U square sum register ef_square, i.e. ef_square <- U2, and the voltage square imbalance is calculated based on the voltage square sum of the current node and saved to the voltage square imbalance register delta_U_square, i.e. delta_U_square <- U4 - 2U2. Finally, the active power imbalance and the voltage square imbalance register delta_U_square are saved to the delta_PQU register, i.e. delta_PQU[2·GB_row_num-1] <-. delta_PQU[2*GB_row_num] <- delta_U_square.
[0102] Next, the diagonal part of the Jacobian matrix is calculated:
[0103] The self-impedance of the current node is calculated , and the voltage and The contribution of the partial derivative is saved to temporary registers Ge, Gf, Be, Bf, i.e. Ge <- -Bf, Gf <- Be, Be <- -Ge, Bf <- Gf. The contribution of the power is then calculated from the contribution of the partial derivative of the self-impedance of the current node and saved to power contribution registers contri_Pe, contri_Pf, contri_Qe, contri_Qf, i.e. contri_Pe <- -Ge-Bf, contri_Pf <- Be-Gf, contri_Qe <- Be-Gf, contri_Qf <- Ge+Bf. Finally, the partial derivative of the active power with respect to the voltage is calculated from the power contribution and the value read from the accumulated sum register and saved to partial derivative registers derivative_Pe, derivative_Pf, derivative_Ue, derivative_Uf, i.e. derivative_Pe <- -current_acc_M+contri_Pe, derivative_Pf <- -current_acc_N+contri_Pf, derivative_Ue <- -2*current_acc_M+2*contri_Qe, derivative_Uf <- -2*current_acc_N-2*contri_Qf.
[0104] The following flow will store the diagonal values into the Jacobian diagonal register dig_jacoby.
[0105] For PU nodes, the values are stored in the four cells of the dig_jacoby register with addresses [4i-3, 4i-2, 4i-1, 4i] in the order of . The following flow will store the diagonal values into the Jacobian diagonal register dig_jacoby. For PU nodes, the values are stored in the four cells of the dig_jacoby register with addresses [4i-3, 4i-2, 4i-1, 4i] in the order of
[0106] The following flow will store the diagonal values into the Jacobian diagonal register dig_jacoby.
[0107] For PU nodes, the values are stored in the four cells of the dig_jacoby register with addresses [4i-3, 4i-2, 4i-1, 4i] in the order of .
[0108] The calculated power versus voltage partial derivative values are written into the dig_jacoby register at row node number GB_row_num, i.e. dig_jacoby[4*GB_row_num-3] <- derivative_Pe, dig_jacoby[4*GB_row_num-2] <- derivative_Pf, dig_jacoby[4*GB_row_num-1] <- derivative_Ue, dig_jacoby[4*GB_row_num] <- derivative_Uf.
[0109] The following is the read-write control flow for the admittance value and Jacobian matrix element queue.
[0110] If the currently read admittance matrix row number value GB_row_num ≠ column number value GB_col_num, the following flow is executed to write the calculated partial derivatives into the queue.
[0111] The mutual admittance , and voltage and contribution values at the current admittance matrix (i,j) node are calculated, and saved into temporary registers contrib_Ge, contrib_Gf, contrib_Be, contrib_Bf, i.e. contrib_Ge <- -G(i,j), contrib_Gf <- G(i,j), contrib_Be <- -B(i,j), contrib_Bf <- B(i,j). . . . .
[0112] The active power P and reactive power Q versus voltage partial derivatives are then calculated, and saved into registers derivative_Pe, derivative_Pf, derivative_Qe, derivative_Qf, i.e. derivative_Pe <- -contri_Ge - contrib_Bf, derivative_Pf <- contrib_Be - contrib_Gf, derivative_Ue <- 0, derivative_Uf <- 0.
[0113] The partial derivative data of the write queue needs to record the column number GB_col_num of the current admittance value, and the power partial derivative and column label value are assembled and saved in the power partial derivative register derivative_Pe_data, the power partial derivative register derivative_Pf_data, the power partial derivative register derivative_Ue_data, and the power partial derivative register derivative_Uf_data of the to-be-written queue, i.e. derivative_Pe_data←{derivative_Pe,2·GB_col_num-1}, derivative_Pf_data←{derivative_Pf,2·GB_col_num}, derivative_Ue_data←{derivative_Ue, 2·GB_col_num-1}, and derivative_Uf_data←{derivative_Uf,2·GB_col_num}.
[0114] The write enable signal of the synchronous pull-up active power partial derivative queue is w_derivative_P_FIFO←1, and when the power partial derivative is not 0, the queue is written, and write_FIFO[derivative_P_FIFO,derivative_Pe_data] and write_FIFO[derivative_P_FIFO, derivative_Pf_data] are sequentially executed. Then, the write queue signal is cleared, and w_derivative_P_FIFO←0.
[0115] Step 4: When the admittance matrix data of the target node row is read, the calculation of two rows of data in the Jacobian matrix is completed, and the data in the power partial derivative queue and the voltage partial derivative queue are written into the memory (SDRAM).
[0116] As shown in Figure 3 The overall calculation of the Jacobian matrix includes two layers, and the sequence is to calculate the lower triangular part of each row element first, and then calculate the upper triangular part. When calculating the power partial derivative of node i to node j in the Jacobian matrix, when j
[0117] When the admittance matrix row number GB_row_num = 1 to n-1, read the upper triangular matrix of admittance values in turn. First start the lower triangular matrix of admittance values cycle queue lower_tri_GB_FIFO, if the column number of the read data is the lower triangular part corresponding to the row number GB_row_num, take out the data element to accumulate the amount of calculation; otherwise, the element is re-inserted into the end of the queue to wait for the column number of the subsequent row to match the calculation.
[0118] Set the current row lower triangular matrix column number current_lower_GB_col = 1, when current_lower_GB_col < GB_row_num, pull high the read enable signal R_low_tri_GB_FIFO of the lower triangular admittance value cycle queue lower_tri_GB_FIFO = 1, read the first admittance value data first_GB in the cycle queue read_FIFO[lower_tri_GB_FIFO], get the row number first_GB_row and the column number first_GB_col of the current admittance value, first_GB_row = first_GB[95:80], first_GB_col = first_GB[79:64]. Pull down the read queue signal, R_low_tri_GB_FIFO = 0. Assign the column number of the current lower triangular matrix, current_lower_GB_col = first_GB_col.
[0119] The flow is divided into the following two cases:
[0120] If the row number first_GB_row read from the lower triangular cycle queue of the admittance matrix is less than the row number GB_row_num of the current admittance matrix, and the column number first_GB_col read from the lower triangular cycle queue of the admittance matrix is equal to the row number GB_row_num of the current admittance matrix, it indicates that the lower triangular part of the Jacobian matrix of the current row satisfies the calculation condition, and the power accumulation amount calculation can be started. Specifically, assign the current value first_GB read from the lower triangular cycle queue of the admittance matrix to the conductance register And the susceptance register , = first_GB[63:32], = first_GB[31:0].
[0121] Next, take out the node voltage corresponding to the column number of the lower triangular admittance value from the voltage register voltage_ef And , that is voltage_ef[first_GB_col][63:32], voltage_ef[first_GB_col][31:0]. Then the contribution of the partial derivative of the current admittance matrix row number corresponding to the mutual admittance and and the node voltage and partial derivative is calculated, and the intermediate result is saved to , , , four registers, namely , , , Finally, the total power accumulation and is calculated, that is , .
[0122] Then, the and are stored in the accumulator registers acc_M and acc_N with the current admittance matrix row number GB_row_num as the address, that is acc_M[GB_row_num]←acc_M[GB_row_num]+ , acc_N[GB_row_num]←acc_N[GB_row_num]+ . Thus, the data of one of the lower triangular parts in the admittance matrix queue GB_FIFO is calculated, accumulated and updated.
[0123] Finally, the lower triangular loop queue read signal R_low_tri_GB_FIFO is pulled high, that is R_low_tri_GB_FIFO←1, and the admittance value in the next queue is read. At the same time, the data number register in the queue is updated, that is lower_GB_length←lower_GB_length-1.
[0124] If the column number first_GB_col read from the lower triangular circulate queue of admittance matrix is not equal to the current row number GB_row_num of admittance matrix, pull up the read signal R_low_tri_GB_FIFO of lower triangular circulate queue, continue to read the next data, and write the current read data first_GB to the end of the circulate queue, pull up the write signal W_low_tri_GB_FIFO of lower triangular circulate queue, execute write_FIFO[low_tri_GB_FIFO, first_GB], and update the data number register lower_GB_length in the queue lower_GB_length←lower_GB_length-1.
[0125] When the above-mentioned row number GB_row_num of admittance matrix searches all rows, the calculation process of the node i to the lower triangular part of other nodes is completed. Then, according to the value of the current remaining data number register lower_GB_length of the lower triangular matrix queue low_tri_GB_FIFO, the data in the queue is written circularly. When the value of the data number register lower_GB_length>0, the following steps are repeatedly executed until all the remaining data are circularly written, pull up the read signal R_low_tri_GB_FIFO of admittance matrix lower triangular circulate queue, read the first data in the queue and save it to the first_GB register, that is, first_GB←read[low_tri_GB_FIFO], pull up the write signal W_low_tri_GB_FIFO of lower triangular circulate queue, execute write_FIFO[low_tri_GB_FIFO, first_GB], and update the data number register lower_GB_length in the queue lower_GB_length←lower_GB_length-1.
[0126] After reading the admittance value from the GB_FIFO queue each time, if it is the lower triangular part of the current row data of Jacobian, the partial derivative is calculated and written into the active power partial derivative queue derivative_P_FIFO and the reactive power voltage partial derivative queue derivative_QU_FIFO.
[0127] If the column number current_lower_GB_col of the lower triangular admittance matrix of the current row is less than the row number GB_row_num of the current admittance matrix, the column number value of the partial derivative and the data number written into the queue are written into the register. The data bit length of the power partial derivative is 64 bits, the column number bit length is 32 bits, the derivative_P_FIFO register is stored according to the format of [ ], and a data unit has 24 bytes.
[0128] The counter count_row_P represents the number of data of the current row GB_row_num written into the derivative_P_FIFO, and the counter count_row_QU represents the number of data of the current row GB_row_num written into the derivative_QU_FIFO. When the data of the row is written, the counters are cleared, i.e. count_row_P<0, count_row_QU<0. The count_row_P and count_row_QU are converted into the row address of the Jacobian matrix in the SDRAM, and written into the Jacobian row address pointer register jacoby_row_ptr[31:0][2(n-1):0]. The SDRAM write head address of the Jacobian matrix is set as jacoby_head_addr, and the SDRAM write burst length is RW_burst_lengh<-(count_row_P+count_row_QU)×12.
[0129] The head address of the Jacobian matrix row address pointer register jacoby_row_ptr[31:0][2(n-1):0] is set as jacoby_head_addr, and jacoby_row_ptr[0]<-jacoby_head_addr, where n represents the number of nodes.
[0130] When the data of the i-th row is written into the derivative queue and the current_GB_row_done signal is 1, the data is split into bytes and written into the SDRAM. The writing process includes two parts, i.e. the active power data and the reactive power voltage data.
[0131] When the active power queue value and the column index value are written, the process specifically includes:
[0132] The current admittance matrix row data calculation completion signal is pulled high, i.e. current_GB_row_done<1, the read active power derivative queue data counter count_read_P is initialized, i.e. count_read_P<1, and the data split signal is pulled high, i.e. data_P_split<1.
[0133] When the value of the read active power derivative queue data counter count_read_P is less than the number of data count_row_P of the current row written into the active power derivative queue derivative_P_FIFO, the following process is repeatedly executed:
[0134] The active power derivative queue read signal is pulled high, i.e. R_derivative_P_FIFO <- 1, the active power value in the current queue is read, and saved to the register P_data, i.e. P_data <- read_FIFO[derivative_P_FIFO]. The data in the register P_data is taken out twice, and saved to the write data bus Wdata of the SDRAM, i.e. Wdata <- P_data[63:32], Wdata <- P_data[31:0]. Then the data on the write data bus Wdata is written to the jacoby_head_addr address cell in the SDRAM, i.e. write_SDRAM[jacoby_head_addr, Wdata] is executed.
[0135] Next, the data in the active power column label queue P_col_FIFO is written. The active power column label queue P_col_FIFO read signal is pulled high, i.e. R_P_col_FIFO <- 1, the active power column label value P_col_data in the current queue is taken out, i.e. P_col_data <- read_FIFO[P_col_FIFO] is executed. The active power column label value P_col_data is saved to the write data bus Wdata of the SDRAM, i.e. Wdata <- P_col_data. Then the data on the write data bus Wdata is written to the jacoby_head_addr address cell in the SDRAM, i.e. write_SDRAM[jacoby_head_addr, Wdata] is executed. The active power derivative queue data counter count_read_P that has been read currently is updated, i.e. count_read_P <- count_read_P + 1. Finally, the active power derivative queue read signal is cleared, i.e. R_derivative_P_FIFO <- 0.
[0136] Finally, the number of non-zero elements in each row of the Jacobian matrix is written, and the address offset of each row of the Jacobian matrix during the calculation of the non-zero data is recorded according to the data read from the admittance matrix queue, and the address pointer register jacoby_row_ptr of the Jacobian matrix row is written. The active power, reactive power and voltage data of the ith node are continuous in the SDRAM, and the addresses are [2i-1, 2i], respectively. A unit of data is 12 bytes. The current read admittance matrix row number is the value in the GB_row_num register, and the non-zero element storage address of the current row of the Jacobian matrix is 2·GB_row_num-1. The current row address increment count_row_P×12 is written into the jacoby_row_ptr register, and jacoby_row_ptr[2·GB_row_num-1]←jacoby_row_ptr[2·(GB_row_num-1)]+ count_row_P×12.
[0137] At this point, the data in the active power derivative queue derivative_P_FIFO and the active power column label queue P_col_FIFO have been written into the SDRAM.
[0138] When writing the reactive power queue value and the column label value, it specifically includes:
[0139] The reactive power voltage data segmentation signal is pulled high, that is, data_QU_split←1, and the reactive power voltage derivative queue data counter that has been read is initialized, that is, count_read_QU←1.
[0140] When the value of the reactive power voltage derivative queue data counter count_read_QU that has been read is ≤ the number of data count_row_QU that has been written in the reactive power voltage derivative queue derivative_QU_FIFO of the current row, the following process is repeatedly executed:
[0141] The derivative of reactive power voltage column queue read signal is pulled high, i.e. R_derivative_QU_FIFO <- 1, the reactive power voltage value in the current queue is read, and saved to the register UQ_data, i.e. QU_data <- read_FIFO[derivative_QU_FIFO]. The data in the register QU_data is taken out twice, and saved to the write data bus Wdata of the SDRAM, i.e. Wdata <- QU_data[63:32], Wdata <- QU_data[31:0]. Then the data on the write data bus Wdata is written to the jacoby_head_addr address cell in the SDRAM, i.e. write_SDRAM[jacoby_head_addr, Wdata] is executed.
[0142] Then, the data in the reactive power voltage column label queue QU_col_FIFO is written. The reactive power voltage column label queue QU_col_FIFO read signal is pulled high, i.e. R_QU_col_FIFO <- 1, the reactive power voltage column label value QU_col_data in the current queue is taken out, i.e. QU_col_data <- read_FIFO[QU_col_FIFO] is executed. The reactive power voltage column label value QU_col_data is saved to the write data bus Wdata of the SDRAM, i.e. Wdata <- QU_col_data. Then the data on the write data bus Wdata is written to the jacoby_head_addr address cell in the SDRAM, i.e. write_SDRAM[jacoby_head_addr, Wdata] is executed. The count of the reactive power voltage derivative queue data that has been read is updated, i.e. count_read_QU <- count_read_QU + 1. Finally, the reactive power voltage derivative queue read signal is cleared, i.e. R_derivative_QU_FIFO <- 0.
[0143] Finally, the number of non-zero elements in each row of the Jacobian matrix is written, and the address offset of the non-zero data of each row in the Jacobian matrix during the calculation of the Jacobian matrix is recorded according to the read current row data number count_row_QU, and is written in the Jacobian matrix row address pointer register jacoby_row_ptr. The current read admittance matrix row number is the value in the GB_row_num register, and the non-zero element storage address of the current row of the Jacobian matrix is 2·GB_row_num, and the current row address increment count_row_QU×12 is written in the jacoby_row_ptr register, and jacoby_row_ptr[2·GB_row_num]←jacoby_row_ptr[2·GB_row_num-1]+ count_row_QU×12.
[0144] At this point, the data in the reactive power voltage derivative queue derivative_QU_FIFO and the reactive power voltage column label queue QU_col_FIFO have been written into the SDRAM.
[0145] It can be found that, by redesigning the calculation process of the Jacobian matrix, the lower triangular admittance values of the target column are saved to the circular queue by using the coordinate mapping relationship between the admittance matrix and the Jacobian matrix, and the power accumulation value is dynamically updated to the diagonal line register, so that the time for searching the admittance matrix during the calculation of the Jacobian lower triangular matrix is greatly shortened, the parallel pipeline dynamic incremental calculation of the Jacobian matrix and the power imbalance is realized by designing the read-write control logic, and the calculation time and storage resource consumption of the large-scale network Jacobian matrix are reduced.
[0146] The second embodiment of the present application relates to an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the dynamic incremental calculation method of the power flow Jacobian matrix and the power imbalance when executing the computer program.
[0147] The third embodiment of the present application relates to a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the dynamic incremental calculation method of the power flow Jacobian matrix and the power imbalance when executed by a processor.
[0148] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer usable program codes.
[0149] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0150] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0151] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flowcharts and / or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0152] The above description is only specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A dynamic incremental calculation method for power flow Jacobian matrix and power imbalance, characterized in that: The following steps are involved: Calculate the power partial derivatives between the current node from_bus and the target node to_bus by row element, save the calculation results to the power partial derivative queue and the voltage partial derivative queue, and store the related lower triangular admittance value of the current node from_bus to the target node to_bus in the lower triangular circular queue of the admittance matrix, and synchronously write the power accumulation value of the target node to_bus to the power accumulation value register, where the number of the current node from_bus is less than the number of the target node to_bus; Take the first data from the lower triangular circular queue of the admittance matrix and compare whether the column number of the current data is the target node required by the current row; if it is the target node required by the current row, calculate the power partial derivative between the node pairs, write the calculation results into the power partial derivative queue and the voltage partial derivative queue first, and synchronously write the power accumulated value of the target node into the power accumulated value register; if it is not the target node required by the current row, rewrite the data from the end of the queue into the lower triangular circular queue of the admittance matrix; repeat this step until the data cycle in the lower triangular circular queue of the admittance matrix is completed; According to the reading order of the data in the admittance matrix, the Jacobian matrix data and the power imbalance are calculated; When the admittance matrix data of the target node row is read, the calculation of the two rows of data in the Jacobian matrix is completed, and the data in the power partial derivative queue and the voltage partial derivative queue are written into the memory.
2. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 1 is characterized in that: The calculation of Jacobian matrix data and power imbalance according to the reading order of data in the admittance matrix specifically includes: Determine whether the row node number i and the column node number j of the read admittance matrix data are equal; If they are not equal, calculate the power partial derivative at position (i, j) in the Jacobian matrix and store it in the power partial derivative queue and the voltage partial derivative queue; If they are equal, after reading all the data in the i-th row, the diagonal partial derivative elements and the power and voltage imbalance of the i-th node are calculated by reading the cumulative sum register, and the diagonal data is saved in the Jacobi diagonal register.
3. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 2, characterized in that: When calculating the diagonal partial derivative elements and the power and voltage imbalance of the i-th node by reading the cumulative sum register, if the node is a PQ node, the calculation process is as follows: Calculate the weighted value of the voltage contribution value to the total power based on the value read in the accumulated sum register; Calculating active power and reactive power according to the weighted value of the voltage contribution value to the total power, and calculating active power imbalance and reactive power imbalance according to the obtained active power and reactive power; Calculate the contribution of the current node's self-admittance and voltage to the partial derivative; Calculate the power contribution value based on the contribution value of the current node's self-admittance to the partial derivative; The partial derivatives of active power and reactive power with respect to voltage are calculated based on the power contribution value and the value read from the accumulated sum register.
4. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 2, characterized in that: When calculating the diagonal partial derivative elements and the power and voltage imbalance of the i-th node by reading the cumulative sum register, if the node is a PU node, the calculation process is as follows: Calculate the weighted value of the voltage contribution value to the total power based on the value read in the accumulated sum register; Calculate the active power according to the weighted value of the voltage contribution to the total power, and calculate the active power imbalance according to the obtained active power; Calculating the sum of the squares of the voltages of the current nodes, and calculating the voltage square imbalance based on the sum of the squares of the voltages of the current nodes; Calculate the contribution of the current node's self-admittance and voltage to the partial derivative; Calculate the power contribution value based on the contribution value of the current node's self-admittance to the partial derivative; The partial derivative of active power with respect to voltage is calculated based on the power contribution value and the value read from the cumulative sum register, and the partial derivative of the square of voltage with respect to voltage is calculated based on the square of the voltage of the current node.
5. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 1 is characterized in that: The calculation of two rows of data in the Jacobian matrix is completed as follows: all nodes whose column number values are less than the row number are read from the lower triangular circular queue of the admittance matrix, and the power accumulation amount is calculated. When the power accumulation amount of all nodes whose column number values are less than the row number is calculated, the data of the admittance matrix is read again to calculate the upper triangular part.
6. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 5, characterized in that: The method of reading out all nodes whose column number value is less than the row number from the lower triangular circular queue of the admittance matrix and calculating the power accumulation amount, and when the power accumulation amount of all nodes whose column number value is less than the row number is calculated, reading the data of the admittance matrix and calculating the upper triangular part specifically includes: When the row number read from the lower triangular cyclic queue of the admittance matrix is less than the row number of the current admittance matrix, and the column number read from the lower triangular cyclic queue of the admittance matrix is equal to the row number of the current admittance matrix, the current value read from the lower triangular cyclic queue of the admittance matrix is assigned to the conductance register and the admittance register, and the node voltage corresponding to the column number of the lower triangular admittance value is taken out from the voltage register; the contribution value of the mutual admittance and the node voltage corresponding to the row and column number of the current admittance matrix to the partial derivative is calculated, and the total power accumulation amount is calculated according to the contribution value; When the column number read from the lower triangular circular queue of the admittance matrix is not equal to the row number of the current admittance matrix, the read signal of the lower triangular circular queue of the admittance matrix is pulled high, the next data is continued to be read, and the currently read data is rewritten to the end of the lower triangular circular queue of the admittance matrix; when the row number of the lower triangular circular queue of the admittance matrix has searched all rows, the calculation of the lower triangular part is completed; according to the value of the current remaining data number register of the lower triangular circular queue, the data in the lower triangular circular queue is rewritten in a circular manner; when the value of the data number register is greater than zero, the following steps are repeated until all remaining data are written in a circular manner, the read signal of the lower triangular circular queue of the admittance matrix is pulled high, the first data in the queue is read out and saved to the first data register, the write signal of the lower triangular circular queue of the admittance matrix is pulled high, the value of the first data register is written to the end of the lower triangular circular queue of the admittance matrix, and the data number register in the queue is updated.
7. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 1 is characterized in that: The data in the power partial derivative queue and the voltage partial derivative queue are written into the memory, including writing the active power queue value and the column label value, specifically: Pull high the signal indicating that the current admittance matrix row data calculation is complete, initialize the counter of the active power partial derivative queue data that has been read, and pull high the data split signal; When the value of the read active power partial derivative queue data counter is less than or equal to the number of data written into the active power partial derivative queue in the current row, the following process is repeated: Pull high the active power partial derivative queue read signal, read the active power value in the current active power partial derivative queue, and save it to the register P_data, take out the data in the register P_data twice, and save it to the write data bus of the memory, and then write the data on the write data bus to the Jacobian first address cell in the memory; Pull high the active power column label queue read signal, take out the active power column label value in the current active power column label queue, save the active power column label value to the write data bus of the memory, and then write the data on the write data bus to the Jacobian first address cell in the memory; Update the active power partial derivative queue data counter currently read and clear the active power partial derivative queue reading signal.
8. The dynamic incremental calculation method for the power flow Jacobian matrix and the power imbalance according to claim 1, characterized in that: The data in the power partial derivative queue and the voltage partial derivative queue are written into the memory, including writing the reactive power queue value and the column label value, specifically: Pull up the reactive power and voltage data segmentation signal to initialize the read reactive power and voltage partial derivative queue data counter; When the value of the reactive power and voltage partial derivative queue data counter that has been read is less than or equal to the number of data that have been written to the reactive power and voltage partial derivative queue in the current row, the following process is repeated: Pull high the reactive power voltage partial derivative queue read signal, read the reactive power voltage value in the current reactive power voltage partial derivative queue, and save it to the register UQ_data, take out the data in the register UQ_data twice, and save it to the write data bus of the memory, and then write the data on the write data bus to the Jacobian first address cell in the memory; Pull up the reactive power voltage column label queue read signal, take out the reactive power voltage column label value in the current reactive power voltage column label queue, save the reactive power voltage column label value to the write data bus of the memory, and write the data on the write data bus into the Jacobian first address cell in the memory; Update the reactive power and voltage partial derivative queue data counter currently read, and clear the reactive power and voltage partial derivative queue reading signal.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the processor implements the steps of the method for dynamically increasing the calculation of the power flow Jacobian matrix and the power imbalance amount as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamically calculating the power flow Jacobian matrix and the power imbalance amount as claimed in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Apparatus, methods and systems for parallel power flow calculation and power system simulation
CA2677384A1
Method for processing sparsity of AC (alternating current) / DC (direct current) hybrid grid tide current meter
CN104485694A