Publish docs for local build
This commit is contained in:
parent
e7cd1f4d50
commit
693e3af8fa
9 changed files with 2042 additions and 817 deletions
|
|
@ -1903,8 +1903,9 @@ series of other matrices).</p>
|
|||
which covers a superset of this material with similar notation and more detail.</p>
|
||||
<h4 id="meanas.fdmath--scalar-derivatives-and-cell-shifts">Scalar derivatives and cell shifts<a class="headerlink" href="#meanas.fdmath--scalar-derivatives-and-cell-shifts" title="Permanent link">¶</a></h4>
|
||||
<p>Define the discrete forward derivative as
|
||||
$$ [\tilde{\partial}<em _="+" _frac_1="\frac{1" m="m">x f]</em> - f_m) $$
|
||||
where }{2}} = \frac{1}{\Delta_{x, m}} (f_{m + 1<span class="arithmatex">\(f\)</span> is a function defined at discrete locations on the x-axis (labeled using <span class="arithmatex">\(m\)</span>).
|
||||
|
||||
<div class="arithmatex">\[ [\tilde{\partial}_x f]_{m + \frac{1}{2}} = \frac{1}{\Delta_{x, m}} (f_{m + 1} - f_m) \]</div></p>
|
||||
<p>where <span class="arithmatex">\(f\)</span> is a function defined at discrete locations on the x-axis (labeled using <span class="arithmatex">\(m\)</span>).
|
||||
The value at <span class="arithmatex">\(m\)</span> occupies a length <span class="arithmatex">\(\Delta_{x, m}\)</span> along the x-axis. Note that <span class="arithmatex">\(m\)</span>
|
||||
is an index along the x-axis, <em>not</em> necessarily an x-coordinate, since each length
|
||||
<span class="arithmatex">\(\Delta_{x, m}, \Delta_{x, m+1}, ...\)</span> is independently chosen.</p>
|
||||
|
|
@ -1913,8 +1914,9 @@ along the x-axis, the forward derivative is</p>
|
|||
<div class="highlight"><pre><span></span><code>deriv_forward(f)[i] = (f[i + 1] - f[i]) / dx[i]
|
||||
</code></pre></div>
|
||||
<p>Likewise, discrete reverse derivative is
|
||||
$$ [\hat{\partial}<em -="-" _frac_1="\frac{1" m="m">x f ]</em>) $$
|
||||
or}{2}} = \frac{1}{\Delta_{x, m}} (f_{m} - f_{m - 1</p>
|
||||
|
||||
<div class="arithmatex">\[ [\hat{\partial}_x f ]_{m - \frac{1}{2}} = \frac{1}{\Delta_{x, m}} (f_{m} - f_{m - 1}) \]</div></p>
|
||||
<p>or</p>
|
||||
<div class="highlight"><pre><span></span><code>deriv_back(f)[i] = (f[i] - f[i - 1]) / dx[i]
|
||||
</code></pre></div>
|
||||
<p>The derivatives' values are shifted by a half-cell relative to the original function, and
|
||||
|
|
@ -1949,7 +1951,9 @@ Periodic boundaries are used here and elsewhere unless otherwise noted.
|
|||
etc.</p>
|
||||
<p>The fractional subscript <span class="arithmatex">\(m + \frac{1}{2}\)</span> is used to indicate values defined
|
||||
at shifted locations relative to the original <span class="arithmatex">\(m\)</span>, with corresponding lengths
|
||||
$$ \Delta_{x, m + \frac{1}{2}} = \frac{1}{2} * (\Delta_{x, m} + \Delta_{x, m + 1}) $$</p>
|
||||
|
||||
<div class="arithmatex">\[ \Delta_{x, m + \frac{1}{2}} = \frac{1}{2} * (\Delta_{x, m} + \Delta_{x, m + 1}) \]</div>
|
||||
</p>
|
||||
<p>Just as <span class="arithmatex">\(m\)</span> is not itself an x-coordinate, neither is <span class="arithmatex">\(m + \frac{1}{2}\)</span>;
|
||||
carefully note the positions of the various cells in the above figure vs their labels.
|
||||
If the positions labeled with <span class="arithmatex">\(m\)</span> are considered the "base" or "original" grid,
|
||||
|
|
@ -1961,12 +1965,18 @@ See the <code>Grid description</code> section below for additional information o
|
|||
and generalization to three dimensions.</p>
|
||||
<h4 id="meanas.fdmath--gradients-and-fore-vectors">Gradients and fore-vectors<a class="headerlink" href="#meanas.fdmath--gradients-and-fore-vectors" title="Permanent link">¶</a></h4>
|
||||
<p>Expanding to three dimensions, we can define two gradients
|
||||
$$ [\tilde{\nabla} f]<em _="+" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} [\tilde{\partial}_x f]</em> +
|
||||
\vec{y} [\tilde{\partial}}{2},n,p<em _="+" _frac_1="\frac{1" m_n="m,n">y f]</em> +
|
||||
\vec{z} [\tilde{\partial}}{2},p<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">z f]</em> $$
|
||||
$$ [\hat{\nabla} f]}{2}<em _="+" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} [\hat{\partial}_x f]</em> +
|
||||
\vec{y} [\hat{\partial}}{2},n,p<em _="+" _frac_1="\frac{1" m_n="m,n">y f]</em> +
|
||||
\vec{z} [\hat{\partial}}{2},p<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">z f]</em> $$}{2}</p>
|
||||
<br />
|
||||
<div class="arithmatex">\[
|
||||
[\tilde{\nabla} f]_{m,n,p} = \vec{x} [\tilde{\partial}_x f]_{m + \frac{1}{2},n,p} +
|
||||
\vec{y} [\tilde{\partial}_y f]_{m,n + \frac{1}{2},p} +
|
||||
\vec{z} [\tilde{\partial}_z f]_{m,n,p + \frac{1}{2}}
|
||||
\]</div></p>
|
||||
<div class="arithmatex">\[
|
||||
[\hat{\nabla} f]_{m,n,p} = \vec{x} [\hat{\partial}_x f]_{m + \frac{1}{2},n,p} +
|
||||
\vec{y} [\hat{\partial}_y f]_{m,n + \frac{1}{2},p} +
|
||||
\vec{z} [\hat{\partial}_z f]_{m,n,p + \frac{1}{2}}
|
||||
\]</div>
|
||||
|
||||
<p>or</p>
|
||||
<div class="highlight"><pre><span></span><code>[code: gradients]
|
||||
grad_forward(f)[i,j,k] = [Dx_forward(f)[i, j, k],
|
||||
|
|
@ -1989,12 +1999,18 @@ at different points: the x-component is shifted in the x-direction,
|
|||
y in y, and z in z.</p>
|
||||
<p>We call the resulting object a "fore-vector" or "back-vector", depending
|
||||
on the direction of the shift. We write it as
|
||||
$$ \tilde{g}<em _="+" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} g^x</em> +
|
||||
<br />
|
||||
<div class="arithmatex">\[
|
||||
\tilde{g}_{m,n,p} = \vec{x} g^x_{m + \frac{1}{2},n,p} +
|
||||
\vec{y} g^y_{m,n + \frac{1}{2},p} +
|
||||
\vec{z} g^z_{m,n,p + \frac{1}{2}} $$
|
||||
$$ \hat{g}}{2},n,p<em -="-" _frac_1="\frac{1" m="m">{m,n,p} = \vec{x} g^x</em> +
|
||||
\vec{z} g^z_{m,n,p + \frac{1}{2}}
|
||||
\]</div></p>
|
||||
<div class="arithmatex">\[
|
||||
\hat{g}_{m,n,p} = \vec{x} g^x_{m - \frac{1}{2},n,p} +
|
||||
\vec{y} g^y_{m,n - \frac{1}{2},p} +
|
||||
\vec{z} g^z_{m,n,p - \frac{1}{2}} $$}{2},n,p</p>
|
||||
\vec{z} g^z_{m,n,p - \frac{1}{2}}
|
||||
\]</div>
|
||||
|
||||
<div class="highlight"><pre><span></span><code>[figure: gradient / fore-vector]
|
||||
(m, n+1, p+1) ______________ (m+1, n+1, p+1)
|
||||
/: /|
|
||||
|
|
@ -2010,14 +2026,20 @@ on the direction of the shift. We write it as
|
|||
</code></pre></div>
|
||||
<h4 id="meanas.fdmath--divergences">Divergences<a class="headerlink" href="#meanas.fdmath--divergences" title="Permanent link">¶</a></h4>
|
||||
<p>There are also two divergences,</p>
|
||||
<p>$$ d_{n,m,p} = [\tilde{\nabla} \cdot \hat{g}]<em m_n_p="m,n,p">{n,m,p}
|
||||
= [\tilde{\partial}_x g^x]</em> +
|
||||
[\tilde{\partial}<em m_n_p="m,n,p">y g^y]</em> +
|
||||
[\tilde{\partial}<em m_n_p="m,n,p">z g^z]</em> $$</p>
|
||||
<p>$$ d_{n,m,p} = [\hat{\nabla} \cdot \tilde{g}]<em m_n_p="m,n,p">{n,m,p}
|
||||
= [\hat{\partial}_x g^x]</em> +
|
||||
[\hat{\partial}<em m_n_p="m,n,p">y g^y]</em> +
|
||||
[\hat{\partial}<em m_n_p="m,n,p">z g^z]</em> $$</p>
|
||||
<div class="arithmatex">\[
|
||||
d_{n,m,p} = [\tilde{\nabla} \cdot \hat{g}]_{n,m,p}
|
||||
= [\tilde{\partial}_x g^x]_{m,n,p} +
|
||||
[\tilde{\partial}_y g^y]_{m,n,p} +
|
||||
[\tilde{\partial}_z g^z]_{m,n,p}
|
||||
\]</div>
|
||||
|
||||
<div class="arithmatex">\[
|
||||
d_{n,m,p} = [\hat{\nabla} \cdot \tilde{g}]_{n,m,p}
|
||||
= [\hat{\partial}_x g^x]_{m,n,p} +
|
||||
[\hat{\partial}_y g^y]_{m,n,p} +
|
||||
[\hat{\partial}_z g^z]_{m,n,p}
|
||||
\]</div>
|
||||
|
||||
<p>or</p>
|
||||
<div class="highlight"><pre><span></span><code>[code: divergences]
|
||||
div_forward(g)[i,j,k] = Dx_forward(gx)[i, j, k] +
|
||||
|
|
@ -2056,16 +2078,22 @@ is defined at the back-vector's (fore-vector's) location <span class="arithmatex
|
|||
</code></pre></div>
|
||||
<h4 id="meanas.fdmath--curls">Curls<a class="headerlink" href="#meanas.fdmath--curls" title="Permanent link">¶</a></h4>
|
||||
<p>The two curls are then</p>
|
||||
<p>$$ \begin{aligned}
|
||||
\hat{h}<em _="+" _frac_1="\frac{1" m="m">{m + \frac{1}{2}, n + \frac{1}{2}, p + \frac{1}{2}} &= \
|
||||
[\tilde{\nabla} \times \tilde{g}]</em> &=
|
||||
\vec{x} (\tilde{\partial}}{2}, n + \frac{1}{2}, p + \frac{1}{2}<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">y g^z</em>}{2}} - \tilde{\partial<em _="+" _frac_1="\frac{1" m_n="m,n">z g^y</em>) \
|
||||
&+ \vec{y} (\tilde{\partial}}{2},p<em _="+" _frac_1="\frac{1" m="m">z g^x</em>}{2},n,p} - \tilde{\partial<em _="+" _frac_1="\frac{1" m_n_p="m,n,p">x g^z</em>) \
|
||||
&+ \vec{z} (\tilde{\partial}}{2}<em _="+" _frac_1="\frac{1" m_n="m,n">x g^y</em>}{2},p} - \tilde{\partial<em _="+" _frac_1="\frac{1" m="m">y g^z</em>)
|
||||
\end{aligned} $$}{2},n,p</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\hat{h}_{m + \frac{1}{2}, n + \frac{1}{2}, p + \frac{1}{2}} &= \\
|
||||
[\tilde{\nabla} \times \tilde{g}]_{m + \frac{1}{2}, n + \frac{1}{2}, p + \frac{1}{2}} &=
|
||||
\vec{x} (\tilde{\partial}_y g^z_{m,n,p + \frac{1}{2}} - \tilde{\partial}_z g^y_{m,n + \frac{1}{2},p}) \\
|
||||
&+ \vec{y} (\tilde{\partial}_z g^x_{m + \frac{1}{2},n,p} - \tilde{\partial}_x g^z_{m,n,p + \frac{1}{2}}) \\
|
||||
&+ \vec{z} (\tilde{\partial}_x g^y_{m,n + \frac{1}{2},p} - \tilde{\partial}_y g^z_{m + \frac{1}{2},n,p})
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>and</p>
|
||||
<p>$$ \tilde{h}<em -="-" _frac_1="\frac{1" m="m">{m - \frac{1}{2}, n - \frac{1}{2}, p - \frac{1}{2}} =
|
||||
[\hat{\nabla} \times \hat{g}]</em> $$}{2}, n - \frac{1}{2}, p - \frac{1}{2}</p>
|
||||
<div class="arithmatex">\[
|
||||
\tilde{h}_{m - \frac{1}{2}, n - \frac{1}{2}, p - \frac{1}{2}} =
|
||||
[\hat{\nabla} \times \hat{g}]_{m - \frac{1}{2}, n - \frac{1}{2}, p - \frac{1}{2}}
|
||||
\]</div>
|
||||
|
||||
<p>where <span class="arithmatex">\(\hat{g}\)</span> and <span class="arithmatex">\(\tilde{g}\)</span> are located at <span class="arithmatex">\((m,n,p)\)</span>
|
||||
with components at <span class="arithmatex">\((m \pm \frac{1}{2},n,p)\)</span> etc.,
|
||||
while <span class="arithmatex">\(\hat{h}\)</span> and <span class="arithmatex">\(\tilde{h}\)</span> are located at <span class="arithmatex">\((m \pm \frac{1}{2}, n \pm \frac{1}{2}, p \pm \frac{1}{2})\)</span>
|
||||
|
|
@ -2103,19 +2131,25 @@ curl_back(g)[i,j,k] = [Dy_back(gz)[i, j, k] - Dz_back(gy)[i, j, k],
|
|||
</code></pre></div>
|
||||
<h3 id="meanas.fdmath--maxwells-equations">Maxwell's Equations<a class="headerlink" href="#meanas.fdmath--maxwells-equations" title="Permanent link">¶</a></h3>
|
||||
<p>If we discretize both space (m,n,p) and time (l), Maxwell's equations become</p>
|
||||
<p>$$ \begin{aligned}
|
||||
\tilde{\nabla} \times \tilde{E}<em l-_frac_1="l-\frac{1">{l,\vec{r}} &= -\tilde{\partial}_t \hat{B}</em>
|
||||
- \hat{M}}{2}, \vec{r} + \frac{1}{2}<em l-_frac_1="l-\frac{1">{l, \vec{r} + \frac{1}{2}} \
|
||||
\hat{\nabla} \times \hat{H}</em>}{2},\vec{r} + \frac{1}{2}} &= \hat{\partial<em _vec_r="\vec{r" l_="l,">t \tilde{D}</em>
|
||||
+ \tilde{J}}<em l-_frac_1="l-\frac{1">{l-\frac{1}{2},\vec{r}} \
|
||||
\tilde{\nabla} \cdot \hat{B}</em> &= 0 \
|
||||
\hat{\nabla} \cdot \tilde{D}}{2}, \vec{r} + \frac{1}{2}<em l_vec_r="l,\vec{r">{l,\vec{r}} &= \rho</em>
|
||||
\end{aligned} $$}</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &= -\tilde{\partial}_t \hat{B}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}}
|
||||
- \hat{M}_{l, \vec{r} + \frac{1}{2}} \\
|
||||
\hat{\nabla} \times \hat{H}_{l-\frac{1}{2},\vec{r} + \frac{1}{2}} &= \hat{\partial}_t \tilde{D}_{l, \vec{r}}
|
||||
+ \tilde{J}_{l-\frac{1}{2},\vec{r}} \\
|
||||
\tilde{\nabla} \cdot \hat{B}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}} &= 0 \\
|
||||
\hat{\nabla} \cdot \tilde{D}_{l,\vec{r}} &= \rho_{l,\vec{r}}
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>with</p>
|
||||
<p>$$ \begin{aligned}
|
||||
\hat{B}<em _vec_r="\vec{r">{\vec{r}} &= \mu</em>} + \frac{1}{2}} \cdot \hat{H<em _vec_r="\vec{r">{\vec{r} + \frac{1}{2}} \
|
||||
\tilde{D}</em>
|
||||
\end{aligned} $$}} &= \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\hat{B}_{\vec{r}} &= \mu_{\vec{r} + \frac{1}{2}} \cdot \hat{H}_{\vec{r} + \frac{1}{2}} \\
|
||||
\tilde{D}_{\vec{r}} &= \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}}
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>where the spatial subscripts are abbreviated as <span class="arithmatex">\(\vec{r} = (m, n, p)\)</span> and
|
||||
<span class="arithmatex">\(\vec{r} + \frac{1}{2} = (m + \frac{1}{2}, n + \frac{1}{2}, p + \frac{1}{2})\)</span>,
|
||||
<span class="arithmatex">\(\tilde{E}\)</span> and <span class="arithmatex">\(\hat{H}\)</span> are the electric and magnetic fields,
|
||||
|
|
@ -2177,94 +2211,108 @@ r - 1/2 = | / | /
|
|||
</code></pre></div>
|
||||
<p>The divergence equations can be derived by taking the divergence of the curl equations
|
||||
and combining them with charge continuity,
|
||||
$$ \hat{\nabla} \cdot \tilde{J} + \hat{\partial}_t \rho = 0 $$
|
||||
implying that the discrete Maxwell's equations do not produce spurious charges.</p>
|
||||
|
||||
<div class="arithmatex">\[ \hat{\nabla} \cdot \tilde{J} + \hat{\partial}_t \rho = 0 \]</div></p>
|
||||
<p>implying that the discrete Maxwell's equations do not produce spurious charges.</p>
|
||||
<h4 id="meanas.fdmath--wave-equation">Wave equation<a class="headerlink" href="#meanas.fdmath--wave-equation" title="Permanent link">¶</a></h4>
|
||||
<p>Taking the backward curl of the <span class="arithmatex">\(\tilde{\nabla} \times \tilde{E}\)</span> equation and
|
||||
replacing the resulting <span class="arithmatex">\(\hat{\nabla} \times \hat{H}\)</span> term using its respective equation,
|
||||
and setting <span class="arithmatex">\(\hat{M}\)</span> to zero, we can form the discrete wave equation:</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &=
|
||||
\tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &=
|
||||
-\tilde{\partial}_t \hat{B}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}}
|
||||
- \hat{M}_{l-1, \vec{r} + \frac{1}{2}} \\
|
||||
\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &=
|
||||
\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}} &=
|
||||
-\tilde{\partial}_t \hat{H}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}} \\
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
||||
\hat{\nabla} \times (-\tilde{\partial}_t \hat{H}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}}) \\
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
||||
-\tilde{\partial}_t \hat{\nabla} \times \hat{H}_{l-\frac{1}{2}, \vec{r} + \frac{1}{2}} \\
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}}) &=
|
||||
-\tilde{\partial}_t \hat{\partial}_t \epsilon_{\vec{r}} \tilde{E}_{l, \vec{r}} + \hat{\partial}_t \tilde{J}_{l-\frac{1}{2},\vec{r}} \\
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{l,\vec{r}})
|
||||
+ \tilde{\partial}_t \hat{\partial}_t \epsilon_{\vec{r}} \cdot \tilde{E}_{l, \vec{r}}
|
||||
&= \tilde{\partial}_t \tilde{J}_{l - \frac{1}{2}, \vec{r}}
|
||||
&= \tilde{\partial}_t \tilde{J}_{l - \frac{1}{2}, \vec{r}}
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<h4 id="meanas.fdmath--frequency-domain">Frequency domain<a class="headerlink" href="#meanas.fdmath--frequency-domain" title="Permanent link">¶</a></h4>
|
||||
<p>We can substitute in a time-harmonic fields</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\tilde{E}_{l, \vec{r}} &= \tilde{E}_{\vec{r}} e^{-\imath \omega l \Delta_t} \\
|
||||
\tilde{J}_{l, \vec{r}} &= \tilde{J}_{\vec{r}} e^{-\imath \omega (l - \frac{1}{2}) \Delta_t}
|
||||
\tilde{E}_{l, \vec{r}} &= \tilde{E}_{\vec{r}} e^{-\imath \omega l \Delta_t} \\
|
||||
\tilde{J}_{l, \vec{r}} &= \tilde{J}_{\vec{r}} e^{-\imath \omega (l - \frac{1}{2}) \Delta_t}
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>resulting in</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\tilde{\partial}_t &\Rightarrow (e^{ \imath \omega \Delta_t} - 1) / \Delta_t = \frac{-2 \imath}{\Delta_t} \sin(\omega \Delta_t / 2) e^{-\imath \omega \Delta_t / 2} = -\imath \Omega e^{-\imath \omega \Delta_t / 2}\\
|
||||
\hat{\partial}_t &\Rightarrow (1 - e^{-\imath \omega \Delta_t}) / \Delta_t = \frac{-2 \imath}{\Delta_t} \sin(\omega \Delta_t / 2) e^{ \imath \omega \Delta_t / 2} = -\imath \Omega e^{ \imath \omega \Delta_t / 2}\\
|
||||
\Omega &= 2 \sin(\omega \Delta_t / 2) / \Delta_t
|
||||
\tilde{\partial}_t &\Rightarrow (e^{ \imath \omega \Delta_t} - 1) / \Delta_t = \frac{-2 \imath}{\Delta_t} \sin(\omega \Delta_t / 2) e^{-\imath \omega \Delta_t / 2} = -\imath \Omega e^{-\imath \omega \Delta_t / 2}\\
|
||||
\hat{\partial}_t &\Rightarrow (1 - e^{-\imath \omega \Delta_t}) / \Delta_t = \frac{-2 \imath}{\Delta_t} \sin(\omega \Delta_t / 2) e^{ \imath \omega \Delta_t / 2} = -\imath \Omega e^{ \imath \omega \Delta_t / 2}\\
|
||||
\Omega &= 2 \sin(\omega \Delta_t / 2) / \Delta_t
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>This gives the frequency-domain wave equation,</p>
|
||||
<div class="arithmatex">\[
|
||||
\hat{\nabla} \times (\mu^{-1}_{\vec{r} + \frac{1}{2}} \cdot \tilde{\nabla} \times \tilde{E}_{\vec{r}})
|
||||
-\Omega^2 \epsilon_{\vec{r}} \cdot \tilde{E}_{\vec{r}} = -\imath \Omega \tilde{J}_{\vec{r}} e^{\imath \omega \Delta_t / 2} \\
|
||||
\]</div>
|
||||
|
||||
<h4 id="meanas.fdmath--plane-waves-and-dispersion-relation">Plane waves and Dispersion relation<a class="headerlink" href="#meanas.fdmath--plane-waves-and-dispersion-relation" title="Permanent link">¶</a></h4>
|
||||
<p>With uniform material distribution and no sources</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\mu_{\vec{r} + \frac{1}{2}} &= \mu \\
|
||||
\epsilon_{\vec{r}} &= \epsilon \\
|
||||
\tilde{J}_{\vec{r}} &= 0 \\
|
||||
\mu_{\vec{r} + \frac{1}{2}} &= \mu \\
|
||||
\epsilon_{\vec{r}} &= \epsilon \\
|
||||
\tilde{J}_{\vec{r}} &= 0 \\
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>the frequency domain wave equation simplifies to</p>
|
||||
<div class="arithmatex">\[ \hat{\nabla} \times \tilde{\nabla} \times \tilde{E}_{\vec{r}} - \Omega^2 \epsilon \mu \tilde{E}_{\vec{r}} = 0 \]</div>
|
||||
|
||||
<p>Since <span class="arithmatex">\(\hat{\nabla} \cdot \tilde{E}_{\vec{r}} = 0\)</span>, we can simplify</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\hat{\nabla} \times \tilde{\nabla} \times \tilde{E}_{\vec{r}}
|
||||
&= \tilde{\nabla}(\hat{\nabla} \cdot \tilde{E}_{\vec{r}}) - \hat{\nabla} \cdot \tilde{\nabla} \tilde{E}_{\vec{r}} \\
|
||||
&= - \hat{\nabla} \cdot \tilde{\nabla} \tilde{E}_{\vec{r}} \\
|
||||
&= - \tilde{\nabla}^2 \tilde{E}_{\vec{r}}
|
||||
&= \tilde{\nabla}(\hat{\nabla} \cdot \tilde{E}_{\vec{r}}) - \hat{\nabla} \cdot \tilde{\nabla} \tilde{E}_{\vec{r}} \\
|
||||
&= - \hat{\nabla} \cdot \tilde{\nabla} \tilde{E}_{\vec{r}} \\
|
||||
&= - \tilde{\nabla}^2 \tilde{E}_{\vec{r}}
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>and we get</p>
|
||||
<div class="arithmatex">\[ \tilde{\nabla}^2 \tilde{E}_{\vec{r}} + \Omega^2 \epsilon \mu \tilde{E}_{\vec{r}} = 0 \]</div>
|
||||
<div class="arithmatex">\[ \tilde{\nabla}^2 \tilde{E}_{\vec{r}} + \Omega^2 \epsilon \mu \tilde{E}_{\vec{r}} = 0 \]</div>
|
||||
|
||||
<p>We can convert this to three scalar-wave equations of the form</p>
|
||||
<div class="arithmatex">\[ (\tilde{\nabla}^2 + K^2) \phi_{\vec{r}} = 0 \]</div>
|
||||
|
||||
<p>with <span class="arithmatex">\(K^2 = \Omega^2 \mu \epsilon\)</span>. Now we let</p>
|
||||
<div class="arithmatex">\[ \phi_{\vec{r}} = A e^{\imath (k_x m \Delta_x + k_y n \Delta_y + k_z p \Delta_z)} \]</div>
|
||||
<div class="arithmatex">\[ \phi_{\vec{r}} = A e^{\imath (k_x m \Delta_x + k_y n \Delta_y + k_z p \Delta_z)} \]</div>
|
||||
|
||||
<p>resulting in</p>
|
||||
<div class="arithmatex">\[
|
||||
\begin{aligned}
|
||||
\tilde{\partial}_x &\Rightarrow (e^{ \imath k_x \Delta_x} - 1) / \Delta_t = \frac{-2 \imath}{\Delta_x} \sin(k_x \Delta_x / 2) e^{ \imath k_x \Delta_x / 2} = \imath K_x e^{ \imath k_x \Delta_x / 2}\\
|
||||
\hat{\partial}_x &\Rightarrow (1 - e^{-\imath k_x \Delta_x}) / \Delta_t = \frac{-2 \imath}{\Delta_x} \sin(k_x \Delta_x / 2) e^{-\imath k_x \Delta_x / 2} = \imath K_x e^{-\imath k_x \Delta_x / 2}\\
|
||||
K_x &= 2 \sin(k_x \Delta_x / 2) / \Delta_x \\
|
||||
\tilde{\partial}_x &\Rightarrow (e^{ \imath k_x \Delta_x} - 1) / \Delta_t = \frac{-2 \imath}{\Delta_x} \sin(k_x \Delta_x / 2) e^{ \imath k_x \Delta_x / 2} = \imath K_x e^{ \imath k_x \Delta_x / 2}\\
|
||||
\hat{\partial}_x &\Rightarrow (1 - e^{-\imath k_x \Delta_x}) / \Delta_t = \frac{-2 \imath}{\Delta_x} \sin(k_x \Delta_x / 2) e^{-\imath k_x \Delta_x / 2} = \imath K_x e^{-\imath k_x \Delta_x / 2}\\
|
||||
K_x &= 2 \sin(k_x \Delta_x / 2) / \Delta_x \\
|
||||
\end{aligned}
|
||||
\]</div>
|
||||
|
||||
<p>with similar expressions for the y and z dimnsions (and <span class="arithmatex">\(K_y, K_z\)</span>).</p>
|
||||
<p>This implies</p>
|
||||
<div class="arithmatex">\[
|
||||
\tilde{\nabla}^2 = -(K_x^2 + K_y^2 + K_z^2) \phi_{\vec{r}} \\
|
||||
K_x^2 + K_y^2 + K_z^2 = \Omega^2 \mu \epsilon = \Omega^2 / c^2
|
||||
\]</div>
|
||||
|
||||
<p>where <span class="arithmatex">\(c = \sqrt{\mu \epsilon}\)</span>.</p>
|
||||
<p>Assuming real <span class="arithmatex">\((k_x, k_y, k_z), \omega\)</span> will be real only if</p>
|
||||
<div class="arithmatex">\[ c^2 \Delta_t^2 = \frac{\Delta_t^2}{\mu \epsilon} < 1/(\frac{1}{\Delta_x^2} + \frac{1}{\Delta_y^2} + \frac{1}{\Delta_z^2}) \]</div>
|
||||
<div class="arithmatex">\[ c^2 \Delta_t^2 = \frac{\Delta_t^2}{\mu \epsilon} < 1/(\frac{1}{\Delta_x^2} + \frac{1}{\Delta_y^2} + \frac{1}{\Delta_z^2}) \]</div>
|
||||
|
||||
<p>If <span class="arithmatex">\(\Delta_x = \Delta_y = \Delta_z\)</span>, this simplifies to <span class="arithmatex">\(c \Delta_t < \Delta_x / \sqrt{3}\)</span>.
|
||||
This last form can be interpreted as enforcing causality; the distance that light
|
||||
travels in one timestep (i.e., <span class="arithmatex">\(c \Delta_t\)</span>) must be less than the diagonal
|
||||
|
|
@ -2461,15 +2509,16 @@ mu = [mu_xx, mu_yy, mu_zz]
|
|||
</code></pre></div>
|
||||
<p>or</p>
|
||||
<div class="arithmatex">\[
|
||||
\epsilon = \begin{bmatrix} \epsilon_{xx} & 0 & 0 \\
|
||||
0 & \epsilon_{yy} & 0 \\
|
||||
0 & 0 & \epsilon_{zz} \end{bmatrix}
|
||||
$$
|
||||
$$
|
||||
\mu = \begin{bmatrix} \mu_{xx} & 0 & 0 \\
|
||||
0 & \mu_{yy} & 0 \\
|
||||
0 & 0 & \mu_{zz} \end{bmatrix}
|
||||
\epsilon = \begin{bmatrix} \epsilon_{xx} & 0 & 0 \\
|
||||
0 & \epsilon_{yy} & 0 \\
|
||||
0 & 0 & \epsilon_{zz} \end{bmatrix}
|
||||
\]</div>
|
||||
<div class="arithmatex">\[
|
||||
\mu = \begin{bmatrix} \mu_{xx} & 0 & 0 \\
|
||||
0 & \mu_{yy} & 0 \\
|
||||
0 & 0 & \mu_{zz} \end{bmatrix}
|
||||
\]</div>
|
||||
|
||||
<p>where the off-diagonal terms (e.g. <code>epsilon_xy</code>) are assumed to be zero.</p>
|
||||
<p>High-accuracy volumetric integration of shapes on multiple grids can be performed
|
||||
by the <a href="https://mpxd.net/code/jan/gridlock">gridlock</a> module.</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue