A method for calculating equivalent resistance based on many-to-many mode

By constructing a sparse matrix F and performing pre-sorting and LDLT decomposition, the bottleneck of equivalent resistance calculation performance in large-scale resistive networks is solved, and efficient equivalent resistance analysis is achieved.

CN117688286BActive Publication Date: 2026-02-24SHENZHEN HUADA EMPYREAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311700536.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-12
Publication Date
2026-02-24
Estimated Expiration
2043-12-12

AI Technical Summary

Technical Problem

In circuit simulation and data mining, the massive scale of resistor networks leads to a bottleneck in the performance of equivalent resistance calculation, and existing technologies struggle to efficiently and accurately analyze the equivalent resistance of a large number of node pairs.

Method used

A method for calculating equivalent resistance using a many-to-many model is adopted. By constructing a sparse matrix F, performing pre-sorting and LDLT decomposition, only the non-zero element positions related to the equivalent resistance are calculated, thus reducing the computational load.

Benefits of technology

It effectively reduces the amount of computation, improves computational efficiency, and significantly reduces computation time, especially showing a significant acceleration effect in large-scale resistive networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117688286B_ABST
    Figure CN117688286B_ABST
Patent Text Reader

Abstract

The application discloses a method for calculating equivalent resistance based on a many-to-many mode, which comprises: filling a conductance matrix of a corresponding resistance network to obtain an extended matrix based on a node to be solved of an equivalent resistance, preordering the extended matrix to determine a permutation matrix P; performing LDL T decomposition on the extended matrix to calculate a lower triangular matrix L and a diagonal matrix D required for calculating the equivalent resistance and determining a non-zero element position in a sparse matrix F; calculating a matrix element of a target matrix Z according to the non-zero element position in the sparse matrix F and the lower triangular matrix L and the diagonal matrix D; and calculating the equivalent resistance according to the target matrix Z. For this purpose, the application does not need to solve all matrix elements, but only needs to calculate matrix elements consistent with the non-zero element position distribution of F, i.e. Z, so as to effectively reduce the calculation amount. Since Z is a sparse matrix and a general dense matrix, the total calculation amount is greatly reduced due to the fewer non-zero elements of Z.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This patent application belongs to the field of circuit design technology, and in particular relates to a method for calculating equivalent resistance based on many-to-many mode. Background Technology

[0002] With the continuous development of chip manufacturing processes, circuit simulation requires the extraction and analysis of parasitic parameters in large-scale integrated circuit layouts, which involves the calculation of equivalent resistance. Furthermore, since equivalent resistance measures the similarity between two fixed points in a circuit layout, it is also widely used in graph sparsification in data mining. However, due to the massive scale of the resistor networks processed in circuit simulation and data mining, accurate analysis of the equivalent resistance of a huge number of node pairs becomes a bottleneck in computational performance. Summary of the Invention

[0003] This patent application provides a method for calculating equivalent resistance based on many-to-many modes, in order to overcome or alleviate the deficiencies of the prior art.

[0004] The technical solutions provided in this application are as follows:

[0005] A method for calculating equivalent resistance based on many-to-many modes, comprising:

[0006] Based on the nodes to be solved using equivalent resistance, the admittance matrix of the corresponding resistive network is... The augmented matrix is ​​obtained by filling in the blanks.

[0007] For the extended matrix Perform a pre-sorting to determine the permutation matrix P;

[0008] For the extended matrix Perform LDL T Decompose the matrix to calculate the equivalent resistance using the lower triangular matrix L and the diagonal matrix D, and determine the positions of the non-zero elements in the sparse matrix F.

[0009] The matrix elements of the target matrix Z are calculated based on the positions of the non-zero elements in the sparse matrix F and the lower triangular matrix L and the diagonal matrix D.

[0010] The equivalent resistance is calculated based on the target matrix Z. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the method for calculating equivalent resistance based on many-to-many mode in the embodiments of this application. Detailed Implementation

[0012] The technical solutions of the embodiments of this patent application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this patent application, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this patent application are within the scope of protection of this patent application.

