CN109101464A - Based on the modified electric system sparse matrix Parallel implementation method and system of matrix - Google Patents
Based on the modified electric system sparse matrix Parallel implementation method and system of matrix Download PDFInfo
- Publication number
- CN109101464A CN109101464A CN201810772579.1A CN201810772579A CN109101464A CN 109101464 A CN109101464 A CN 109101464A CN 201810772579 A CN201810772579 A CN 201810772579A CN 109101464 A CN109101464 A CN 109101464A
- Authority
- CN
- China
- Prior art keywords
- matrix
- sparse matrix
- power transmission
- state
- transmission network
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Computational Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Supply And Distribution Of Alternating Current (AREA)
Abstract
Description
技术领域technical field
本发明实施例涉及电力系统分析计算技技术领域,更具体地,涉及一种基于矩阵修正的电力系统稀疏矩阵并行求解方法及系统。Embodiments of the present invention relate to the technical field of power system analysis and calculation technology, and more specifically, relate to a method and system for parallel solving of a sparse matrix of a power system based on matrix correction.
背景技术Background technique
在电力系统计算过程中,线性方程组的求解是一个经常遇到的问题。潮流计算与状态估计中,牛顿拉夫逊法及其各类改进算法的实现,离不开迭代过程中对修正方程(Jacobi矩阵)的求解;在暂态仿真中,描述输电网络状态的方程和描述设备运行情况的方程都属于高阶非线性方程组,对其进行求解需要进行数值积分,一般需要使用牛顿法将其差分化为相应的线性方程后迭代求解,而在此类迭代求解的过程中也需要对大型线性方程组进行求解。因此,对线性方程组的求解过程进行优化,加快其求解速度,可以有效减少各类电力系统计算的用时,提高求解的实时性。In the process of power system calculation, the solution of linear equations is a frequently encountered problem. In power flow calculation and state estimation, the realization of the Newton-Raphson method and its various improved algorithms is inseparable from the solution of the correction equation (Jacobi matrix) in the iterative process; in transient simulation, the equations and descriptions describing the state of the transmission network The equations of equipment operation are all high-order nonlinear equations, and numerical integration is required to solve them. Generally, it is necessary to use Newton’s method to differentiate them into corresponding linear equations and then iteratively solve them. In the process of such iterative solutions, Solving large systems of linear equations is also required. Therefore, optimizing the solution process of linear equations and speeding up the solution can effectively reduce the time spent on various power system calculations and improve the real-time performance of the solution.
并行计算是计算机科学中重要的研究内容,已有几十年的发展历程。用并行计算求解问题的大致过程为:对于一个给定的应用问题,首先,计算科学家将这个应用转化为一个数值或非数值的计算问题;然后计算机科学家对此计算问题设计并行算法,并通过某种并行编程语言实现它;最后应用领域的专家在某台具体的并行计算机上运行应用软件求解此问题。由此,可以很自然的发现并行计算由以下几个部分构成:并行计算机(并行计算的硬件平台),并行算法(并行计算的理论基础),并行程序设计(并行计算的软件支撑),并行应用(并行计算的发展动力)。Parallel computing is an important research content in computer science and has been developed for decades. The general process of solving problems with parallel computing is as follows: for a given application problem, first, computing scientists transform the application into a numerical or non-numerical computing problem; then computer scientists design parallel algorithms for this computing problem, and through a certain A parallel programming language to implement it; Finally, experts in the application field run application software on a specific parallel computer to solve this problem. From this, it can be naturally found that parallel computing consists of the following parts: parallel computer (hardware platform for parallel computing), parallel algorithm (theoretical basis for parallel computing), parallel programming (software support for parallel computing), parallel application (The impetus for the development of parallel computing).
采用并行求解方法可以极大的提高电力系统稀疏矩阵求解效率,但是在电力系统分析中,经常遇到网络结构或运行参数局部变化的情况,在此种情况下,如果对矩阵进行重新计算,需要重复进行LU分解、前代回代等操作,求解过程相当复杂,且求解效率低下。Using the parallel solution method can greatly improve the efficiency of solving the sparse matrix of the power system. However, in the analysis of the power system, it is often encountered that the network structure or operating parameters change locally. In this case, if the matrix is recalculated, it is necessary to Repeated operations such as LU decomposition, previous generation and back generation, the solution process is quite complicated, and the solution efficiency is low.
发明内容Contents of the invention
本发明实施例提供了一种克服上述问题或者至少部分地解决上述问题的基于矩阵修正的电力系统稀疏矩阵并行求解方法及系统。Embodiments of the present invention provide a method and system for solving the above-mentioned problems in parallel or at least partially solving the above-mentioned problems based on matrix modification.
一方面本发明实施例提供了一种基于矩阵修正的电力系统稀疏矩阵并行求解方法,所述方法包括:On the one hand, an embodiment of the present invention provides a parallel solution method for a sparse matrix of a power system based on matrix correction, the method comprising:
根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;According to the first network equation describing the state of the power transmission network and the corresponding first sparse matrix before the state of the power transmission network is changed, obtain the second network equation and the corresponding second sparse matrix describing the state of the power transmission network after the state of the power transmission network is changed;
根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。Obtaining a compensation vector according to the second network equation, and using the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix to obtain the second sparse matrix.
进一步地,所述根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵,具体包括:Further, according to the first network equation describing the state of the power transmission network and the corresponding first sparse matrix before the state of the power transmission network is changed, the second network equation and the corresponding second network equation describing the state of the power transmission network after the state of the power transmission network is changed are acquired. Sparse matrix, specifically including:
在所述输电网络状态改变后,获取变化元件对应的节点支路关联矩阵及支路导纳参数组成的对角矩阵;After the state of the power transmission network is changed, obtain a node-branch correlation matrix corresponding to the changed element and a diagonal matrix composed of branch admittance parameters;
根据所述变化元件对应的节点支路关联矩阵、所述支路导纳参数组成的对角矩阵,在所述根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵的基础上,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵。According to the node-branch correlation matrix corresponding to the change element and the diagonal matrix composed of the branch admittance parameters, the first network equation describing the state of the power transmission network and the corresponding first sparse before the change according to the state of the power transmission network On the basis of the matrix, the second network equation describing the state of the power transmission network after the state of the power transmission network changes and the corresponding second sparse matrix are obtained.
进一步地,所述根据所述第二网络方程获取补偿向量,具体包括:Further, the obtaining the compensation vector according to the second network equation specifically includes:
利用矩阵求逆辅助定理对所述第二网络方程进行变换,得到所述第二稀疏矩阵的表达式;Transforming the second network equation by using the matrix inversion auxiliary theorem to obtain the expression of the second sparse matrix;
将所述第二稀疏矩阵的表达式与所述第一稀疏矩阵的表达式进行对比分析,得到所述补偿向量。Comparing and analyzing the expression of the second sparse matrix and the expression of the first sparse matrix to obtain the compensation vector.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正,具体包括:Further, using the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix specifically includes:
利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行后补偿、前补偿或者中补偿。Using the compensation vector to perform post-compensation, pre-compensation or mid-compensation on the previous generation back-substitution process of the first sparse matrix.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行后补偿,具体包括:Further, the post-compensation of the previous generation back-substitution process of the first sparse matrix by using the compensation vector specifically includes:
在对所述第一稀疏矩阵进行前代回代计算过程结束后,利用所述补偿向量对所述第一稀疏矩阵进行矩阵修正。After the calculation process of previous generation and back generation on the first sparse matrix is completed, matrix correction is performed on the first sparse matrix by using the compensation vector.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行前补偿,具体包括:Further, using the compensation vector to perform pre-compensation on the previous generation back-substitution process of the first sparse matrix specifically includes:
在对所述第一稀疏矩阵进行前代回代计算过程中的前代计算前,利用所述补偿向量对所述第一稀疏矩阵进行矩阵修正。Before the previous generation calculation in the previous generation back generation calculation process is performed on the first sparse matrix, the compensation vector is used to perform matrix correction on the first sparse matrix.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行中补偿,具体包括:Further, the mid-compensation of the previous generation back-substitution process of the first sparse matrix by using the compensation vector specifically includes:
在对所述第一稀疏矩阵进行前代回代计算过程中的前代计算后回代计算前,利用所述补偿向量对所述第一稀疏矩阵进行矩阵修正。Before performing previous generation calculation and back generation calculation on the first sparse matrix in the previous generation back calculation process, the compensation vector is used to perform matrix correction on the first sparse matrix.
另一方面本发明实施例提供了一种基于矩阵修正的电力系统稀疏矩阵并行求解系统,所述系统包括:On the other hand, an embodiment of the present invention provides a parallel solution system for a sparse matrix of a power system based on matrix correction, and the system includes:
获取模块,用于根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;The acquiring module is configured to acquire the second network equation describing the state of the power transmission network after the state of the power transmission network changes and the corresponding second sparse matrix according to the first network equation describing the state of the power transmission network before the state of the power transmission network changes sparse matrix;
补偿模块,用于根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。The compensation module is configured to obtain a compensation vector according to the second network equation, and use the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix to obtain the second sparse matrix.
第三方面本发明实施例提供了一种基于矩阵修正的电力系统稀疏矩阵并行求解设备,包括:In the third aspect, the embodiment of the present invention provides a parallel solution device for sparse matrix of power system based on matrix correction, including:
至少一个处理器;以及at least one processor; and
与所述处理器通信连接的至少一个存储器,其中:at least one memory communicatively coupled to the processor, wherein:
所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行上述方法。The memory stores program instructions that can be executed by the processor, and the processor can execute the above method by calling the program instructions.
第四方面本发明实施例提供了一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述方法。In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the above method.
本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解方法及系统,所述方法包括:根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。通过利用已有信息计算出电力系统网络结构变化后的结果,减少了计算量,极大的提高了求解效率。An embodiment of the present invention provides a parallel solution method and system for a sparse matrix of a power system based on matrix correction. The method includes: according to the first network equation describing the state of the power transmission network before the state of the power transmission network changes and the corresponding first sparse matrix, Obtain the second network equation describing the state of the transmission network and the corresponding second sparse matrix after the state of the transmission network is changed; obtain a compensation vector according to the second network equation, and use the compensation vector to the first sparse matrix The previous generation back-substitution process performs matrix correction to obtain the second sparse matrix. By using the existing information to calculate the result of the change of the power system network structure, the calculation amount is reduced and the solution efficiency is greatly improved.
附图说明Description of drawings
图1为本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解方法的流程图;Fig. 1 is a flow chart of a parallel solution method for a sparse matrix of a power system based on matrix correction provided by an embodiment of the present invention;
图2为本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解系统的结构框图;Fig. 2 is a structural block diagram of a power system sparse matrix parallel solution system based on matrix correction provided by an embodiment of the present invention;
图3为本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解设备的结构示意图。Fig. 3 is a schematic structural diagram of a parallel solving device for a sparse matrix of a power system based on matrix correction provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are the Some, but not all, embodiments are invented. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
图1为本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解方法的流程图,如图1所示,所述方法包括:Fig. 1 is a flow chart of a parallel solution method for a sparse matrix of a power system based on matrix correction provided by an embodiment of the present invention. As shown in Fig. 1, the method includes:
S1,根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;S1. According to the first network equation describing the state of the power transmission network and the corresponding first sparse matrix before the state of the power transmission network is changed, obtain the second network equation and the corresponding second sparse matrix describing the state of the power transmission network after the state of the power transmission network is changed;
S2,根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。S2. Obtain a compensation vector according to the second network equation, and use the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix to obtain the second sparse matrix.
在上述实施例中,所述根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵,具体包括:In the above embodiment, according to the first network equation describing the state of the power transmission network and the corresponding first sparse matrix before the state of the power transmission network changes, the second network equation describing the state of the power transmission network after the state of the power transmission network changes and the corresponding The second sparse matrix, specifically includes:
在所述输电网络状态改变后,获取变化元件对应的节点支路关联矩阵及支路导纳参数组成的对角矩阵;After the state of the power transmission network is changed, obtain a node-branch correlation matrix corresponding to the changed element and a diagonal matrix composed of branch admittance parameters;
根据所述变化元件对应的节点支路关联矩阵、所述支路导纳参数组成的对角矩阵,在所述根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵的基础上,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵。According to the node-branch correlation matrix corresponding to the change element and the diagonal matrix composed of the branch admittance parameters, the first network equation describing the state of the power transmission network and the corresponding first sparse before the change according to the state of the power transmission network On the basis of the matrix, the second network equation describing the state of the power transmission network after the state of the power transmission network changes and the corresponding second sparse matrix are obtained.
在上述实施例中,所述根据所述第二网络方程获取补偿向量,具体包括:In the above embodiment, the obtaining the compensation vector according to the second network equation specifically includes:
利用矩阵求逆辅助定理对所述第二网络方程进行变换,得到所述第二稀疏矩阵的表达式;Transforming the second network equation by using the matrix inversion auxiliary theorem to obtain the expression of the second sparse matrix;
将所述第二稀疏矩阵的表达式与所述第一稀疏矩阵的表达式进行对比分析,得到所述补偿向量。Comparing and analyzing the expression of the second sparse matrix and the expression of the first sparse matrix to obtain the compensation vector.
具体地,对于网络方程Specifically, for the network equation
其中,Y为系统的节点导纳矩阵,为节点注入电流向量,为节点电压向量。当网络结构或参数发生微小变化而注入电流不变时,新网络方程变为:where Y is the node admittance matrix of the system, Inject current vectors for nodes, is the node voltage vector. When the network structure or parameters change slightly while the injected current remains unchanged, the new network equation becomes:
其中,ΔY表示系统的节点导纳矩阵的改变量,为对应的节点电压。在式(2)中,ΔY的产生在电力网络分析中一般是由于元件的增加、移除或参数变化引起的,可以通过节点支路关联矩阵描述为:Among them, ΔY represents the change of the nodal admittance matrix of the system, is the corresponding node voltage. In formula (2), the generation of ΔY is generally caused by the addition, removal or parameter changes of components in power network analysis, which can be described by the node-branch correlation matrix as:
其中,δy为m阶方阵,通常是由支路导纳参数组成的对角矩阵,M为n×m阶稀疏矩阵,表示与变化元件对应的节点支路关联矩阵。Among them, δy is a square matrix of order m, which is usually a diagonal matrix composed of branch admittance parameters, and M is a sparse matrix of order n×m, which represents the node-branch correlation matrix corresponding to the variable element.
利用矩阵求逆辅助定理,式(3)可化为:Using the matrix inversion auxiliary theorem, formula (3) can be reduced to:
其中:in:
c=(δy-1+MTY-1M)-1 (5)c=(δy -1 + M T Y -1 M) -1 (5)
其中,矩阵求逆辅助定理也称为Householder公式,它给出了矩阵局部发生变化时,新的矩阵逆的计算公式。Among them, the matrix inversion auxiliary theorem is also called the Householder formula, which gives the calculation formula of the new matrix inverse when the matrix changes locally.
对于n阶非奇异矩阵A,当其发生变化For n-order non-singular matrix A, when it changes
式(6)中,为变化后的矩阵,M、N为n×m阶矩阵,a为m阶非奇异矩阵,m≤n,有:In formula (6), is the changed matrix, M and N are n×m order matrices, a is m order non-singular matrix, m≤n, there are:
其条件是:(a-1+NTA-1M)可逆。如果原矩阵A的逆A-1已知,则可依据式(7)在A-1的基础上求出变化后矩阵的逆。The condition is: (a -1 + N T A -1 M) is reversible. If the inverse A -1 of the original matrix A is known, the changed matrix can be calculated on the basis of A -1 according to formula (7) inverse of.
在上述实施例中,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正,具体包括:In the above embodiment, the use of the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix specifically includes:
利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行后补偿、前补偿或者中补偿。Using the compensation vector to perform post-compensation, pre-compensation or mid-compensation on the previous generation back-substitution process of the first sparse matrix.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行后补偿,具体包括:Further, the post-compensation of the previous generation back-substitution process of the first sparse matrix by using the compensation vector specifically includes:
在对所述第一稀疏矩阵进行前代回代计算过程结束后,利用所述补偿向量对所述第一稀疏矩阵进行矩阵修正。After the calculation process of previous generation and back generation on the first sparse matrix is completed, matrix correction is performed on the first sparse matrix by using the compensation vector.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行前补偿,具体包括:Further, using the compensation vector to perform pre-compensation on the previous generation back-substitution process of the first sparse matrix specifically includes:
在对所述第一稀疏矩阵进行前代回代计算过程中的前代计算前,利用所述补偿向量对所述第一稀疏矩阵进行矩阵修正。Before the previous generation calculation in the previous generation back generation calculation process is performed on the first sparse matrix, the compensation vector is used to perform matrix correction on the first sparse matrix.
进一步地,所述利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行中补偿,具体包括:Further, the mid-compensation of the previous generation back-substitution process of the first sparse matrix by using the compensation vector specifically includes:
在对所述第一稀疏矩阵进行前代回代计算过程中的前代计算后回代计算前,利用所述补偿向量对所述第一稀疏矩阵进行矩阵修正。Before performing previous generation calculation and back generation calculation on the first sparse matrix in the previous generation back calculation process, the compensation vector is used to perform matrix correction on the first sparse matrix.
具体地,为了实现对矩阵的补偿计算,依据计算补偿量的先后顺序,有以下几种模式。Specifically, in order to realize the compensation calculation of the matrix, there are the following modes according to the order of calculating the compensation amount.
1、后补偿1. Post-compensation
后补偿先计算原矩阵的解再计算对解向量的补偿量计算模式如下After compensation, first calculate the solution of the original matrix Then calculate the compensation amount for the solution vector The calculation mode is as follows
2、前补偿2. Pre-compensation
前补偿首先计算对右手项的补偿量然后使用补偿后的右手项求解矩阵,计算模式为Precompensation first computes the compensation for the right-hand term Then use the compensated right-hand term To solve the matrix, the calculation mode is
3、中补偿3. Medium compensation
中补偿的补偿过程位于前代和回代之间。The compensation process of mid-compensation is between the previous generation and the back generation.
对于已经完成LU分解的矩阵Y,设有For the matrix Y that has completed the LU decomposition, set
Y=LU (10)Y=LU (10)
式(10)中为L下三角矩阵,U为单位上三角矩阵。In formula (10), L is the lower triangular matrix, and U is the unit upper triangular matrix.
则中补偿的计算模式为:Then the calculation mode of the compensation is:
其中,为前代得到的解向量,为对的补偿量,为补偿后的前代解向量。in, is the solution vector obtained by the previous generation, for right the amount of compensation, is the solution vector of the previous generation after compensation.
在上述实施例中,算法的具体实现过程如下:In the above embodiment, the specific implementation process of the algorithm is as follows:
1、修正算法的计算代价分析1. Calculation cost analysis of the modified algorithm
三种补偿方式首先都需要对整个矩阵进行一次完整的前代回代求解,不同的仅是求解过程中补偿应用的时机。The three compensation methods all need to perform a complete previous-generation back-substitution solution for the entire matrix, and the only difference is the timing of compensation application during the solution process.
对于后补偿,求解补偿向量需要计算Y-1M,即以M为右手项,以Y为系数进行一次前代回代求解。其中前代过程是对稀疏向量M进行的,而回代则需要对前代生成的稠密向量进行。For the post-compensation, the calculation of the compensation vector needs to calculate Y -1 M, that is, take M as the right-hand item and Y as the coefficient to perform a forward-backward solution. Among them, the previous generation process is performed on the sparse vector M, while the back generation needs to be performed on the dense vector generated by the previous generation.
对于前补偿,求解补偿向量需要计算MTY-1,即以M为右手项,以YT为系数进行一次前代回代求解。求解过程的稀疏性与后补偿相似,但是在Y不对称时,需要对YT的数据依赖结构进行进一步的分析。For the front compensation, the calculation of the compensation vector needs to be calculated M T Y -1 , that is, M is the right-hand term, and Y T is the coefficient to perform a previous generation and back generation solution. The sparsity of the solution process is similar to postcompensation, but further analysis of the data-dependent structure of Y T is required when Y is asymmetric.
对于中补偿,求解补偿向量需要计算L-1M和MTU-1,即以M为右手项,以Y为系数进行一次前代求解;以M为右手项,以YT为系数进行一次回代求解。对于中补偿,其两次求解均为稀疏向量前代回代,因此计算量最小。当Y为对称矩阵时,还可以进一步通过LDL分解省略一次稀疏前代过程。For the medium compensation, the calculation of the compensation vector needs to calculate L -1 M and M T U -1 , that is, take M as the right-hand term and use Y as the coefficient to perform a previous generation solution; use M as the right-hand term and Y T as the coefficient to perform a calculation Back to solve. For the medium compensation, the two solutions are sparse vector previous generation and back generation, so the calculation amount is minimal. When Y is a symmetric matrix, the sparse previous generation process can be further omitted by LDL decomposition.
2、稀疏向量前代回代算法2. Sparse vector front-generation back-substitution algorithm
对稀疏向量的前代,其结果一般是一个稠密的向量。因此,在求解的过程中,只需要对稀疏的右手项进行稀疏存储,而解向量可以直接按照稠密的方式顺次存储。For previous generations of sparse vectors, the result is generally a dense vector. Therefore, in the process of solving, only the sparse right-hand item needs to be stored sparsely, and the solution vector can be directly stored sequentially in a dense manner.
2.1、稀疏向量的存储2.1. Storage of sparse vectors
对于稀疏向量的存储,可以简单的使用两个数组进行,其中idx存储非零元的位置,val存储对应非零元的数值,除此之外,还应该有一个变量nnz,用于保存非零元的数目。为了便对其中的非零元进行查找,一般进行规格化处理,即将idx中储存地索引按照严格升序排列。For the storage of sparse vectors, you can simply use two arrays, where idx stores the position of the non-zero element, and val stores the value corresponding to the non-zero element. In addition, there should be a variable nnz to store the non-zero the number of dollars. In order to find the non-zero elements in it, normalization processing is generally performed, that is, the indexes stored in idx are arranged in strict ascending order.
2.2不使用DAG的稀疏向量前代回代2.2 Sparse vector previous generation and back generation without using DAG
当需要计算的次数较少时,可以省略DAG分析,直接进行求解。此时,不仅可以按行为单位求解,也可以按列进行求解。以行为单位,不使用DAG的求解方式,只需在求解的过程中跳过其中的非零元。When the number of calculations required is small, the DAG analysis can be omitted and the solution can be performed directly. At this time, not only can solve by row unit, but also can solve by column. In units of rows, without using the DAG solution method, it is only necessary to skip the non-zero elements in the solution process.
要使用列优先的方式进行求解,首先应当将系数矩阵以列优先的方式进行存储,即使用CSC格式。其实现方式与CSR类似,只是在排列非零元素时,按照列优先的顺序进行,存储的索引改为colPtr和rowIdx。特别地,对于一个矩阵的转置,相当于把它的CSR存储当作CSC存储,而不需要重新计算。To use the column-priority method to solve, the coefficient matrix should be stored in the column-priority manner first, that is, use the CSC format. Its implementation is similar to CSR, except that when arranging non-zero elements, it is performed in column-first order, and the stored index is changed to colPtr and rowIdx. In particular, the transpose of a matrix is equivalent to treating its CSR storage as CSC storage without recomputation.
2.3、使用DAG的稀疏向量前代回代2.3. Using DAG's sparse vector previous generation and back generation
当不使用DAG分析时,对稀疏矢量的迭代从第一个非零元开始,但由于无法判断之后非零元的注入情况,此后必须对每一行进行迭代,其平均计算开销与完整前代回代相当。When DAG analysis is not used, the iteration of the sparse vector starts from the first non-zero element, but because it is impossible to judge the injection of non-zero elements after that, each row must be iterated after that, and the average calculation cost is the same as that of the complete previous iteration. generation quite.
在已经对矩阵结构进行了分析的情况下,可以依据矩阵的结构和右手项非零元的位置,分析需要进行求解的节点。In the case that the matrix structure has been analyzed, the nodes that need to be solved can be analyzed according to the structure of the matrix and the position of the non-zero element of the right-hand item.
对于一个节点i,其需要进行求解,当且仅当其存在至少一个需要求解的父节点。我们可以通过深度优先搜索的方法,从右手项非零元节点出发,确定需要进行求解的节点。For a node i, it needs to be solved if and only if it has at least one parent node that needs to be solved. We can use the depth-first search method to determine the node to be solved from the non-zero node of the right-hand item.
本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解方法,包括:根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。通过利用已有信息计算出电力系统网络结构变化后的结果,减少了计算量,极大的提高了求解效率。An embodiment of the present invention provides a parallel solution method for a sparse matrix of a power system based on matrix correction, including: obtaining the transmission network according to the first network equation describing the state of the transmission network before the state of the transmission network changes and the corresponding first sparse matrix After the state is changed, describe the second network equation and the corresponding second sparse matrix of the state of the power transmission network; obtain the compensation vector according to the second network equation, and use the compensation vector to replace the previous generation of the first sparse matrix performing matrix correction to obtain the second sparse matrix. By using the existing information to calculate the result of the change of the power system network structure, the calculation amount is reduced and the solution efficiency is greatly improved.
图2为本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解系统,所述系统包括:获取模块201及补偿模块202。其中:FIG. 2 is a matrix correction-based power system sparse matrix parallel solution system provided by an embodiment of the present invention. The system includes: an acquisition module 201 and a compensation module 202 . in:
获取模块201用于根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵。补偿模块202用于根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。The acquiring module 201 is used to acquire the second network equation describing the state of the power transmission network after the change of the state of the power transmission network and the corresponding second sparse matrix according to the first network equation describing the state of the power transmission network and the corresponding first sparse matrix sparse matrix. The compensation module 202 is configured to obtain a compensation vector according to the second network equation, and use the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix to obtain the second sparse matrix.
具体地,本发明实施例中的基于矩阵修正的电力系统稀疏矩阵并行求解系统中各模块的作用及操作流程与上述方法类实施例是一一对应的,在此不再赘述。Specifically, the function and operation process of each module in the matrix correction-based power system sparse matrix parallel solution system in the embodiment of the present invention is in one-to-one correspondence with the above-mentioned method embodiments, and will not be repeated here.
本发明实施例提供的一种基于矩阵修正的电力系统稀疏矩阵并行求解系统,包括:获取模块及补偿模块,获取模块用于根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;补偿模块用于根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。通过利用已有信息计算出电力系统网络结构变化后的结果,减少了计算量,极大的提高了求解效率。An embodiment of the present invention provides a parallel solution system for sparse matrix of a power system based on matrix correction, including: an acquisition module and a compensation module, the acquisition module is used to describe the first network equation and the corresponding state of the transmission network before the state of the transmission network changes The first sparse matrix is used to obtain the second network equation describing the state of the transmission network and the corresponding second sparse matrix after the state of the transmission network is changed; the compensation module is used to obtain a compensation vector according to the second network equation, and use the compensation Vector performs matrix correction on the previous generation and back substitution process of the first sparse matrix to obtain the second sparse matrix. By using the existing information to calculate the result of the change of the power system network structure, the calculation amount is reduced and the solution efficiency is greatly improved.
如图3所示,在上述实施例的基础上,本发明实施例还提供了一种基于矩阵修正的电力系统稀疏矩阵并行求解设备,包括:至少一个处理器301、至少一个存储器302、通信接口303和总线304;其中,所述处理器301、存储器302、通信接口303通过所述总线304完成相互间的通信;所述通信接口303用于该建模设备与显示装置的通信设备之间的信息传输;所述存储器302存储有可被所述处理器301执行的程序指令,所述处理器301调用所述程序指令能够执行如图1所述的方法。As shown in Figure 3, on the basis of the above-mentioned embodiments, the embodiment of the present invention also provides a parallel solution device for sparse matrix of power system based on matrix correction, including: at least one processor 301, at least one memory 302, communication interface 303 and bus 304; wherein, the processor 301, memory 302, and communication interface 303 complete mutual communication through the bus 304; the communication interface 303 is used for communication between the modeling equipment and the communication equipment of the display device Information transmission: the memory 302 stores program instructions executable by the processor 301, and the processor 301 invokes the program instructions to execute the method as described in FIG. 1 .
上述的存储器302中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The above logic instructions in the memory 302 may be implemented in the form of software functional units and when sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .
本发明实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:根据输电网络状态改变前描述输电网络状态的第一网络方程及对应的第一稀疏矩阵,获取所述输电网络状态改变后描述输电网络状态的第二网络方程及对应的第二稀疏矩阵;根据所述第二网络方程获取补偿向量,并利用所述补偿向量对所述第一稀疏矩阵的前代回代过程进行矩阵修正以求解得到所述第二稀疏矩阵。An embodiment of the present invention provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods provided in the above method embodiments, for example The method includes: according to the first network equation describing the state of the transmission network and the corresponding first sparse matrix before the state of the transmission network is changed, obtaining the second network equation and the corresponding second sparse matrix describing the state of the transmission network after the state of the transmission network is changed; Obtaining a compensation vector according to the second network equation, and using the compensation vector to perform matrix correction on the previous generation back-substitution process of the first sparse matrix to obtain the second sparse matrix.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810772579.1A CN109101464A (en) | 2018-07-13 | 2018-07-13 | Based on the modified electric system sparse matrix Parallel implementation method and system of matrix |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810772579.1A CN109101464A (en) | 2018-07-13 | 2018-07-13 | Based on the modified electric system sparse matrix Parallel implementation method and system of matrix |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN109101464A true CN109101464A (en) | 2018-12-28 |
Family
ID=64846468
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810772579.1A Pending CN109101464A (en) | 2018-07-13 | 2018-07-13 | Based on the modified electric system sparse matrix Parallel implementation method and system of matrix |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109101464A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110991034A (en) * | 2019-11-29 | 2020-04-10 | 浙江大学 | Electric power system transient stability simulation parallel computing method based on full-parallel nested diagonal edge-adding form |
| CN112231630A (en) * | 2020-10-26 | 2021-01-15 | 国家超级计算无锡中心 | Sparse matrix solving method based on FPGA parallel acceleration |
| CN114004186A (en) * | 2021-10-26 | 2022-02-01 | 清华大学 | Spectrogram sparsification-based on-chip ultra-large-scale power supply network parallel simulation method |
| GB2634538A (en) * | 2023-10-12 | 2025-04-16 | Mercedes Benz Group Ag | A method for correcting a matrix, computer program code, and a storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2002100008A1 (en) * | 2001-06-01 | 2002-12-12 | The Board Of Trustees Of The Leland Stanford Junior University | Dynamic digital communication system control |
| CN101799798A (en) * | 2009-12-25 | 2010-08-11 | 上海申瑞电力科技股份有限公司 | Admittance matrix correction computation method of branch breaking current |
| CN104091092A (en) * | 2014-07-29 | 2014-10-08 | 上海交通大学 | Feature value analysis system for small-interference stability of large-scale power system |
| CN107658880A (en) * | 2017-11-16 | 2018-02-02 | 大连海事大学 | Calculation Method of Coefficient Matrix of Fast Decomposition Method Based on Incidence Matrix Operation |
-
2018
- 2018-07-13 CN CN201810772579.1A patent/CN109101464A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2002100008A1 (en) * | 2001-06-01 | 2002-12-12 | The Board Of Trustees Of The Leland Stanford Junior University | Dynamic digital communication system control |
| CN101799798A (en) * | 2009-12-25 | 2010-08-11 | 上海申瑞电力科技股份有限公司 | Admittance matrix correction computation method of branch breaking current |
| CN104091092A (en) * | 2014-07-29 | 2014-10-08 | 上海交通大学 | Feature value analysis system for small-interference stability of large-scale power system |
| CN107658880A (en) * | 2017-11-16 | 2018-02-02 | 大连海事大学 | Calculation Method of Coefficient Matrix of Fast Decomposition Method Based on Incidence Matrix Operation |
Non-Patent Citations (2)
| Title |
|---|
| 张伯明 等: "《高等电力网络分析》", 30 September 1996, 清华大学出版社 * |
| 陈志光 等: "基于稀疏矩阵变换的电网故障电流快速算法", 《广东电力》 * |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110991034A (en) * | 2019-11-29 | 2020-04-10 | 浙江大学 | Electric power system transient stability simulation parallel computing method based on full-parallel nested diagonal edge-adding form |
| CN110991034B (en) * | 2019-11-29 | 2022-03-22 | 浙江大学 | Electric power system transient stability simulation parallel computing method based on full parallel nested BBDF |
| CN112231630A (en) * | 2020-10-26 | 2021-01-15 | 国家超级计算无锡中心 | Sparse matrix solving method based on FPGA parallel acceleration |
| CN112231630B (en) * | 2020-10-26 | 2024-02-02 | 国家超级计算无锡中心 | Sparse matrix solving method based on FPGA parallel acceleration |
| CN114004186A (en) * | 2021-10-26 | 2022-02-01 | 清华大学 | Spectrogram sparsification-based on-chip ultra-large-scale power supply network parallel simulation method |
| GB2634538A (en) * | 2023-10-12 | 2025-04-16 | Mercedes Benz Group Ag | A method for correcting a matrix, computer program code, and a storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Ballani et al. | A projection method to solve linear systems in tensor format | |
| Hackbusch et al. | Use of tensor formats in elliptic eigenvalue problems | |
| Gander et al. | Paradiag: Parallel-in-time algorithms based on the diagonalization technique | |
| CN109101464A (en) | Based on the modified electric system sparse matrix Parallel implementation method and system of matrix | |
| Oxberry et al. | Limited‐memory adaptive snapshot selection for proper orthogonal decomposition | |
| Liang et al. | Fourth order exponential time differencing method with local discontinuous Galerkin approximation for coupled nonlinear Schrödinger equations | |
| CN112131515A (en) | Method and computer readable medium for converting higher order polynomials into second order polynomials | |
| Pižorn et al. | Fermionic implementation of projected entangled pair states algorithm | |
| Liao et al. | Discrete gradient structure of a second-order variable-step method for nonlinear integro-differential models | |
| Dupont et al. | Back and forth error compensation and correction methods for semi-Lagrangian schemes with application to level set interface computations | |
| Günther et al. | Recursive approach to determine correlation functions in multibaryon systems | |
| Ali et al. | Index-aware model order reduction for differential-algebraic equations | |
| Wang et al. | Mittag–Leffler stability of numerical solutions to time fractional ODEs | |
| Nobile et al. | Non-intrusive double-greedy parametric model reduction by interpolation of frequency-domain rational surrogates | |
| Gu et al. | Efficient energy-preserving exponential integrators for multi-component Hamiltonian systems | |
| CN115798648A (en) | Nonlinear system model order reduction method for material nonlinearity | |
| Welper | $ h $ and $ hp $-adaptive Interpolation by Transformed Snapshots for Parametric and Stochastic Hyperbolic PDEs | |
| Li et al. | Non‐linear model‐order reduction based on tensor decomposition and matrix product | |
| Yang et al. | Blowup of Volterra integro-differential equations and applications to semi-linear Volterra diffusion equations | |
| Zhao et al. | A generalized product-type BiCOR method and its application in signal deconvolution | |
| Ernst et al. | A Legendre-based computational method for solving a class of Itô stochastic delay differential equations | |
| Negrello et al. | A new impedance accounting for short‐and long‐range effects in mixed substructured formulations of nonlinear problems | |
| Liao et al. | Modified newton integration algorithm with noise tolerance for image deblurring | |
| Ding et al. | Waveform relaxation methods for fractional functional differential equations | |
| Meister et al. | Central schemes and systems of balance laws |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181228 |
|
| RJ01 | Rejection of invention patent application after publication |