close
The Wayback Machine - https://web.archive.org/web/20220731190721/https://github.com/zaman13/Poisson-solver-2D
Skip to content

zaman13/Poisson-solver-2D

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

Poisson-solver-2D

alt text alt text alt text

Finite difference solution of 2D Poisson equation Image

Image Image

Current version can handle Dirichlet, Neumann, and mixed (combination of Dirichlet and Neumann) boundary conditions:

Image (Dirichlet left boundary value)

Image (Dirichlet right boundary value)

Image (Dirichlet top boundary value)

Image (Dirichlet bottom boundary value)

Image (Dirichlet interior boundary value)

Image (Neumann left boundary value)

Image (Neumann right boundary value)

Image (Neumann left boundary value)

Image (Neumann right boundary value)

The boundary values themselves can be functions of (x,y).

Package requirements

  • NumPy
  • SciPy (sparse matrices, sparse linear algebra) Image Image

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 Image with boundary conditions Image is shown below:

Image

Dirichlet boundary conditions at outer wall and inner regions

Solution of Image with boundary conditions Image is shown below:

Image

Mixed boundary conditions (both Dirichlet and Neumann boundary conditions)

Solution of Image with boundary conditions Image (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:

Image

References