[0013] The terms "first," "second," etc., used in the specification and claims of this patent application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this patent application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0014] The technical solutions provided in this application include, but are not limited to, those applicable to many-to-many mode for calculating equivalent resistance. Many-to-many refers to calculating the equivalent resistance between any two arbitrarily selected nodes in a resistor network.

[0015] In the embodiments described below, the external power supply method is used to calculate the equivalent resistance between any two nodes in the resistor network in the many-to-many mode described above.

[0016] In the above external power supply method, the independent power supply in the original circuit is set to zero and the capacitor is disconnected. Furthermore, in order to solve for the resistance between any pair of nodes (i,j), a 1A independent current source needs to be connected externally between the pair of nodes (i,j). Then the voltage drop V between the pair of nodes (i,j) is... ij That is, the equivalent resistance R between node i and node j ij .

[0017] Furthermore, using the Modified Nodal Analysis (MNA) method commonly used in circuit analysis, the admittance matrix G of the circuit is obtained. This admittance matrix G is usually non-full rank. To perform matrix inversion, a row and its corresponding column need to be deleted from G. In practical applications, the column and row corresponding to the grounding point are usually deleted to obtain a full-rank matrix. Therefore, the system of equations corresponding to this resistor network is as follows: Where V is the node voltage vector to be determined. Let I be the admittance matrix of the resistive network (matrix dimension n, excluding ground nodes), and let I be the vector of external independent current sources (vector dimension n, excluding ground nodes). The elements in the vector I containing the external independent current source can be determined by the MNA filling rules. Furthermore, since there is an external 1A independent current source, the currents at nodes i and j are Ii and Ij, respectively. i =1A and I j = -1A. If expressed using a standard unit vector, the vector of an external independent current source can be written as I = (e^(-1A)). i -e j ), where e i and e j Both are standard unit vectors, e i and e j The i-th and j-th elements are 1, and the rest are 0. The node voltage vector can be represented as V = i and j are less than or equal to the total number of nodes n in the circuit (excluding grounding points), and they are not equal to each other.

[0018] In summary, the equivalent resistance R between node pairs (i,j) is... ij It can be represented as

[0019]

[0020] Solve linear equations Therefore, the direct method is generally used to obtain the node voltage vector V to be determined. Since... It has the characteristic of being sparse and in order to Perform LDL T The resulting matrix after decomposition should be as sparse as possible. In the direct method, the matrix is ​​first... Perform pre-sorting, and you will get The permutation matrix P is obtained, which is determined using a given sorting algorithm (such as the AMD algorithm), primarily to reduce matrix element padding during subsequent decomposition. Then, the sorted matrix... LDL of matrices T Decomposition, where L is a lower triangular matrix with 1s on the diagonal, DL T It is an upper triangular matrix. Substitute back into each matrix to solve the system of linear equations P. -T LX = (e i -e j ) and DL T F -1 V = X. The solution V is the original equation. The solution.

[0021] In scenarios where equivalent resistance is solved based on a many-to-many model, the decomposition process is generally performed only once, but it involves a large number of back-substitution solutions, which causes a performance bottleneck in the algorithm implementation.

[0022] Therefore, in order to calculate the equivalent resistance based on the aforementioned many-to-many mode, a feasible approach needs to start from... Export but They are usually dense, which makes the computation too costly.

[0023] In the process of developing this application, the inventors discovered that calculating the equivalent resistance between two nodes does not actually require calculating the entire resistance. Elements related to calculating equivalent resistance The sparseness of the sparseness is often sufficient; therefore, the following scheme proposed in this application only requires the use of... The elements relevant to calculating the equivalent resistance are sufficient. Therefore, the core idea of ​​this application is to construct a sparse matrix F for the nodes whose equivalent resistance needs to be solved, and to calculate the equivalent resistance based on this matrix. The non-zero elements of this sparse matrix F are related to... The elements related to the calculation of the corresponding equivalent resistance are located in the same positions. Please refer to the following description for detailed technical solutions.

[0024] Figure 1 This is a schematic diagram of the method for calculating equivalent resistance based on many-to-many modes in an embodiment of this application. Figure 1 As shown, it includes the following steps:

[0025] S101. Based on the nodes to be solved using equivalent resistance, the admittance matrix of the corresponding resistive network. The augmented matrix is ​​obtained by filling in the blanks.

