Skip to content

Commit 18b278a

Browse files
committed
docs: Finish cubic interpolation section
Signed-off-by: Sietze van Buuren <[email protected]>
1 parent 46627d1 commit 18b278a

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

docs/theory/cubic.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ given interal $\bar x \in [0, 1]^N$ we're looking for the values
55
$a_{i_1,\dots,i_N}$ in the following function
66

77
$$
8-
s(\bar x_1,\dots,\bar x_N) = \sum_{i_1,\dots,i_N=0}^3 \bar a_{i_1,\dots,i_N}\prod_{k=0}^N\bar x_{k}^{i_k}
8+
s(\bar x_1,\dots,\bar x_N) = \sum_{i_1,\dots,i_N=0}^3 \bar a_{i_1 \dots i_N}\prod_{k=0}^N\bar x_{k}^{i_k}
99
$$
1010

1111
Expressing $s(\bar x_1,\dots,\bar x_N)$ in terms of $f(\bar x_1,\dots,\bar x_N)$
@@ -35,10 +35,10 @@ using $f(\bar x)$ and $f'(\bar x)$ respectively.
3535
Analogue to linear interpolation, $\eqref{eq:s_normalized}$ is also rewritten to its non-normalized version:
3636

3737
$$
38-
s(x_1,\dots,x_N) = \sum_{i_1,\dots,i_N=0}^3 a_{i_1,\dots,i_N}\prod_{k=0}^N x_{k}^{i_k}
38+
s(x_1,\dots,x_N) = \sum_{i_1,\dots,i_N=0}^3 a_{i_1 \dots i_N}\prod_{k=0}^N x_{k}^{i_k}
3939
$$
4040

41-
in which we're looking for expressions for the coefficients $a_{i_1,\dots,i_N}$.
41+
in which we're looking for expressions for the coefficients $a_{i_1 \dots i_N}$.
4242
By substututing $\bar x_k = (x_k - {}^0x_k)/h_k$ (where $h_k={}^1x_k-{}^0x_k$)
4343
into $\eqref{eq:s_normalized}$ we obtain
4444

@@ -83,7 +83,7 @@ $$
8383
$$
8484

8585
The following sections show how to employ $\eqref{eq:s_non_normalized}$ to
86-
obtain expressions for the coefficients $a_{i_1,\dots,i_N}$ for `1`, `2` and `N`
86+
obtain expressions for the coefficients $a_{i_1 \dots i_N}$ for `1`, `2` and `N`
8787
dimensions.
8888

8989
## `1` dimension
@@ -191,3 +191,26 @@ s(x_1,\dots,x_N) = \sum_{l_1,\dots,l_N=0}^1 \sum_{i_1,\dots,i_N=0}^1 &
191191
\end{split}
192192
\end{equation}
193193
$$
194+
195+
This can be reordered to
196+
197+
$$
198+
s(x_1,\dots,x_N) = \sum_{\mathbf{m}\in\{0,1,2,3\}^N} A_{\textbf{m}}\prod_{k=1}^N
199+
x_k^{m_k},
200+
$$
201+
202+
where
203+
204+
$$
205+
A_{\textbf{m}} = \sum_{l_1,\dots,l_N=0}^1\sum_{i_1,\dots,i_N=0}^1
206+
\prod_{k=1}^N \frac{h_k^{\,l_k}}{h_k^3}\,\delta_k^{(i_kl_k,m_k)}
207+
f^{(l_1,\dots,l_N)}\Bigl({}^{i_1}x_1,\dots,{}^{i_N}x_N\Bigr)
208+
$$
209+
210+
In here, $\textbf{m}$ is defined as
211+
212+
$$
213+
\mathbf{m}=(m_1,\dots,m_N) \quad \text{with } m_k\in\{0,1,2,3\}.
214+
$$
215+
216+
$A_\textbf{m}$ can be rewritten to the original coefficients: $A_\textbf{m}$ = $A_{(m_1,\dots,m_N)} = a_{m_1 \dots m_N}$.

docs/theory/linear.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ interval $\bar x \in [0, 1]^N$ now we're looking for the values
55
$a_{i_1,\dots,i_N}$ in the following function
66

77
$$
8-
s(\bar x_1,\dots,\bar x_N) = \sum_{i_1,\dots,i_N=0}^1 \bar a_{i_1,\dots,i_N}\prod_{k=0}^N\bar x_{k}^{i_k}
8+
s(\bar x_1,\dots,\bar x_N) = \sum_{i_1,\dots,i_N=0}^1 \bar a_{i_1 \dots i_N}\prod_{k=0}^N\bar x_{k}^{i_k}
99
$$
1010

1111
As stated [here](index.md), $s(\bar x_1,\dots,\bar x_N)$ can also be expressed in terms of $f(\bar x_1, \dots, \bar x_n)$. For linear interpolation ($n=1$), this boils down to:
@@ -32,11 +32,11 @@ version. The interval is now defined by $x \in [{}^0x, {}^1x]^N$.
3232
We're now looking for $s(x_1,\dots,x_N)$:
3333

3434
$$
35-
s(x_1,\dots,x_N) = \sum_{i_1,\dots,i_N=0}^1 a_{i_1,\dots,i_N}\prod_{k=0}^N
35+
s(x_1,\dots,x_N) = \sum_{i_1,\dots,i_N=0}^1 a_{i_1 \dots i_N}\prod_{k=0}^N
3636
x_{k}^{i_k},
3737
$$
3838

39-
in which the coefficients $a_{i_1,\dots,i_N}$ need to be determined.
39+
in which the coefficients $a_{i_1 \dots i_N}$ need to be determined.
4040
The transformation is achieved by substituting $\bar x = (x - {}^0x)/h$ (where
4141
$h={}^1x-{}^0x$) into $\eqref{eq:s_normalized}$. This leads to
4242

@@ -57,7 +57,7 @@ $$
5757
$$
5858

5959
The following sections show how to employ $\eqref{eq:s_non_normalized}$ to
60-
obtain expressions for the coefficients $a_{i_1,\dots,i_N}$ for `1`, `2` and `N`
60+
obtain expressions for the coefficients $a_{i_1 \dots i_N}$ for `1`, `2` and `N`
6161
dimensions.
6262

6363
## `1` dimension

0 commit comments

Comments
 (0)