diff options
Diffstat (limited to 'source/know/concept/runge-kutta-method')
| -rw-r--r-- | source/know/concept/runge-kutta-method/index.md | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/source/know/concept/runge-kutta-method/index.md b/source/know/concept/runge-kutta-method/index.md index 270cb91..4c3dacf 100644 --- a/source/know/concept/runge-kutta-method/index.md +++ b/source/know/concept/runge-kutta-method/index.md @@ -10,16 +10,16 @@ layout: "concept" A **Runge-Kutta method** (RKM) is a popular approach to numerically solving systems of ordinary differential equations. -Let $\vb{x}(t)$ be the vector we want to find, -governed by $\vb{f}(t, \vb{x})$: +Let $$\vb{x}(t)$$ be the vector we want to find, +governed by $$\vb{f}(t, \vb{x})$$: $$\begin{aligned} \vb{x}'(t) = \vb{f}\big(t, \vb{x}(t)\big) \end{aligned}$$ -Like in all numerical methods, the $t$-axis is split into discrete steps. -If a step has size $h$, then as long as $h$ is small enough, +Like in all numerical methods, the $$t$$-axis is split into discrete steps. +If a step has size $$h$$, then as long as $$h$$ is small enough, we can make the following approximation: $$\begin{aligned} @@ -31,9 +31,9 @@ $$\begin{aligned} &\approx \vb{f}\big(t \!+\! a h,\, \vb{x}(t) \!+\! a h \vb{x}'(t) \big) \end{aligned}$$ -For sufficiently small $h$, +For sufficiently small $$h$$, higher-order derivates can also be included, -albeit still at $t \!+\! a h$: +albeit still at $$t \!+\! a h$$: $$\begin{aligned} \vb{x}'(t) + a h \vb{x}''(t) + b h^2 \vb{x}'''(t) @@ -43,8 +43,8 @@ $$\begin{aligned} Although these approximations might seem innocent, they actually make it quite complicated to determine the error order of a given RKM. -Now, consider a Taylor expansion around the current $t$, -truncated at a chosen order $n$: +Now, consider a Taylor expansion around the current $$t$$, +truncated at a chosen order $$n$$: $$\begin{aligned} \vb{x}(t \!+\! h) @@ -54,7 +54,7 @@ $$\begin{aligned} \end{aligned}$$ We are free to split the terms as follows, -choosing real factors $\omega_{mj}$ subject to $\sum_{j} \omega_{mj} = 1$: +choosing real factors $$\omega_{mj}$$ subject to $$\sum_{j} \omega_{mj} = 1$$: $$\begin{aligned} \vb{x}(t \!+\! h) @@ -63,9 +63,9 @@ $$\begin{aligned} + \:...\, + \frac{h^{n-1}}{n!} \sum_{j = 1}^{N_n} \omega_{nj} \, \vb{x}^{(n)} \bigg] \end{aligned}$$ -Where the integers $N_1,...,N_n$ are also free to choose, +Where the integers $$N_1,...,N_n$$ are also free to choose, but for reasons that will become clear later, -the most general choice for an RKM is $N_1 = n$, $N_n = 1$, and: +the most general choice for an RKM is $$N_1 = n$$, $$N_n = 1$$, and: $$\begin{aligned} N_{n-1} @@ -82,7 +82,7 @@ $$\begin{aligned} = N_3 \!+\! n \!-\! 1 \end{aligned}$$ -In other words, $N_{n-m}$ is the $m$th triangular number. +In other words, $$N_{n-m}$$ is the $$m$$th triangular number. This is not so important, since this is not a practical way to describe RKMs, but it is helpful to understand how they work. @@ -90,11 +90,11 @@ but it is helpful to understand how they work. ## Example derivation -For example, let us truncate at $n = 3$, -such that $N_1 = 3$, $N_2 = 3$ and $N_3 = 1$. +For example, let us truncate at $$n = 3$$, +such that $$N_1 = 3$$, $$N_2 = 3$$ and $$N_3 = 1$$. The following derivation is very general, -except it requires all $\alpha_j \neq 0$. -Renaming $\omega_{mj}$, we start from: +except it requires all $$\alpha_j \neq 0$$. +Renaming $$\omega_{mj}$$, we start from: $$\begin{aligned} \vb{x}(t \!+\! h) @@ -108,7 +108,7 @@ $$\begin{aligned} \end{aligned}$$ As discussed earlier, the parenthesized expressions -can be approximately rewritten with $\vb{f}$: +can be approximately rewritten with $$\vb{f}$$: $$\begin{aligned} \vb{x}(t \!+\! h) @@ -131,7 +131,7 @@ $$\begin{aligned} \end{aligned}$$ Here, we can see an opportunity to save some computational time -by reusing an evaluation of $\vb{f}$. +by reusing an evaluation of $$\vb{f}$$. Technically, this is optional, but it would be madness not to, so we choose: @@ -140,8 +140,8 @@ $$\begin{aligned} = \frac{\gamma_3}{3 \beta_{32}} \end{aligned}$$ -Such that the next step of $\vb{x}$'s numerical solution is as follows, -recalling that $\sum_{j} \alpha_j = 1$: +Such that the next step of $$\vb{x}$$'s numerical solution is as follows, +recalling that $$\sum_{j} \alpha_j = 1$$: $$\begin{aligned} \boxed{ @@ -150,9 +150,9 @@ $$\begin{aligned} } \end{aligned}$$ -Where $\vb{k}_1$, $\vb{k}_2$ and $\vb{k}_3$ are different estimates -of the average slope $\vb{x}'$ between $t$ and $t \!+\! h$, -whose weighted average is used to make the $t$-step. +Where $$\vb{k}_1$$, $$\vb{k}_2$$ and $$\vb{k}_3$$ are different estimates +of the average slope $$\vb{x}'$$ between $$t$$ and $$t \!+\! h$$, +whose weighted average is used to make the $$t$$-step. They are given by: $$\begin{aligned} @@ -172,7 +172,7 @@ $$\begin{aligned} } \end{aligned}$$ -Despite the contraints on $\alpha_j$ and $\beta_j$, +Despite the contraints on $$\alpha_j$$ and $$\beta_j$$, there is an enormous freedom of choice here, all leading to valid RKMs, although not necessarily good ones. @@ -180,9 +180,9 @@ all leading to valid RKMs, although not necessarily good ones. ## General form A more practical description goes as follows: -in an $s$-stage RKM, a weighted average is taken -of up to $s$ slope estimates $\vb{k}_j$ with weights $b_j$. -Let $\sum_{j} b_j = 1$, then: +in an $$s$$-stage RKM, a weighted average is taken +of up to $$s$$ slope estimates $$\vb{k}_j$$ with weights $$b_j$$. +Let $$\sum_{j} b_j = 1$$, then: $$\begin{aligned} \boxed{ @@ -191,7 +191,7 @@ $$\begin{aligned} } \end{aligned}$$ -Where the estimates $\vb{k}_1, ..., \vb{k}_s$ +Where the estimates $$\vb{k}_1, ..., \vb{k}_s$$ depend on each other, and are calculated one by one as: $$\begin{aligned} @@ -201,8 +201,8 @@ $$\begin{aligned} } \end{aligned}$$ -With $c_1 = 1$ and $\sum_{j = 1} a_{mj} = c_m$. -Writing this out for the first few $m$, the pattern is clear: +With $$c_1 = 1$$ and $$\sum_{j = 1} a_{mj} = c_m$$. +Writing this out for the first few $$m$$, the pattern is clear: $$\begin{aligned} \vb{k}_1 @@ -233,26 +233,26 @@ $$\begin{aligned} \end{array} \end{aligned}$$ -Each RKM has an **order** $p$, -such that the global truncation error is $\mathcal{O}(h^p)$, +Each RKM has an **order** $$p$$, +such that the global truncation error is $$\mathcal{O}(h^p)$$, i.e. the accumulated difference between the numerical -and the exact solutions is proportional to $h^p$. +and the exact solutions is proportional to $$h^p$$. -The surprise is that $p$ need not be equal to the Taylor expansion order $n$, -nor the stage count $s$. -Typically, $s = n$ for computational efficiency, but $s \ge n$ is possible in theory. +The surprise is that $$p$$ need not be equal to the Taylor expansion order $$n$$, +nor the stage count $$s$$. +Typically, $$s = n$$ for computational efficiency, but $$s \ge n$$ is possible in theory. -The order $p$ of a given RKM is determined by +The order $$p$$ of a given RKM is determined by a complicated set of equations on the coefficients, -and the lowest possible $s$ for a desired $p$ +and the lowest possible $$s$$ for a desired $$p$$ is in fact only partially known. -For $p \le 4$ the bound is $s \ge p$, -whereas for $p \ge 5$ the only proven bound is $s \ge p \!+\! 1$, -but for $p \ge 7$ no such efficient methods have been found so far. +For $$p \le 4$$ the bound is $$s \ge p$$, +whereas for $$p \ge 5$$ the only proven bound is $$s \ge p \!+\! 1$$, +but for $$p \ge 7$$ no such efficient methods have been found so far. If you need an RKM with a certain order, look it up. -There exist many efficient methods for $p \le 4$ where $s = p$, -and although less popular, higher $p$ are also available. +There exist many efficient methods for $$p \le 4$$ where $$s = p$$, +and although less popular, higher $$p$$ are also available. |