[0026] Due to the admittance matrix From the resistor network, therefore It is sparsely symmetrical. It is stored according to the compressed storage structure of sparse matrices, that is, only stores The rows, columns, and corresponding matrix element values ​​of the non-zero elements in F. Therefore, in this embodiment, during step S101, to obtain the positions of the non-zero elements of F, based on the nodes to be solved using the equivalent resistance, in... Simply add a specified position and fill it with 0 elements in the sparse compressed storage structure.

[0027] For example, in a specific scenario, if the equivalent resistance of the node pair (i,j) to be solved is determined, then in the admittance matrix... In the compressed storage structure, the two elements in the i-th row and j-th column and the j-th row and i-th column are filled in the following way: if at this position or That's not right. If necessary, perform the necessary processing; otherwise, based on this, add two additional padding positions (i,j) and (j,i) to the compressed storage structure, and set the values ​​of these two padding positions to zero. That is, for these two padding positions (i,j) and (j,i), If the equivalent resistance of multiple node pairs needs to be calculated, then each node can be filled in one by one in the manner described above.

[0028] Therefore, the admittedt matrix after filling is the extended matrix. It is also a symmetric matrix, which is numerically similar to... They are equal, but the compressed storage structure will have more positions with values ​​of 0. Since the number of node pairs requiring a solution is usually not large, It is essentially a sparse matrix.

[0029] It should be noted that the above-described filling method is merely an example and not a unique limitation. In fact, inspired by this application, those skilled in the art can use other filling methods to achieve the purpose of this application.

[0030] Step S102: For the extended matrix Perform a pre-sorting to determine the permutation matrix P.

[0031] In this embodiment, the above step S102 can be completed using general-purpose software AMD or METIS software.

[0032] In this embodiment, the pre-sorting described above reduces... The amount of filling elements in the decomposed matrix.

[0033] Step S103: For the expanded matrix Perform LDL T The matrix is ​​decomposed to calculate the lower triangular matrix L and diagonal matrix D required for the equivalent resistance and to determine the positions of non-zero elements in the sparse matrix F.

[0034] In this embodiment, based on the pre-sorting result of step S102 above, the expanded matrix is ​​processed according to the following formula (2). Perform LDL T break down:

[0035]

[0036] In the above formula (2), L is a lower triangular matrix with a diagonal of 1, and D is a diagonal matrix.

[0037] As described above, due to The compressed storage structure contains a certain number of 0 elements. Therefore, for the LDL structure described above... T The decomposed L will also contain a certain number of 0 elements in its corresponding compressed storage. This can be achieved by setting the compressed storage structure of F and L. T The compressed storage structure is the same as that of L, which is equivalent to F inheriting L's structure in terms of structure. T .

[0038] Therefore, in this application, when determining the positions of non-zero elements in the sparse matrix F, a sum L is constructed. T The same compressed storage structure, but without values, yields the non-zero element locations in F. It should be noted here that although L... T The compressed storage structure corresponds to matrix elements with many values ​​of 0, but when constructing F, we do not care about their specific values; we only need L. T The distribution of non-zero element locations in the compressed storage structure is sufficient.

[0039] It should be noted here that the above-mentioned LDL process... T The decomposition method used to determine the positions of non-zero elements in a sparse matrix F is merely an example and not a unique limitation. In fact, inspired by this application, those skilled in the art can use other methods to determine the positions of non-zero elements in a sparse matrix F, as long as they achieve the purpose of this application.

[0040] Step S104: Calculate the matrix elements of the target matrix Z based on the non-zero element positions in the sparse matrix F and the lower triangular matrix L and the diagonal matrix D.

[0041] Optionally, in this embodiment, based on the following formulas (3) and (4), the matrix elements of the target matrix Z are calculated according to the non-zero element positions in the sparse matrix F and the lower triangular matrix L and the diagonal matrix D:

[0042]

[0043]

[0044] in D -1 L -1 The diagonal is 1 / d pp A lower triangular matrix, where d pp Let p be the p-th diagonal element in the diagonal matrix D, (EL T ) is an upper triangular matrix. In the The matrix element in the p-th row and q-th column, F pq and Z pq These are the matrix elements corresponding to the p-th row and q-th column of the sparse matrix F and the target matrix Z, respectively.

