# What's a good numerical/optimization software package for solving the 2-D optimal stopping problem?

I am looking for a numerical software package to help me solve the 2-dimensional "free boundary" PDEs that arise in optimal stopping problems. In one dimension a standard optimal stopping problem in Economics is when to exercise an expansion option. In the end, solving this problem comes down to solving the following ODE

$$\mu x u' + \frac{1}{2}\sigma^2 x^2 u'' + x k_0= r u$$ such that \begin{eqnarray} u(0) & =& 0 \\ u(\overline{x}) & =& \frac{\overline{x}k_1}{r-\mu} - p\\ u'(\overline{x}) & = & \frac{k_1}{r-\mu}. \end{eqnarray} A solution to this problem is a function $u$ together with the location of the boundary $\overline{x}$ - this is the so called "free boundary". This problem has a closed form solution. In two dimensions, the problem no longer has a closed form solution. The problem I want to solve is $$x k_0 + \mu x \frac{\partial u}{\partial x}+ rw\frac{\partial u}{\partial w} + \frac{1}{2} x^2 \left(\sigma_x^2\frac{\partial^2 u}{\partial x^2} + \sigma_w^2 \frac{\partial^2 u}{\partial w^2} + 2\sigma_x\sigma_w \frac{\partial^2 u}{\partial x\partial w}\right) = r u$$ such that \begin{eqnarray} u(0,w) & = & 0\\ u(\overline{x}(w),w) & = & v(\overline{x}(w),w) - p \\ \frac{\partial}{\partial x}u(\overline{x}(w),w) & = & \frac{\partial}{\partial x}v(\overline{x}(w),w) \\ u(x,0) &= & \ell x \\ \frac{\partial}{\partial w}u(x,\overline{w}) & = & -1 \\ \frac{\partial^2}{\partial w^2}u(x,\overline{w}) & = & 0 \\ \end{eqnarray}

where $v$ is some known function of $x$ and $w$. The solution of this problem will then be a function $u$ together with functions $\overline{x}(w)$ and $\overline{w}(x)$ that give the locations of the boundaries.

Do you know of any software packages that can solve these free boundary problems? If so, can someone point me towards a reference or tutorial that might help?

• Hi Prof. Glaser, welcome to scicomp, and nice meeting you on the bus to the airport! I don't think you want OpenFOAM for this, but I'm not actually sure what the appropriate solver is. I'm going to reframe your question a little so that it gets more attention, feel free to revert or fix any edits I make. Sep 18 '12 at 18:50
• Hi Aron, it was good to meet you too. Thanks so much for your help with the question! Sep 19 '12 at 1:11