DG1D_POISSON is a Python library which uses the Discontinuous Galerkin Method (DG) to approximate a solution of the 1D Poisson Equation. The code is based on a MATLAB code written by Beatrice Riviere, and later translated to Python by Alex Lindsay.
A 1D version of the Poisson equation has the form
- ( K(x) u'(x) )' = f(x) for 0 < x < 1 u(0) = 1 u(1) = 0Here, we will assume that K(x) = 1.
DG1D_POISSON computes an approximate discrete solution to the problem, using a version of the Discontinuous Galerkin method. The interval [0,1] is divided into equal subintervals, over each of which a set of basis monomials are defined, centered at the midpoint of the subinterval, and normalized to have unit value at the subinterval endpoints.
The discontinous Galerkin equations are then set up as the linear system A*c=b, where c represents the coefficients of the basis functions. The result of solving this system can then be used to tabulate, evaluate, or plot the approximate DG solution function.
DG1D_POISSON is available in a MATLAB version and a Python version.
FD1D_ADVECTION_LAX_WENDROFF, a Python program which applies the finite difference method to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity, using the Lax-Wendroff method to treat the time derivative.
FD1D_HEAT_EXPLICIT, a Python program which uses the finite difference method and explicit time stepping to solve the time dependent heat equation in 1D.
FD1D_HEAT_IMPLICIT, a Python program which uses the finite difference method and implicit time stepping to solve the time dependent heat equation in 1D.
FD1D_HEAT_STEADY, a Python program which uses the finite difference method to solve the steady (time independent) heat equation in 1D.
FEM1D, a Python program which applies the finite element method to a linear two point boundary value problem in a 1D region.
FEM1D_BVP_LINEAR, a Python program which applies the finite element method, with piecewise linear elements, to a two point boundary value problem in one spatial dimension.
FEM1D_BVP_QUADRATIC, a Python program which applies the finite element method, with piecewise quadratic elements, to a two point boundary value problem in one spatial dimension.
You can go up one level to the Python source codes.