[0045] The derivation of the above formula (3) is as follows:

[0046] Assumption Matrix for If the inverse matrix is ​​, then there exists: Where E is the identity matrix, Substituting E into formula (2), we can obtain Further transformation of the formula Add to both sides achievable

[0047] Referring to the above description, due to the admittance matrix If it is a symmetric matrix, then The matrix is ​​also a symmetric matrix, therefore, when solving it, we only need to consider... The diagonal and upper triangular portion. It should be noted here that this application does not solve for... Solve for all elements of the matrix, and then use the above formula (4) to solve. The elements in the matrix F that correspond to the non-zero elements form the target matrix Z. The elements in F that correspond to non-zero elements can be determined by the positional compression storage structure of F.

[0048] Furthermore, for the target matrix Z, the off-diagonal element Z in Z is represented by the following formula (5). pq diagonal element Z pp Based on the above formula (5), calculate according to formula (6):

[0049] The off-diagonal element Z in Z pq (1≤p≤n, p+1≤q≤n):

[0050]

[0051] The diagonal element Z in Z pp :

[0052]

[0053] In formulas (5) and (6) above, L kp L(k,p) represents the element in the k-th row and p-th column of matrix L, and similarly, Z represents the element in the p-th column of matrix L. qk Let Z(q,k) be the element in the q-th row and k-th column of Z. qp Let l(q,p) be the element in row q and column p of L.

[0054] As can be seen from the formula above, in order to calculate the diagonal element Z... pp We need to first calculate the off-diagonal element Z related to row p. pq The calculation of each element of Z is an upward substitution process, and the calculation order of its diagonal elements is Z. nn Z (n-1)(n-1) , ..., Z 11 .

[0055] Step S105: Calculate the equivalent resistance based on the target matrix Z.

[0056] After all relevant elements of Z have been calculated, the equivalent resistance of the node pair (i,j) to be solved can be calculated according to the following formula (7):

[0057] R ij =Z ii +Z jj -2Z ij (7)

[0058] Among them, R ij Z is the equivalent resistance of the (i,j) node pair. ii Z(i,i) represents the diagonal element of the Z matrix corresponding to node i. jj Z(j,j) represents the diagonal element of the Z matrix corresponding to node j. ij Z(i,j) represents the off-diagonal element Z(i,j) of the Z matrix corresponding to the node pair (i,j).

[0059] Referring to the above embodiments of this application, in a many-to-many mode with multiple node pairs, it is necessary to calculate not only the diagonal elements of Z but also the off-diagonal elements of the Z matrix to obtain the equivalent resistance of the node pair. Furthermore, in the above process, the non-zero elements of Z that actually need to be explicitly calculated are distributed in the same way as the non-zero elements of the F matrix. Since it is not necessary to solve for a matrix that is generally dense... The complete matrix elements are obtained, thus effectively reducing the total computational cost.

[0060] Based on the above embodiments of this application, at least the following technical effects can be achieved: no solution is required. For all matrix elements, only the distribution of non-zero elements in F needs to be calculated. The matrix element Z is thus used to effectively reduce the computational cost. Since Z is a sparse matrix... Generally, it is a dense matrix, so the total computational cost will be greatly reduced because Z has fewer non-zero elements.

[0061] For example, in a specific application scenario, a resistor network with a matrix dimension of 38,446 is used. The matrix has 198,394 non-zero elements. The number of node pairs to be calculated is 1% of the matrix dimension. Based on the solution provided in the above embodiments of this application, its simplified implementation process is as follows: First, identify all node pairs for which the equivalent resistance needs to be calculated, and then perform calculations on the admittance matrix. Perform filling. For the filled admittance matrix... Sorting and LDL TDecompose. Determine the positions of the elements in the diagonal and upper triangular parts of the Z matrix that need to be explicitly calculated. Calculate the element values ​​in the diagonal and upper triangular parts of Z, looping from the last node to the first node. For example, for the calculation of the i-th node of Z, first calculate the relevant off-diagonal elements in the row where the node is located (see formula (5) for details), and then calculate the diagonal elements corresponding to the node (see formula (6) for details). After calculating all the matrix elements of Z, the equivalent resistance between node pairs (i,j) is calculated by formula (7).

