Skip to content

A framework for numerical solution of Elliptic Partial Differential Equations

Notifications You must be signed in to change notification settings

prateekr9SF/Numerical_PDE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poisson's Equation Solver

This repository contains a Python script for solving the Poisson's equation numerically.

Description

The Poisson's equation is an elliptic partial differential equation of the form:

$\nabla^2u=f$

In this framework, we solve the Poisson equation in a 2D domain using the finite difference method. Rewriting the Poisson's equation yields:

$\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2} = f(x,y)$,

where the partial derivatives are computed using the second-order finite differnece method:

$\frac{u_{i+1,j} - 2u_{i,j} + u_{i-1,j}}{\Delta x^2} + \frac{u_{i,j+1} - 2u_{i,j} + u_{i,j-1}}{\Delta y^2} = f_{i,j}$.

Rearanging the above equation yields:

$u_{i,j} = \frac{\Delta x^2 \Delta y^2 f_{i,j} + \Delta y^2 (u_{i-1,j} + u_{i+1,j}) + \Delta x^2 (u_{i,j-1} + u_{i,j+1})}{2(\Delta x^2 + \Delta y^2)}$

Installation

To use this script, you need to have Python installed on your machine. You can download Python here.

You also need to have the following Python libraries installed:

  • NumPy
  • Matplotlib

You can install these libraries using the following commands:

pip install numpy pip install matlotlib

Usage

To run the script, navigate to the directory containing the script and run the following command:

python3 main.py

This will solve the Poisson equation and display the results in a 3D plot.

About

A framework for numerical solution of Elliptic Partial Differential Equations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages