feynman_kac_1d, a MATLAB code which demonstrates the use of the Feynman-Kac algorithm to solve Poisson's equation in a 1D interval by averaging stochastic paths to the boundary.
The program is intended as a simple demonstration of the method. The main purpose is to have a version that runs sequentially, so that it can be compared to versions which have been enhanced using parallel programming techniques.
The original version of this code used stepsize parameter H = 0.0001 and sample size N = 10,000. However, the MATLAB version of the code, with these parameters, ran much more slowly than the C, C++, F77 and F90 versions, and so H was increased to 0.01.
Thanks to some comments from Arno Petri (call rand() rather than r8_uniform_01()), and some other mysterious changes (comment out the return/end statements!) the performance of the MATLAB code has been significantly improved.
The computer code and data files described and made available on this web page are distributed under the MIT license
feynman_kac_1d is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
feynman_kac_2d, a MATLAB code which demonstrates the use of the Feynman-Kac algorithm to solve Poisson's equation in a 2D ellipse by averaging stochastic paths to the boundary.
feynman_kac_3d, a MATLAB code which demonstrates the use of the Feynman-Kac algorithm to solve Poisson's equation in a 3D ellipsoid by averaging stochastic paths to the boundary.
sde, a MATLAB code which solves certain stochastic differential equations.
stochastic_rk, a MATLAB code which applies a Runge-Kutta scheme to a stochastic differential equation.