[0062] In this application scenario, after filling The number of non-zero elements is 199,162. After sorting and decomposition, the number of non-zero elements in the L matrix is ​​115,990. LDL T The sorting and decomposition time is 31.77 ms. The total time for solving the equivalent resistance using the general direct method is 251.75 ms (single-thread) and 27.05 ms (16-thread), while the total time for solving the equivalent resistance using the method of this application is only 4.29 ms. The speedup achieved by the above-mentioned scheme provided in this patent application compared to the general direct method is approximately 59 times and 6 times, respectively.

[0063] The embodiments of this patent application have been described above with reference to the accompanying drawings. However, this patent application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms based on the teachings of this patent application without departing from the spirit and scope of the claims of this patent application, and all of these forms are within the scope of protection of this patent application.

Claims

1. A method for calculating equivalent resistance based on many-to-many mode, characterized in that, include: Based on the nodes to be solved using equivalent resistance, the admittance matrix of the corresponding resistive network is... The augmented matrix is ​​obtained by filling in the blanks. ; For the extended matrix Perform pre-sorting to determine the permutation matrix. ; For the extended matrix conduct Decompose the lower triangular matrix required to calculate the equivalent resistance. and diagonal matrix And determine the sparse matrix The non-zero element position in; Based on sparse matrix Non-zero element positions and lower triangular matrix With the diagonal matrix Calculate the target matrix The matrix elements are specifically: Based on the following formulas (3) and (4), according to the sparse matrix Non-zero element positions and lower triangular matrix With the diagonal matrix Calculate the target matrix Matrix elements: (3) (4) in diagonal is The lower triangular matrix, where diagonal matrix The first in One diagonal element, It is an upper triangular matrix. In the The Middle Line number Column matrix elements, and These are the sparse matrices. F and the target matrix Z of the first Line number Matrix elements corresponding to columns; For the target matrix Z, According to the following formula (5) Z off-diagonal elements in diagonal element Based on the above formula (5), calculate according to formula (6): off-diagonal elements in ,in, , : (5) Z diagonal element in : (6) In the above formulas (5) and (6), express Matrix number Line number Column elements ,akin express The Middle Line number Column elements , express The Middle Line number Column elements ; According to the target matrix The equivalent resistance is calculated as follows: when After all relevant elements have been calculated, the node pairs to be solved are... The equivalent resistance is calculated according to the following formula (7): (7) in, for Equivalent resistance of a node pair Represents a node corresponding diagonal elements of a matrix , Represents a node corresponding diagonal elements of a matrix , Represents node pairs corresponding off-diagonal elements of a matrix .

2. The method according to claim 1, characterized in that, Based on the nodes to be solved using equivalent resistance, the admittance matrix of the corresponding resistive network is... The augmented matrix is ​​obtained by filling in the blanks. This includes: the nodes to be solved based on equivalent resistance, in Add a specified position and fill it with 0 elements in the sparse compressed storage structure.

3. The method according to claim 2, characterized in that, The node to be solved based on equivalent resistance, in In the sparse compressed storage structure, add specified positions and fill with 0 elements, including: if the node to be solved for the equivalent resistance is The equivalent resistance of a node pair is then expressed in the admittance matrix. In the compressed storage structure for the first Line number Column and number Line number The two elements of the column are filled as follows: if in this position or That would be incorrect. If necessary, perform the necessary processing; otherwise, add two additional padding positions to the compressed storage structure. and And set the values ​​at these two fill positions to zero, that is, for these two fill positions and .

4. The method according to claim 1, wherein the extended matrix is ​​based on the following formula (2). conduct break down: (2) In the above formula (2), It is a lower triangular matrix with a diagonal of 1. It is a diagonal matrix.

5. The method according to claim 4, characterized in that, Determine the sparse matrix When the zero element is in the middle, by constructing a sum The same compressed storage structure, but without the value, was obtained. The non-zero element position in.

Citation Information

Patent Citations

  • BPA data based alternating current system harmonic impedance scanning method

    CN105529711A

  • Fast calculation method for short-circuit current of multi-terminal flexible direct-current power grid

    CN108923396A