Skip to content

Commit 96d5c48

Browse files
committed
deploy: b3d5a19
1 parent 40e1056 commit 96d5c48

5 files changed

Lines changed: 24 additions & 11 deletions

File tree

.doctrees/3_numerical.doctree

-417 Bytes
Binary file not shown.

.doctrees/environment.pickle

0 Bytes
Binary file not shown.

3_numerical.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,22 @@
126126
\[y_{n+1} = y_n + h \sum_{i=1}^s b_i\,k_i.\]</div>
127127
<p><strong>Second-Order Runge-Kutta (RK2, Heun’s)</strong></p>
128128
<p>Heun’s method attains second-order accuracy by combining predictor and corrector slopes:</p>
129+
<div class="math notranslate nohighlight">
130+
\[\begin{split}\begin{aligned}
131+
k_1 &amp;= \sigma\,\mathbf{u}(\mathbf{x}_n,t_n),\\
132+
\mathbf{x}^* &amp;= \mathbf{x}_n + \Delta t\,k_1,\\
133+
k_2 &amp;= \sigma\,\mathbf{u}(\mathbf{x}^*,t_n + \Delta t),\\
134+
\mathbf{x}_{n+1} &amp;= \mathbf{x}_n + \tfrac{\Delta t}{2}\,(k_1 + k_2).
135+
\end{aligned}\end{split}\]</div>
129136
<p>This scheme yields a global error of order <span class="math notranslate nohighlight">\(O(\Delta t^2)\)</span> with two velocity evaluations per step.</p>
130137
<p><strong>Classical Fourth-Order Runge-Kutta (RK4)</strong></p>
131138
<p>The classical RK4 method achieves fourth-order accuracy via four slope evaluations at intermediate points:</p>
139+
<div class="math notranslate nohighlight">
140+
\[\begin{split}k_1 = \mathbf{u}(\mathbf{x}_n,t_n),\\
141+
k_2 = \mathbf{u}\!\bigl(\mathbf{x}_n + \tfrac{\Delta t}{2}k_1,\;t_n + \tfrac{\Delta t}{2}\bigr),\\
142+
k_3 = \mathbf{u}\!\bigl(\mathbf{x}_n + \tfrac{\Delta t}{2}k_2,\;t_n + \tfrac{\Delta t}{2}\bigr),\\
143+
k_4 = \mathbf{u}(\mathbf{x}_n + \Delta t\,k_3,\;t_n + \Delta t),\\
144+
\mathbf{x}_{n+1} = \mathbf{x}_n + \tfrac{\Delta t}{6}\,(k_1 + 2k_2 + 2k_3 + k_4).\end{split}\]</div>
132145
<p>This yields a global error of order <span class="math notranslate nohighlight">\(O(\Delta t^4)\)</span> with four velocity evaluations per step.</p>
133146
<p><strong>Sixth-Order Runge-Kutta (RK6)</strong></p>
134147
<p>The seven-stage scheme <code class="docutils literal notranslate"><span class="pre">ERK6(7)</span></code> uses non-uniform weights to attain global <span class="math notranslate nohighlight">\(O(\Delta t^6)\)</span> accuracy, originating from <a class="reference internal" href="9_references.html#butcher1964" id="id1"><span>[Butcher1964]</span></a>.
@@ -220,7 +233,7 @@
220233
</tr>
221234
</tbody>
222235
</table>
223-
<p>In our computation, the up symbol side is applied, in other words, <code class="docutils literal notranslate"><span class="pre">±</span></code> represents <code class="docutils literal notranslate"><span class="pre">+</span></code>, taking <span class="math notranslate nohighlight">\(\lambda=+\sqrt{5}\)</span>. With 15 digis are kept, the Butcher table used by the author is shown in the following table.</p>
236+
<p>In our computation, the up symbol side is applied, in other words, <code class="docutils literal notranslate"><span class="pre">±</span></code> represents <code class="docutils literal notranslate"><span class="pre">+</span></code>, taking <span class="math notranslate nohighlight">\(\lambda=+\sqrt{5}\)</span>. With 15 digis are kept, the explicit Butcher table for <code class="docutils literal notranslate"><span class="pre">RK6</span></code> used by the author is shown in the following table.</p>
224237
<table class="docutils align-default">
225238
<thead>
226239
<tr class="row-odd"><th class="head"><p><span class="math notranslate nohighlight">\(c_i\)</span></p></th>
@@ -297,7 +310,7 @@
297310
<td><p>3.61803398874989</p></td>
298311
<td><p>0</p></td>
299312
</tr>
300-
<tr class="row-odd"><td><p>b_i</p></td>
313+
<tr class="row-odd"><td><p><span class="math notranslate nohighlight">\(b_i\)</span></p></td>
301314
<td><p>0.0833333333333333</p></td>
302315
<td><p>0</p></td>
303316
<td><p>0</p></td>

