Poisson-solver-2D
Finite difference solution of 2D Poisson equation
Current version can handle Dirichlet, Neumann, and mixed (combination of Dirichlet and Neumann) boundary conditions:
(Dirichlet left boundary value)
(Dirichlet right boundary value)
(Dirichlet top boundary value)
(Dirichlet bottom boundary value)
(Dirichlet interior boundary value)
(Neumann right boundary value)
(Neumann right boundary value)
The boundary values themselves can be functions of (x,y).
Package requirements
Version notes
-
version 1.3
- It is now possible to apply Neumann and mixed boundary conditions
-
version 1.2
- It is now possible to define arbitrary Dirichlet boundary points at the interior of the solution domain
-
version 1.1
- Fixed a bug regarding the right-hand function
- Figure size and font size adjusted
-
version 1.0 notes
- Sparse matrix implementation. CSR format (Compressed sparse row matrix) matrix.
Sample Output
Dirichlet boundary conditions at outer walls
Solution of with boundary conditions is shown below:
Dirichlet boundary conditions at outer wall and inner regions
Solution of with boundary conditions is shown below:
Mixed boundary conditions (both Dirichlet and Neumann boundary conditions)
Solution of with boundary conditions (Dirichlet boundary condition on the left wall and in the region 1<x<1.4, -0.5<y<0.2. Neumann boundary conditions on the right, top and bottom walls.) is shown below:
References
- Sparse matrices: https://docs.scipy.org/doc/scipy/reference/sparse.html
- Sparse matrix linear algebra: https://docs.scipy.org/doc/scipy/reference/sparse.linalg.html