@@ -9,7 +9,7 @@ SPDX-License-Identifier: MPL-2.0
9
9
Power system equations can be modeled as matrix equations. A matrix equation solver is therefore
10
10
key to the power grid model.
11
11
12
- This section documents the need for a custom sparse LU solver and its implementation.
12
+ This section documents the need for a custom sparse LU- solver and its implementation.
13
13
14
14
## Background
15
15
@@ -25,10 +25,11 @@ imposes some constraints on the algorithms that can be used.
25
25
26
26
* Highly accurate and fast calculations are needed for very large grids. This means that direct
27
27
methods are strongly preferred, and approximate methods can only be used when there is no other
28
- alternative, and only if can be iteratively refined with a fast convergence rate.
28
+ alternative, and only if they can be iteratively refined with a fast convergence rate.
29
29
* Sometimes, very many repetitive calculations are required, e.g., for time series. In those cases,
30
- separating the decomposition of a matrix and solving two systems of equations separately can give
31
- major performance boosts.
30
+ separating the decomposition (also known as factorization) of a matrix and solving two systems of
31
+ equations separately can give major performance boosts, because the decomposition remains the same
32
+ across the entire set of calculations.
32
33
33
34
### Topological structure
34
35
@@ -45,7 +46,7 @@ and, as a result, extremely sparse matrix equations with a block structure.
45
46
46
47
Sparse matrix equations can be solved efficiently: they can be solved in linear time complexity, as
47
48
opposed to the cubic complexity of naive Gaussian elimination. As a result, a sparse matrix solver
48
- is key to the performance of the power grid model. QR decomposition therefore is not a good
49
+ is key to the performance of the power grid model. QR- decomposition therefore is not a good
49
50
candidate.
50
51
51
52
#### Pivot operations
@@ -90,33 +91,33 @@ dense blocks need to be inverted separately. To make matters worse, the dense bl
90
91
heavily in structure and contents between different nodes, and are often not solvable without
91
92
pivoting.
92
93
93
- ### Custom sparse LU solver
94
+ ### Custom sparse LU- solver
94
95
95
- The choice for a custom LU solver implementation comes from a number of considerations:
96
+ The choice for a custom LU- solver implementation comes from a number of considerations:
96
97
97
- * LU-decomposition is the best choice, because QR-decomposition and Cholesky decomposition cannot
98
+ * LU-decomposition is the best choice, because QR-decomposition and Cholesky- decomposition cannot
98
99
solve the power system equations efficiently as a consequence of the properties
99
- * Alternative LU solver implementations are optimized for a variety of use cases that are less
100
+ * Alternative LU- solver implementations are optimized for a variety of use cases that are less
100
101
sparse than the ones encountered in power systems.
101
- * Alternative LU solver implementations do not have good block-sparse matrix equation solvers.
102
+ * Alternative LU- solver implementations do not have good block-sparse matrix equation solvers.
102
103
103
104
## Implementation
104
105
105
- The LU solver implemented in the power grid model consists of 3 components:
106
+ The LU- solver implemented in the power grid model consists of 3 components:
106
107
107
- * A block-sparse LU solver that:
108
+ * A block-sparse LU- solver that:
108
109
* handles factorization using the topological structure up to block-level
109
110
* solves the sparse matrix equation given the factorization
110
- * A dense LU factor that handles individual blocks within the matrix equation
111
+ * A dense LU- factor that handles individual blocks within the matrix equation
111
112
112
- ### Dense LU factorization
113
+ ### Dense LU- factorization
113
114
114
115
The power grid model uses a modified version of the
115
116
[ ` LUFullPiv ` defined in Eigen] ( https://gitlab.com/libeigen/eigen/-/blob/3.4/Eigen/src/LU/FullPivLU.h )
116
117
(credits go to the original author). The modification adds opt-in support for
117
118
[ pivot perturbation] ( #pivot-perturbation ) .
118
119
119
- #### Dense LU factorization process
120
+ #### Dense LU- factorization process
120
121
121
122
The Gaussian elimination process itself is as usual. Let
122
123
$M_p\equiv\begin{bmatrix}m_p && \vec{r}_ p^T \\ \vec{q}_ p && \hat{M}_ p\end{bmatrix}$, where $p$ is
160
161
A = P^{-1}LUQ^{-1}
161
162
$$
162
163
163
- #### Dense LU factorization algorithm
164
+ #### Dense LU- factorization algorithm
164
165
165
166
The power grid model uses an in-place approach. Permutations are
166
167
@@ -206,15 +207,15 @@ the `SparseMatrixError` immediately, we break from the loop and throw after that
206
207
change the functional behavior.
207
208
```
208
209
209
- ### Block-sparse LU factorization
210
+ ### Block-sparse LU- factorization
210
211
211
- The LU factorization process for block-sparse matrices is similar to that for
212
+ The LU- factorization process for block-sparse matrices is similar to that for
212
213
[ dense matrices] ( #dense-lu-factorization ) , but in this case, $m_p$ is a block element, and
213
214
$\vec{q}_ p$, $\vec{r}_ p^T$ and $\hat{M}_ p$ consist of block elements as well. Notice that the
214
- inverse $m_p^{-1}$ can be calculated from is LU decomposition, which can be obtained from the
215
- [ dense LU factorization process] ( #dense-lu-factorization-process ) .
215
+ inverse $m_p^{-1}$ can be calculated from is LU- decomposition, which can be obtained from the
216
+ [ dense LU- factorization process] ( #dense-lu-factorization-process ) .
216
217
217
- #### Block-sparse LU factorization process
218
+ #### Block-sparse LU- factorization process
218
219
219
220
The Gaussian elimination process itself is as usual. Completely analogously to and following the
220
221
same conventions as [ before] ( #dense-lu-factorization-process ) , let
@@ -409,7 +410,7 @@ obtained here is an approximation of the exact solution. The approximation can b
409
410
410
411
### Pivot perturbation
411
412
412
- The LU solver implemented in the power grid model has support for pivot perturbation. The methods
413
+ The LU- solver implemented in the power grid model has support for pivot perturbation. The methods
413
414
are described in
414
415
[ Li99] ( https://www.semanticscholar.org/paper/A-Scalable-Sparse-Direct-Solver-Using-Static-Li-Demmel/7ea1c3360826ad3996f387eeb6d70815e1eb3761 )
415
416
and
@@ -442,7 +443,7 @@ be the matrix, $\left\|M\right\|_{\infty ,\text{bwod}}$ the
442
443
$\text{direction}$ ensures that the complex phase of the pivot element is preserved, with a fallback
443
444
the positive real axis when the pivot element is identically zero.
444
445
445
- ### Iterative refinement of LU solver solutions
446
+ ### Iterative refinement of LU- solver solutions
446
447
447
448
This algorithm is heavily inspired by the GESP algorithm described in
448
449
[ Li99] ( https://www.semanticscholar.org/paper/A-Scalable-Sparse-Direct-Solver-Using-Static-Li-Demmel/7ea1c3360826ad3996f387eeb6d70815e1eb3761 ) .
@@ -464,7 +465,7 @@ back into $x_{i+1} = x_i + \Delta x$ provides the next best approximation $x_{i+
464
465
A measure for the quality of the approximation is given by the $\text{backward_error}$ (see also
465
466
[ backward error formula] ( #improved-backward-error-calculation ) ).
466
467
467
- Since the matrix $A$ does not change during this process, the LU decomposition remains valid
468
+ Since the matrix $A$ does not change during this process, the LU- decomposition remains valid
468
469
throughout the process, so that this iterative refinement can be done at a reasonably low cost.
469
470
470
471
Given the original matrix equation $A \cdot x = b$ to solve, the pivot perturbated matrix
0 commit comments