Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor Nonlinear, Vibrations, and Truncation chapters
- Fix broken LaTeX subscripts (**{ → _{) in:
  - nonlin_pde1D.qmd (12 occurrences)
  - nonlin_split.qmd (3 occurrences)
  - vib_undamped.qmd (2 occurrences)
  - trunc.qmd (4 occurrences)
- Remove NumPy files from src/nonlin/ (keep Devito implementations)
- Delete chapters/nonlin/exer-nonlin/ exercise directory

Vibrations chapter (ODE-focused) retains NumPy implementations.

All 247 tests pass, PDF builds without errors.
  • Loading branch information
ggorman committed Feb 1, 2026
commit 27f4a0ea77ab9776aae3fa2a448ed0f7334fb4c9
8 changes: 4 additions & 4 deletions chapters/appendices/trunc/trunc.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -1644,12 +1644,12 @@ $[D_xD_x (D_tD_t u)]^n_i$ gives

\begin{align*}
\frac{1}{\Delta t^2}\biggl(
&\frac{u^{n+1}**{i+1} - 2u^{n}**{i+1} + u^{n-1}_{i+1}}{\Delta x^2} -2\\
&\frac{u^{n+1}**{i} - 2u^{n}**{i} + u^{n-1}_{i}}{\Delta x^2} +
&\frac{u^{n+1}**{i-1} - 2u^{n}**{i-1} + u^{n-1}_{i-1}}{\Delta x^2}
&\frac{u^{n+1}_{i+1} - 2u^{n}_{i+1} + u^{n-1}_{i+1}}{\Delta x^2} -2\\
&\frac{u^{n+1}_{i} - 2u^{n}_{i} + u^{n-1}_{i}}{\Delta x^2} +
&\frac{u^{n+1}_{i-1} - 2u^{n}_{i-1} + u^{n-1}_{i-1}}{\Delta x^2}
\biggr)
\end{align*}
Now the unknown values $u^{n+1}**{i+1}$, $u^{n+1}**{i}$,
Now the unknown values $u^{n+1}_{i+1}$, $u^{n+1}_{i}$,
and $u^{n+1}_{i-1}$ are *coupled*, and we must solve a tridiagonal
system to find them. This is in principle straightforward, but it
results in an implicit finite difference scheme, while we had
Expand Down
83 changes: 0 additions & 83 deletions chapters/nonlin/exer-nonlin/fu_fem_int.py

This file was deleted.

180 changes: 0 additions & 180 deletions chapters/nonlin/exer-nonlin/logistic_p.py

This file was deleted.

34 changes: 0 additions & 34 deletions chapters/nonlin/exer-nonlin/product_arith_mean_sympy.py

This file was deleted.

32 changes: 16 additions & 16 deletions chapters/nonlin/nonlin_pde1D.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,12 @@ We must then replace $u_{-1}$ by
With Picard iteration we get

\begin{align*}
\frac{1}{2\Delta x^2}(& -(\dfc(u^-**{-1}) + 2\dfc(u^-**{0})
\frac{1}{2\Delta x^2}(& -(\dfc(u^-_{-1}) + 2\dfc(u^-_{0})
+ \dfc(u^-_{1}))u_1\, +\\
&(\dfc(u^-**{-1}) + 2\dfc(u^-**{0}) + \dfc(u^-_{1}))u_0
&(\dfc(u^-_{-1}) + 2\dfc(u^-_{0}) + \dfc(u^-_{1}))u_0
+ au_0\\
&=f(u^-_0) -
\frac{1}{\dfc(u^-**0)\Delta x}(\dfc(u^-**{-1}) + \dfc(u^-_{0}))C,
\frac{1}{\dfc(u^-_0)\Delta x}(\dfc(u^-_{-1}) + \dfc(u^-_{0}))C,
\end{align*}
where
$$
Expand All @@ -540,18 +540,18 @@ condition as a separate equation, (@eq-nonlin-alglevel-1D-fd-2x2-x1)
with Picard iteration becomes

\begin{align*}
\frac{1}{2\Delta x^2}(&-(\dfc(u^-**{0}) + \dfc(u^-**{1}))u_{0}\, + \\
&(\dfc(u^-**{0}) + 2\dfc(u^-**{1}) + \dfc(u^-_{2}))u_1\, -\\
&(\dfc(u^-**{1}) + \dfc(u^-**{2})))u_2 + au_1
\frac{1}{2\Delta x^2}(&-(\dfc(u^-_{0}) + \dfc(u^-_{1}))u_{0}\, + \\
&(\dfc(u^-_{0}) + 2\dfc(u^-_{1}) + \dfc(u^-_{2}))u_1\, -\\
&(\dfc(u^-_{1}) + \dfc(u^-_{2})))u_2 + au_1
=f(u^-_1)\tp
\end{align*}
We must now move the $u_2$ term to the right-hand side and replace all
occurrences of $u_2$ by $D$:

\begin{align*}
\frac{1}{2\Delta x^2}(&-(\dfc(u^-**{0}) + \dfc(u^-**{1}))u_{0}\, +\\
& (\dfc(u^-**{0}) + 2\dfc(u^-**{1}) + \dfc(D)))u_1 + au_1\\
&=f(u^-**1) + \frac{1}{2\Delta x^2}(\dfc(u^-**{1}) + \dfc(D))D\tp
\frac{1}{2\Delta x^2}(&-(\dfc(u^-_{0}) + \dfc(u^-_{1}))u_{0}\, +\\
& (\dfc(u^-_{0}) + 2\dfc(u^-_{1}) + \dfc(D)))u_1 + au_1\\
&=f(u^-_1) + \frac{1}{2\Delta x^2}(\dfc(u^-_{1}) + \dfc(D))D\tp
\end{align*}

The two equations can be written as a $2\times 2$ system:
Expand All @@ -573,19 +573,19 @@ $$
where

\begin{align}
B_{0,0} &=\frac{1}{2\Delta x^2}(\dfc(u^-**{-1}) + 2\dfc(u^-**{0}) + \dfc(u^-_{1}))
B_{0,0} &=\frac{1}{2\Delta x^2}(\dfc(u^-_{-1}) + 2\dfc(u^-_{0}) + \dfc(u^-_{1}))
+ a,\\
B_{0,1} &=
-\frac{1}{2\Delta x^2}(\dfc(u^-**{-1}) + 2\dfc(u^-**{0})
-\frac{1}{2\Delta x^2}(\dfc(u^-_{-1}) + 2\dfc(u^-_{0})
+ \dfc(u^-_{1})),\\
B_{1,0} &=
-\frac{1}{2\Delta x^2}(\dfc(u^-**{0}) + \dfc(u^-**{1})),\\
-\frac{1}{2\Delta x^2}(\dfc(u^-_{0}) + \dfc(u^-_{1})),\\
B_{1,1} &=
\frac{1}{2\Delta x^2}(\dfc(u^-**{0}) + 2\dfc(u^-**{1}) + \dfc(D)) + a,\\
\frac{1}{2\Delta x^2}(\dfc(u^-_{0}) + 2\dfc(u^-_{1}) + \dfc(D)) + a,\\
d_0 &=
f(u^-_0) -
\frac{1}{\dfc(u^-**0)\Delta x}(\dfc(u^-**{-1}) + \dfc(u^-_{0}))C,\\
d_1 &= f(u^-**1) + \frac{1}{2\Delta x^2}(\dfc(u^-**{1}) + \dfc(D))D\tp
\frac{1}{\dfc(u^-_0)\Delta x}(\dfc(u^-_{-1}) + \dfc(u^-_{0}))C,\\
d_1 &= f(u^-_1) + \frac{1}{2\Delta x^2}(\dfc(u^-_{1}) + \dfc(D))D\tp
\end{align}

The system with the Dirichlet condition becomes
Expand All @@ -611,7 +611,7 @@ with

\begin{align}
B_{1,1} &=
\frac{1}{2\Delta x^2}(\dfc(u^-**{0}) + 2\dfc(u^-**{1}) + \dfc(u_2)) + a,\\
\frac{1}{2\Delta x^2}(\dfc(u^-_{0}) + 2\dfc(u^-_{1}) + \dfc(u_2)) + a,\\
B_{1,2} &= -
\frac{1}{2\Delta x^2}(\dfc(u^-_{1}) + \dfc(u_2))),\\
d_1 &= f(u^-_1)\tp
Expand Down
Loading
Loading