Consider a geometric Brownian motion

and a stopping time, for some

We will use Matlab function ‘pdepe’ to find the numerical solution of

We use the following values for the coefficients:

**Proposition 1** * is the unique classical solution of the following parabolic PDE backward in time: *

* *

Matlab function ‘pdepe’ can solve the following specific form of PDE forward in time:

Let , then (1) becomes (2) with

Now, we are ready for the code with the above datas. For Matlab code, please download it from here, then save it with file name ‘Etau.m’, then run it in Matlab. For example, we find

This code also plots 3-D pictures for the numerical solution, EtauFig1

### Like this:

Like Loading...

when i run it it gives error any ideas?

I don’t know.

I tried to download the MATLAB code; but I couldn’t. May you please check whether it is working or not? If not may you please fix the problem.

Thank you so much!