Laplacian in 1D, 2D, or 3D
Version 1.3 (28,8 KB) von
Andrew Knyazev
Sparse (1-3)D Laplacian on a rectangular grid with exact analytic eigenpairs.
Sure! Here’s your technical description restructured into a clean and informative README.md format—perfect for a GitHub repository:
Laplacian Eigenpair Computation
This MATLAB/Octave-compatible code computes analytically exact eigenpairs of the negative Laplacian operator in 1D, 2D, or 3D on a rectangular finite-difference grid. It supports a wide range of boundary condition combinations: Dirichlet (D), Neumann (N), and Periodic (P).
The first mandatory output is the sparse Laplacian matrix itself via Kronecker sums of 1D discrete Laplacians. The actual numerical entries of the matrix fit int8 format, but only double data class is yet supported for sparse matrices in MATLAB.
References
Examples
Compute both matrix and eigenpairs for a 3D Laplacian with mixed boundary conditions:
[A, lambda, V] = laplacian([100, 45, 55], {'DD', 'NN', 'P'}, 20);
Compute only the matrix:
A = laplacian([100, 45, 55], {'DD', 'NN', 'P'});
Features
- Supports Dirichlet, Neumann, and Periodic BCs (including mixed combinations)
- Computes eigenvalues and eigenvectors analytically using Kronecker structure
- Builds the Laplacian matrix directly
- Compatible with GNU Octave
Related Projects. This code is a part of the BLOPEX eigensolver package:
Notes
The Python multidimensional code in SciPy:
supports arbitrary dimensions, but it does not yet support mixed boundary conditions.
Authors
- Bryan C. Smith
- Andrew V. Knyazev
Zitieren als
Andrew Knyazev (2025). Laplacian in 1D, 2D, or 3D (https://de.mathworks.com/matlabcentral/fileexchange/27279-laplacian-in-1d-2d-or-3d), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2010b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxKategorien
- Mathematics and Optimization > Partial Differential Equation Toolbox > Domain-Specific Modeling > Electromagnetics >
- Mathematics and Optimization > Partial Differential Equation Toolbox > General PDEs > Eigenvalue Problems >
Mehr zu Electromagnetics finden Sie in Help Center und MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.3 | Corrected version number.
|
|
|
| 1.2 | Revision 1.1 changes: rearranged the output variables, always compute the eigenvalues, compute eigenvectors and/or the matrix on demand only.
|
|
|
| 1.1.0.0 | updated description |
||
| 1.0.0.0 |
