feynman_kac_1d, an Octave 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 abd Octave versions 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 has been significantly improved.
The information on this web page is distributed under the MIT license.
feynman_kac_1d is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and an Octave version.
sde, an Octave code which solves certain stochastic differential equations.
stochastic_rk, an Octave code which applies a Runge-Kutta scheme to a stochastic differential equation.