|
numerics 0.1.0
|
2D Poisson equation solved via the Discrete Sine Transform. More...
#include "core/matrix.hpp"Go to the source code of this file.
Namespaces | |
| namespace | num |
| namespace | num::pde |
Functions | |
| Matrix | num::pde::poisson2d_fd (const Matrix &f, int N) |
| Solve \(-\Delta u=f\) using finite-difference eigenvalues. | |
| Matrix | num::pde::poisson2d (const Matrix &f, int N) |
| Solve \(-\Delta u=f\) using continuous eigenvalues \((k\pi)^2\). | |
2D Poisson equation solved via the Discrete Sine Transform.
Solves the homogeneous Dirichlet problem
\[ -\Delta u(x,y) = f(x,y), \qquad (x,y) \in (0,1)^2, \qquad u|_{\partial\Omega}=0 . \]
On an \(N \times N\) interior grid with \(h = 1/(N+1)\), the finite difference variant diagonalizes
\[ L_{2D} = L_{1D} \otimes I + I \otimes L_{1D} \]
with the DST-I basis
\[ \phi_k(j) = \sin\!\left(\frac{j k \pi}{N+1}\right). \]
The transformed solve is
\[ \hat{u}_{pq} = \frac{h^2 \hat{f}_{pq}} {2(1-\cos(p\pi/(N+1))) + 2(1-\cos(q\pi/(N+1)))} . \]
Definition in file poisson.hpp.