Laplace2DApp: 2D Laplace Temperature Solver GUI
Version 1.0.0 (12 KB) von
Abdelhamid Bouhelal
AppDesigner Graphical User Interface to solve 2D Laplace temperature on a rectangle with Dirichlet/Neumann (constant or expression) BCs.
Laplace2DApp is a professional MATLAB AppDesigner-style GUI for solving the steady-state 2D Laplace equation for temperature on a rectangular domain:∂2T∂x2+∂2T∂y2=0\frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2} = 0∂x2∂2T+∂y2∂2T=0
This corresponds to steady heat conduction in a homogeneous medium with no internal heat generation.
Key Features
- Rectangular domain: [0,Lx]×[0,Ly][0,Lx]\times[0,Ly][0,Lx]×[0,Ly]
- Finite-difference discretization on a uniform Cartesian grid (5-point Laplacian stencil for interior nodes)
- Boundary conditions per side (Left/Right/Bottom/Top):
- Dirichlet: T=g(x,y)T=g(x,y)T=g(x,y)
- Neumann: ∂T/∂n=q(x,y)\partial T/\partial n = q(x,y)∂T/∂n=q(x,y) using outward normal derivative
- Boundary values can be constants or spatially varying expressions using: x, y, Lx, Ly
- Direct solver (sparse backslash \) or Iterative solver (bicgstab)
- Visualization: Contour (with configurable levels) or Surface
- Export solution arrays to base workspace
How to Run
- Download and unzip
- In MATLAB, set folder as Current Folder (or add to path)
- Run:
app = Laplace2DApp;
Boundary Condition Input (Concise Examples)
Expressions may use x, y, Lx, Ly. For arrays, use element-wise operators: .* ./ .^
Dirichlet examples
- Left: 100
- Right: 0
- Bottom: 50*sin(pi*x/Lx)
- Top: 100 + 20*cos(2*pi*x/Lx)
Neumann examples (outward ∂T/∂n\partial T/\partial n∂T/∂n)
- Insulated wall: 0
- Left varying: 10*cos(pi*y/Ly)
- Top varying: 5*sin(2*pi*x/Lx)
Neumann outward sign convention
- Left (x=0): outward is −x
- Right (x=Lx): outward is +x
- Bottom (y=0): outward is −y
- Top (y=Ly): outward is +y
GUI Parameters (What Each Option Does)
- Lx, Ly: domain lengths
- Nx, Ny: number of grid nodes (higher → more accurate, slower)
- Plot = Contour/Surface: 2D filled contours or 3D surface
- Levels: number of contour levels (Contour mode)
- Solver = Direct / Iterative: \ (robust) or bicgstab (efficient for large grids)
- Show grid: toggles plot grid display (visual aid only)
- Solve: builds system A T=bA\,T=bAT=b, solves, plots, and reports residual
- Reset: restores default demo values and clears plot
- Export: sends T_laplace, x_laplace, y_laplace to base workspace
Outputs (Export Button)
- T_laplace : temperature field (size Nx × Ny)
- x_laplace : x grid vector
- y_laplace : y grid vector
Author / Citation
Dr. Abdelhamid BOUHELAL — 06 January 2026
If you use this app in academic work, please cite it accordingly:
Abdelhamid Bouhelal (2026). Laplace2DApp: 2D Laplace Temperature Solver GUI (https://www.mathworks.com/matlabcentral/fileexchange/<...>), MATLAB Central File Exchange. Retrieved January 6, 2026.
Zitieren als
Abdelhamid Bouhelal (2026). Laplace2DApp: 2D Laplace Temperature Solver GUI (https://de.mathworks.com/matlabcentral/fileexchange/182991-laplace2dapp-2d-laplace-temperature-solver-gui), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2025b
Kompatibel mit R2019b und späteren Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 1.0.0 |
