Skip to content

Commit 3157a4a

Browse files
committed
Fix equations in tridiagonal design doc
1 parent 14ab501 commit 3157a4a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

components/omega/doc/design/TridiagonalSolver.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,17 @@ in the following equation for the modified main diagonal
143143
$$
144144
\hat{b}_i = h_i
145145
+ g_{i - 1} - \frac{g_{i-1}^2}{h_{i - 1} + g_{i - 2} + g_{i - 1}}
146-
+ g_{i + 1} - \frac{g_{i+1}^2}{h_{i + 1} + g_{i} + g_{i + 1}}.
146+
+ g_i - \frac{g_i^2}{h_{i + 1} + g_{i} + g_{i + 1}}.
147147
$$
148148
Using this expression can potentially result in catastrophic cancellation errors and overflows if
149149
$g_{i - 1}$ or $g_{i + 1}$ are very large.
150150
To improve its stability, this expression can be rewritten as
151151
$$
152152
\hat{b}_i = h_i
153153
+ h_{i - 1} \frac{g_{i - 1}}{h_{i - 1} + g_{i - 2} + g_{i - 1}}
154-
+ h_{i + 1} \frac{g_{i + 1}}{h_{i + 1} + g_i + g_{i + 1}}
155-
+ g_{i - 2} \frac{g_{i - 1}}{h_{i - 1} + g_{i - 2} + g_{i - 1}}
156-
+ g_i \frac{g_{i + 1}}{h_{i + 1} + g_i + g_{i + 1}}.
154+
+ h_{i + 1} \frac{g_i}{h_{i + 1} + g_i + g_{i + 1}}
155+
+ g_{i - 1} \frac{g_{i - 2}}{h_{i - 1} + g_{i - 2} + g_{i - 1}}
156+
+ g_{i + 1} \frac{g_i}{h_{i + 1} + g_i + g_{i + 1}}.
157157
$$
158158
This equation can be shown to be in the form
159159
$$
@@ -164,8 +164,8 @@ $$
164164
\begin{aligned}
165165
\hat{h}_i &= h_i
166166
+ h_{i - 1} \frac{g_{i - 1}}{h_{i - 1} + g_{i - 2} + g_{i - 1}}
167-
+ h_{i + 1} \frac{g_{i + 1}}{h_{i + 1} + g_i + g_{i + 1}}, \\
168-
\hat{g}_i &= g_i \frac{g_{i + 1}}{h_{i + 1} + g_i + g_{i + 1}}.
167+
+ h_{i + 1} \frac{g_i}{h_{i + 1} + g_i + g_{i + 1}}, \\
168+
\hat{g}_i &= g_{i + 1} \frac{g_i}{h_{i + 1} + g_i + g_{i + 1}}.
169169
\end{aligned}
170170
$$
171171
These two equations form the basis of stable (parallel) cyclic reduction for diffusion problems.

0 commit comments

Comments
 (0)