# DG1D_POISSON Discontinuous Galerkin Solution of 1D Poisson Equation

DG1D_POISSON is a MATLAB library which uses the Discontinuous Galerkin Method (DG) to approximate a solution of the 1D Poisson Equation. The code was written by Beatrice Riviere.

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) = 0

Here, 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.

### Languages:

DG1D_POISSON is available in a MATLAB version and a Python version.

### Related Data and Programs:

BVP4C, MATLAB programs which illustrate how to use the MATLAB command bvp4c(), which can solve boundary value problems (BVP's) in one spatial dimension.

DG1D_HEAT, a MATLAB library which uses the Discontinuous Galerkin Method (DG) to approximate a solution of the unsteady 1D heat Equation. The original version of the code was written by Jan Hesthaven and Tim Warburton.

DG1D_MAXWELL, a MATLAB library which uses the Discontinuous Galerkin Method (DG) to approximate a solution of Maxwell's equations. The original version of the code was written by Jan Hesthaven and Tim Warburton.

FD1D_ADVECTION_DIFFUSION_STEADY, a MATLAB program which applies the finite difference method to solve the steady advection diffusion equation v*ux-k*uxx=0 in one spatial dimension, with constant velocity v and diffusivity k.

FD1D_ADVECTION_FTCS, a MATLAB 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 FTCS method, forward time difference, centered space difference.

FD1D_ADVECTION_LAX_WENDROFF, a MATLAB 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_BURGERS_LAX, a MATLAB program which applies the finite difference method and the Lax-Wendroff method to solve the non-viscous time-dependent Burgers equation in one spatial dimension.

FD1D_BURGERS_LEAP, a MATLAB program which applies the finite difference method and the leapfrog approach to solve the non-viscous time-dependent Burgers equation in one spatial dimension.

FD1D_BVP, a MATLAB program which applies the finite difference method to a two point boundary value problem in one spatial dimension.

FD1D_HEAT_EXPLICIT, a MATLAB program which uses the finite difference method and explicit time stepping to solve the time dependent heat equation in 1D.

FD1D_HEAT_IMPLICIT, a MATLAB program which uses the finite difference method and implicit time stepping to solve the time dependent heat equation in 1D.

FD1D_HEAT_STEADY, a MATLAB program which uses the finite difference method to solve the steady (time independent) heat equation in 1D.

FD1D_PREDATOR_PREY, a MATLAB program which implements a finite difference algorithm for predator-prey system with spatial variation in 1D.

FD1D_WAVE, a MATLAB program which applies the finite difference method to solve the time-dependent wave equation in one spatial dimension.

FEM1D, a MATLAB program which applies the finite element method to a linear two point boundary value problem in a 1D region.

FEM1D_BVP_LINEAR, a MATLAB program which applies the finite element method, with piecewise linear elements, to a two point boundary value problem in one spatial dimension.

Beatrice Riviere

### Reference:

1. Beatrice Riviere,
Discontinuous Galerkin Methods for Solving Elliptic and Parabolic Equations,
SIAM, 2008,
ISBN: 978-0-898716-56-6