This plugin solves Exercise 2.2 of the "Introduction to Parallel Computing" book described at page 82 [1].

We solve a partial differential equation inside an elliptical region by Monte Carlo simulations of the Feynman-Kac formula. The following partial differential equation is defined in a three-dimensional ellipsoid

The goal is to solve this boundary value problem at by a Monte Carlo simulation. At the heart of the simulation lies the Feynman-Kac formula, which in our case () is

which describes the solution in terms of an expectation value of a stochastic process whose initial value . Here is a Brownian motion starting from and is its exit time from .

It is important to point out that the operator in simulation means for samples of size .

The plugin `pde3d.dll` can be called in two different ways:

0,[a],[b],[c],feynmankac3d 1,[a],[b],[c],[initialx],[initialy],[initialz],feynmankac3d

The first call passes the ellipses axes as parameter. The function
`feynmankac3d` stored in `pde3d.dll` generates first randomly
a point
inside the ellipse.
In the second call, we can specify the initial

From this initial interior point
we integrate
the following system of stochastic differential equations (
is a
Brownian motion). We use realizations of
to integrate.

For each realization, we integrate this set of equations until exits at time using the trapezoidal rule [1]. Finally, we compute to get the solution.

To plot the error, we compare it to the exact analytical solution of the partial differential equation, computed by two differentiations:

Roughly speaking, we free a horde of random walkers from an initial point. These walkers diffuse while is integrated with rate on the potential until they reach the boundary of the ellipse. All walks are averaged in a similar way as it is done with the

**Figure 13:**
GPU computing the Feynman-Kac problem and corresponding frontend.