_sources/3_numerical.rst.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ and then form the new approximation by
7373
Heun's method attains second-order accuracy by combining predictor and corrector slopes:
7474

7575
.. math::
76-
:align: left
7776
78-
k_1 = \sigma\,\mathbf{u}(\mathbf{x}_n,t_n),\\
79-
\mathbf{x}^* = \mathbf{x}_n + \Delta t\,k_1,\\
80-
k_2 = \sigma\,\mathbf{u}(\mathbf{x}^*,t_n + \Delta t),\\
81-
\mathbf{x}_{n+1} = \mathbf{x}_n + \tfrac{\Delta t}{2}\,(k_1 + k_2).
77+
\begin{aligned}
78+
k_1 &= \sigma\,\mathbf{u}(\mathbf{x}_n,t_n),\\
79+
\mathbf{x}^* &= \mathbf{x}_n + \Delta t\,k_1,\\
80+
k_2 &= \sigma\,\mathbf{u}(\mathbf{x}^*,t_n + \Delta t),\\
81+
\mathbf{x}_{n+1} &= \mathbf{x}_n + \tfrac{\Delta t}{2}\,(k_1 + k_2).
82+
\end{aligned}
8283
8384
This scheme yields a global error of order :math:`O(\Delta t^2)` with two velocity evaluations per step.
8485

@@ -87,7 +88,6 @@ This scheme yields a global error of order :math:`O(\Delta t^2)` with two veloci
8788
The classical RK4 method achieves fourth-order accuracy via four slope evaluations at intermediate points:
8889

8990
.. math::
90-
:align: left
9191
9292
k_1 = \mathbf{u}(\mathbf{x}_n,t_n),\\
9393
k_2 = \mathbf{u}\!\bigl(\mathbf{x}_n + \tfrac{\Delta t}{2}k_1,\;t_n + \tfrac{\Delta t}{2}\bigr),\\
@@ -122,7 +122,7 @@ As for the coefficients for ``RK6`` are more complex to write into equations, th
122122
| :math:`b_i` | :math:`1/12` | :math:`0` | :math:`0` | :math:`0` | :math:`5/12` | :math:`5/12` | :math:`1/12` |
123123
+-----------------------------+-------------------------------+----------------------------+---------------------------------+------------------------------+-----------------------------+--------------------------+-------------------------+
124124

125-
In our computation, the up symbol side is applied, in other words, ``±`` represents ``+``, taking :math:`\lambda=+\sqrt{5}`. With 15 digis are kept, the Butcher table used by the author is shown in the following table.
125+
In our computation, the up symbol side is applied, in other words, ``±`` represents ``+``, taking :math:`\lambda=+\sqrt{5}`. With 15 digis are kept, the explicit Butcher table for ``RK6`` used by the author is shown in the following table.
126126

127127
+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
128128
| :math:`c_i` | :math:`a_{i1}` | :math:`a_{i2}` | :math:`a_{i3}` | :math:`a_{i4}` | :math:`a_{i5}` | :math:`a_{i6}` | :math:`a_{i7}` |
@@ -141,7 +141,7 @@ In our computation, the up symbol side is applied, in other words, ``±`` repres
141141
+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
142142
| 1 | 0.166666666666667 | 0 | 0.0751416197912285 | -3.38770632020821 | 0.52786404500042 | 3.61803398874989 | 0 |
143143
+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
144-
| b_i | 0.0833333333333333 | 0 | 0 | 0 | 0.416666666666667 | 0.416666666666667 | 0.0833333333333333 |
144+
| :math:`b_i` | 0.0833333333333333 | 0 | 0 | 0 | 0.416666666666667 | 0.416666666666667 | 0.0833333333333333 |
145145
+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+
146146

147147

0 commit comments

Comments
 (0)