Skip to content

Commit cc24f2d

Browse files
committed
deploy: cf856f4
1 parent 079130e commit cc24f2d

5 files changed

Lines changed: 91 additions & 66 deletions

File tree

.doctrees/3_numerical.doctree

2.28 KB
Binary file not shown.

.doctrees/environment.pickle

0 Bytes
Binary file not shown.

3_numerical.html

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,26 @@
116116
\[\begin{split}\mathbf{u}_n = \mathbf{u}(\mathbf{x}_n,t_n),\\
117117
\mathbf{x}_{n+1} = \mathbf{x}_n + \sigma\,\Delta t\,\mathbf{u}_n.\end{split}\]</div>
118118
<p>This method incurs a global error of order <span class="math notranslate nohighlight">\(O(\Delta t)\)</span> and requires only one velocity evaluation per step.</p>
119-
<p><strong>Second-Order Runge-Kutta (Heun’s Method)</strong></p>
119+
<p><strong>Runge-Kutta Method</strong></p>
120+
<p>In an explicit <span class="math notranslate nohighlight">\(s\)</span>-stage Runge–Kutta method for the initial-value problem:</p>
121+
<div class="math notranslate nohighlight">
122+
\[y' = f(t,y), \quad y(t_n) = y_n\]</div>
123+
<p>one advances the solution by a step <span class="math notranslate nohighlight">\(h\)</span> as follows. First compute the intermediate slopes</p>
124+
<div class="math notranslate nohighlight">
125+
\[k_i = f\Bigl(t_n + c_i\,h,\;y_n + h \sum_{j=1}^{i-1} a_{ij}\,k_j\Bigr),
126+
\quad i = 1,2,\dots,s\]</div>
127+
<p>and then form the new approximation by</p>
128+
<div class="math notranslate nohighlight">
129+
\[y_{n+1} = y_n + h \sum_{i=1}^s b_i\,k_i.\]</div>
130+
<p><em>Second-Order Runge-Kutta (RK2, Heun’s)</em></p>
120131
<p>Heun’s method attains second-order accuracy by combining predictor and corrector slopes:</p>
121132
<div class="math notranslate nohighlight">
122133
\[\begin{split}k_1 = \sigma\,\mathbf{u}(\mathbf{x}_n,t_n),\\
123134
\mathbf{x}^* = \mathbf{x}_n + \Delta t\,k_1,\\
124135
k_2 = \sigma\,\mathbf{u}(\mathbf{x}^*,t_n + \Delta t),\\
125136
\mathbf{x}_{n+1} = \mathbf{x}_n + \tfrac{\Delta t}{2}\,(k_1 + k_2).\end{split}\]</div>
126137
<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>
127-
<p><strong>Classical Fourth-Order Runge-Kutta (RK4)</strong></p>
138+
<p><em>Classical Fourth-Order Runge-Kutta (RK4)</em></p>
128139
<p>The classical RK4 method achieves fourth-order accuracy via four slope evaluations at intermediate points:</p>
129140
<div class="math notranslate nohighlight">
130141
\[\begin{split}k_1 = \mathbf{u}(\mathbf{x}_n,t_n),\\
@@ -133,83 +144,86 @@
133144
k_4 = \mathbf{u}(\mathbf{x}_n + \Delta t\,k_3,\;t_n + \Delta t),\\
134145
\mathbf{x}_{n+1} = \mathbf{x}_n + \tfrac{\Delta t}{6}\,(k_1 + 2k_2 + 2k_3 + k_4).\end{split}\]</div>
135146
<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>
136-
<p><strong>Sixth-Order Runge-Kutta (RK6)</strong></p>
137-
<p>The seven-stage scheme uses non-uniform weights to attain global <span class="math notranslate nohighlight">\(O(\Delta t^6)\)</span> accuracy. This method originates from <a class="reference internal" href="9_references.html#butcher" id="id1"><span>[Butcher]</span></a>, as well as the coefficients (Butcher table) listed in the basically-tailest table of the reference.</p>
138-
<div class="math notranslate nohighlight">
139-
\[\begin{split}k_1 = \mathbf{u}(\mathbf{x}_n,t_n),\\
140-
k_2 = \mathbf{u}\!\bigl(\mathbf{x}_n + \tfrac{\Delta t}{3}k_1,\;t_n + \tfrac{\Delta t}{3}\bigr),\\
141-
k_3 = \mathbf{u}\!\bigl(\mathbf{x}_n + \Delta t(\tfrac{1}{6}k_1 + \tfrac{1}{6}k_2),\;t_n + \tfrac{\Delta t}{3}\bigr),\\
142-
k_4 = \mathbf{u}\!\bigl(\mathbf{x}_n + \Delta t(\tfrac{1}{8}k_1 + \tfrac{3}{8}k_3),\;t_n + \tfrac{\Delta t}{2}\bigr),\\
143-
k_5 = \mathbf{u}\!\bigl(\mathbf{x}_n + \Delta t(\tfrac{1}{2}k_1 - \tfrac{3}{2}k_3 + 2k_4),\;t_n + \tfrac{2\Delta t}{3}\bigr),\\
144-
k_6 = \mathbf{u}\!\bigl(\mathbf{x}_n + \Delta t(-\tfrac{3}{2}k_1 + 2k_2 - \tfrac{1}{2}k_3 + k_4),\;t_n + \Delta t\bigr),\\
145-
\mathbf{x}_{n+1} = \mathbf{x}_n + \Delta t\bigl(\tfrac{1}{20}k_1 + \tfrac{1}{4}k_4 + \tfrac{1}{5}k_5 + \tfrac{1}{2}k_6\bigr).\end{split}\]</div>
146-
<p>This scheme incurs a global error of order with six velocity evaluations.</p>
147+
<p><em>Sixth-Order Runge-Kutta (RK6)</em></p>
148+
<p>The seven-stage scheme uses non-uniform weights to attain global <span class="math notranslate nohighlight">\(O(\Delta t^6)\)</span> accuracy. This method originates from <a class="reference internal" href="9_references.html#butcher" id="id1"><span>[Butcher]</span></a>.
149+
As for the coefficients for <code class="docutils literal notranslate"><span class="pre">RK6</span></code> are more complex to write into equations, the Butcher table is given as follows.</p>
147150
<table class="docutils align-default">
151+
<thead>
152+
<tr class="row-odd"><th class="head"><p><span class="math notranslate nohighlight">\(c_i\)</span></p></th>
153+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i1}\)</span></p></th>
154+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i2}\)</span></p></th>
155+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i3}\)</span></p></th>
156+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i4}\)</span></p></th>
157+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i5}\)</span></p></th>
158+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i6}\)</span></p></th>
159+
<th class="head"><p><span class="math notranslate nohighlight">\(a_{i7}\)</span></p></th>
160+
</tr>
161+
</thead>
148162
<tbody>
149-
<tr class="row-odd"><td></td>
150-
<td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>
163+
<tr class="row-even"><td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>
164+
<td></td>
151165
<td></td>
152166
<td></td>
153167
<td></td>
154168
<td></td>
155169
<td></td>
156170
<td></td>
157171
</tr>
158-
<tr class="row-even"><td></td>
159-
<td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
172+
<tr class="row-odd"><td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
160173
<td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
161174
<td></td>
162175
<td></td>
163176
<td></td>
164177
<td></td>
165178
<td></td>
179+
<td></td>
166180
</tr>
167-
<tr class="row-odd"><td></td>
168-
<td><p><span class="math notranslate nohighlight">\((5\pm\sqrt{5})/10\)</span></p></td>
181+
<tr class="row-even"><td><p><span class="math notranslate nohighlight">\((5\pm\sqrt{5})/10\)</span></p></td>
169182
<td><p><span class="math notranslate nohighlight">\(\mp\sqrt{5}/10\)</span></p></td>
170183
<td><p><span class="math notranslate nohighlight">\((5\pm2\sqrt{5})/10\)</span></p></td>
171184
<td></td>
172185
<td></td>
173186
<td></td>
174187
<td></td>
188+
<td></td>
175189
</tr>
176-
<tr class="row-even"><td></td>
177-
<td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
190+
<tr class="row-odd"><td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
178191
<td><p><span class="math notranslate nohighlight">\((-15\pm7\sqrt{5})/20\)</span></p></td>
179192
<td><p><span class="math notranslate nohighlight">\((-1\pm\sqrt{5})/4\)</span></p></td>
180193
<td><p><span class="math notranslate nohighlight">\((15\mp7\sqrt{5})/10\)</span></p></td>
181194
<td></td>
182195
<td></td>
183196
<td></td>
197+
<td></td>
184198
</tr>
185-
<tr class="row-odd"><td></td>
186-
<td><p><span class="math notranslate nohighlight">\((5\pm\sqrt{5})/10\)</span></p></td>
199+
<tr class="row-even"><td><p><span class="math notranslate nohighlight">\((5\pm\sqrt{5})/10\)</span></p></td>
187200
<td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/60\)</span></p></td>
188201
<td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>
189202
<td><p><span class="math notranslate nohighlight">\(1/6\)</span></p></td>
190203
<td><p><span class="math notranslate nohighlight">\((15\pm7\sqrt{5})/60\)</span></p></td>
191204
<td></td>
192205
<td></td>
206+
<td></td>
193207
</tr>
194-
<tr class="row-even"><td></td>
195-
<td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
208+
<tr class="row-odd"><td><p><span class="math notranslate nohighlight">\((5\mp\sqrt{5})/10\)</span></p></td>
196209
<td><p><span class="math notranslate nohighlight">\((5\pm\sqrt{5})/60\)</span></p></td>
197210
<td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>
198211
<td><p><span class="math notranslate nohighlight">\((9\mp5\sqrt{5})/12\)</span></p></td>
199212
<td><p><span class="math notranslate nohighlight">\(1/6\)</span></p></td>
200213
<td><p><span class="math notranslate nohighlight">\((-5\pm3\sqrt{5})/10\)</span></p></td>
201214
<td></td>
215+
<td></td>
202216
</tr>
203-
<tr class="row-odd"><td></td>
204-
<td><p><span class="math notranslate nohighlight">\(1\)</span></p></td>
217+
<tr class="row-even"><td><p><span class="math notranslate nohighlight">\(1\)</span></p></td>
205218
<td><p><span class="math notranslate nohighlight">\(1/6\)</span></p></td>
206219
<td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>
207220
<td><p><span class="math notranslate nohighlight">\((-55\pm25\sqrt{5})/12\)</span></p></td>
208221
<td><p><span class="math notranslate nohighlight">\((-25\mp7\sqrt{5})/12\)</span></p></td>
209222
<td><p><span class="math notranslate nohighlight">\(5\mp2\sqrt{5}\)</span></p></td>
210223
<td><p><span class="math notranslate nohighlight">\((5\pm\sqrt{5})/2\)</span></p></td>
224+
<td></td>
211225
</tr>
212-
<tr class="row-even"><td></td>
226+
<tr class="row-odd"><td><p><span class="math notranslate nohighlight">\(b_i\)</span></p></td>
213227
<td><p><span class="math notranslate nohighlight">\(1/12\)</span></p></td>
214228
<td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>
215229
<td><p><span class="math notranslate nohighlight">\(0\)</span></p></td>

0 commit comments

Comments
 (0)