dg1d_poisson


dg1d_poisson, an Octave code 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 an Octave version and a Python version.

Related Data and Programs:

dg1d_poisson_test

bvp4c_test, an Octave code which illustrates how to use the MATLAB command bvp4c(), which can solve boundary value problems (BVP) in one spatial dimension.

dg1d_heat, an Octave code 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, an Octave code 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, an Octave code which applies the finite difference method (FDM) 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, an Octave code which applies the finite difference method (FDM) in space, and the Forward Time Centered Space (FTCS) method in time, to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity.

fd1d_advection_lax_wendroff, an Octave code which applies the finite difference method (FDM) in space and the Lax-Wendroff method in time to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity.

fd1d_burgers_lax, an Octave code which applies the finite difference method (FDM) in space and the Lax-Wendroff method in time to solve the non-viscous time-dependent Burgers equation in one spatial dimension.

fd1d_burgers_leap, an Octave code which applies the finite difference method (FDM) in space and the leapfrog method in time, to solve the non-viscous time-dependent Burgers equation in one spatial dimension.

fd1d_bvp, an Octave code which applies the finite difference method (FDM) to a two point boundary value problem (BVP) in one spatial dimension.

fd1d_heat_explicit, an Octave code which uses the finite difference method (FDM) and explicit Euler method in time, to solve the time dependent heat equation in 1d.

fd1d_heat_implicit, an Octave code which uses the finite difference method (FDM) in space, and the implicit Euler method in time, to solve the time dependent heat equation in 1d.

fd1d_heat_steady, an Octave code which uses the finite difference method (FDM) to solve the steady (time independent) heat equation in 1d.

fd1d_predator_prey, an Octave code which implements a finite difference method (FDM) for a predator-prey system with spatial variation in 1d.

fd1d_wave, an Octave code which applies the finite difference method (FDM) to solve the time-dependent wave equation in one spatial dimension.

fem1d, an Octave code which applies the finite element method (FEM) to a linear two point boundary value problem (BVP) in a 1d region.

fem1d_bvp_linear, an Octave code which applies the finite element method (FEM), with piecewise linear elements, to a two point boundary value problem (BVP) in one spatial dimension.

Author:

Beatrice Riviere

Reference:

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

Source Code:


Last modified on 01 July 2023.