STOCHASTIC_DIFFUSION 
 Stochastic Diffusivity
    
    
    
      STOCHASTIC_DIFFUSION 
      is a FORTRAN90 library which 
      implement several versions of a stochastic diffusivity coefficient,
      using GNUPLOT to create graphic images of sample realizations of
      the diffusivity field.
    
    
      The 1D diffusion equation has the form
      
        - d/dx ( DC(X) d/dx U(X) ) = F(X).
      
      where DC(X) is a function called the diffusivity and F(X) is
      called the source term or forcing term.
    
    
      In the 1D stochastic version of the problem, the diffusivity function
      includes the influence of stochastic parameters:
      
        - d/dx ( DC(X;OMEGA) d/dx U(X;OMEGA) ) = F(X).
      
    
    
      The 2D diffusion equation has the form
      
        - Del ( DC(X,Y) Del U(X,Y) ) = F(X,Y).
      
    
    
      In the 2D stochastic version of the problem, the diffusivity function
      includes the influence of stochastic parameters:
      
        - Del ( DC(X,Y;OMEGA) Del U(X,Y;OMEGA) ) = F(X,Y).
      
    
    
      Licensing:
    
    
      The computer code and data files described and made available on this web page 
      are distributed under
      the GNU LGPL license.
    
    
      Languages:
    
    
      STOCHASTIC_DIFFUSION is available in
      a C version and
      a C++ version and
      a FORTRAN90 version and
      a MATLAB version.
    
    
      Related Data and Programs:
    
    
      
      BLACK_SCHOLES, 
      a FORTRAN90 library which
      implements some simple approaches to 
      the Black-Scholes option valuation theory;
    
    
      
      CORRELATION,
      a FORTRAN90 library which
      contains examples of statistical correlation functions.
    
    
      
      GNUPLOT,
      FORTRAN90 programs which illustrate how a program can write 
      data and command files so that gnuplot can create plots of the program results.
    
    
      
      ORNSTEIN_UHLENBECK,
      a FORTRAN90 library which 
      approximates solutions of the Ornstein-Uhlenbeck 
      stochastic differential equation (SDE) using the Euler method and
      the Euler-Maruyama method.
    
    
      
      PCE_ODE_HERMITE,
      a FORTRAN90 program which
      sets up a simple scalar ODE for exponential decay with an uncertain
      decay rate, using a polynomial chaos expansion in terms of Hermite polynomials.
    
    
      
      SDE, 
      a FORTRAN90 library which
      illustrates the properties of stochastic differential equations, and
      common algorithms for their analysis, 
      by Desmond Higham;
    
    
      Reference:
    
    
      
        - 
          Ivo Babuska, Fabio Nobile, Raul Tempone,
          A Stochastic Collocation Method for Elliptic Partial Differential Equations 
          with Random Input Data,
          SIAM Journal on Numerical Analysis,
          Volume 45, Number 3, 2007, pages 1005-1034.
         
        - 
          Howard Elman, Darran Furnaval,
          Solving the stochastic steady-state diffusion problem using multigrid,
          IMA Journal on Numerical Analysis,
          Volume 27, Number 4, 2007, pages 675-688.
         
        - 
          Roger Ghanem, Pol Spanos,
          Stochastic Finite Elements: A Spectral Approach,
          Revised Edition,
          Dover, 2003,
          ISBN: 0486428184,
          LC: TA347.F5.G56.
         
        - 
          Xiang Ma, Nicholas Zabaras,
          An adaptive hierarchical sparse grid collocation algorithm for the solution
          of stochastic differential equations,
          Journal of Computational Physics,
          Volume 228, pages 3084-3113, 2009.
         
        - 
          Fabio Nobile, Raul Tempone, Clayton Webster,
          A Sparse Grid Stochastic Collocation Method for Partial Differential
          Equations with Random Input Data,
          SIAM Journal on Numerical Analysis,
          Volume 46, Number 5, 2008, pages 2309-2345.
         
        - 
          Dongbin Xiu, George Karniadakis,
          Modeling uncertainty in steady state diffusion problems via
          generalized polynomial chaos,
          Computer Methods in Applied Mechanics and Engineering,
          Volume 191, 2002, pages 4927-4948.
         
      
    
    
      
    
    
      Examples and Tests:
    
    
      
    
    
      The test program makes a set of command and data files that can be used
      by GNUPLOT to create graphic images.
      
        - 
          bnt_data.txt,
          the graphics data file.
        
 
        - 
          bnt_commands.txt,
          the GNUPLOT command file.
        
 
        - 
          bnt_contour.png,
          a plot of the diffusivity as a function of X and Y.
        
 
        - 
          elman_data.txt,
          the graphics data file.
        
 
        - 
          elman_commands.txt,
          the GNUPLOT command file.
        
 
        - 
          elman_contour.png,
          a plot of the diffusivity as a function of X and Y.
        
 
        - 
          ntw_data.txt,
          the graphics data file.
        
 
        - 
          ntw_commands.txt,
          the GNUPLOT command file.
        
 
        - 
          ntw_contour.png,
          a plot of the diffusivity as a function of X and Y.
        
 
        - 
          xk_data.txt,
          the graphics data file.
        
 
        - 
          xk_commands.txt,
          the GNUPLOT command file.
        
 
        - 
          xk_contour.png,
          a plot of the diffusivity as a function of X.
        
 
      
    
    
      List of Routines:
    
    
      
        - 
          DIFFUSIVITY_1D_XK evaluates a 1D stochastic diffusivity function.
        
 
        - 
          DIFFUSIVITY_2D_BNT evaluates a 2D stochastic diffusivity function.
        
 
        - 
          DIFFUSIVITY_2D_ELMAN evaluates a 2D stochastic diffusivity function.
        
 
        - 
          DIFFUSIVITY_2D_NTW evaluates a 2D stochastic diffusivity function.
        
 
        - 
          GET_UNIT returns a free FORTRAN unit number.
        
 
        - 
          R8_EPSILON returns the R8 roundoff unit.
        
 
        - 
          R8_UNIFORM_01 returns a unit pseudorandom R8.
        
 
        - 
          R8MAT_MAX returns the maximum entry of an R8MAT.
        
 
        - 
          R8VEC_LINSPACE creates a vector of linearly spaced values.
        
 
        - 
          R8VEC_MAX returns the maximum value in an R8VEC.
        
 
        - 
          R8VEC_MESH_2D creates a 2D mesh from X and Y vectors.
        
 
        - 
          R8VEC_NORMAL_01 returns a unit pseudonormal R8VEC.
        
 
        - 
          R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.
        
 
        - 
          THETA_SOLVE solves a pair of transcendental equations.
        
 
        - 
          TIMESTAMP prints the current YMDHMS date as a time stamp.
        
 
      
    
    
      You can go up one level to 
      the FORTRAN90 source codes.
    
    
    
      Last modified on 22 July 2013.