Consider the problem $$(P) \qquad \begin{cases} \min\{\partial_t u - \Delta u, u -\varphi \} = 0 & \text{ in } (0,T)\times \mathbb{R}^N \\ u(0,\cdot) = \varphi(0,\cdot) & \text{ in } \mathbb{R}^N, \end{cases}$$

which is of interest in mathematical finance.

We can take the space dimension $$N =1,2, 3$$

and, for example, as initial datum,

phi[t,x] = E^(t)*(1+E^(x))

It is known that it admits one and only one strong solution (that is, a continuous Sobolev function that solves the problem almost everywhere and takes the initial datum pointwise) in the class of functions $|u(t,x)| \le Ce^{\lambda |x|^2}$ ($C,\lambda>0$).

The key point is that such solution can be obtained as the limit (as $\epsilon \to 0$) of the solutions to $$(P)_\varepsilon \qquad \begin{cases} \partial_t u - \Delta u = \frac{1}{\varepsilon}(u-\phi)^+ & \text{ in } (0,T)\times \mathbb{R}^N \\ u(0,\cdot) = \varphi(0,\cdot) & \text{ in } \mathbb{R}^N, \end{cases}$$

where $(u-\phi)^+ = \max\{u-\phi, 0\}$ is the positive part function.

How can I write a Mathematica code that plots and animates such solution to problem $(P)$ (approximated by solutions of $(P)_\varepsilon$ for $\varepsilon$ small enough)?

If we need to (do we?), we can solve the problem on $[0,T]×[−L,L]^N$ and impose the boundary condition $u(t,\pm L)=\varphi(\pm L)$.

  • 1
    $\begingroup$ I do not expect DSolve to find an analytic result for all such inputs. I meant that it handled your example above, with ic as initial condition, whereas NDSolve claims it is underdetermined and returns unevaluated. I realize DSolve does not handle the variant with the desired initial condition in place of ic. $\endgroup$ Jul 29, 2017 at 15:43
  • 2
    $\begingroup$ Also that question you link to is not, in my opinion, viable for this forum. There is no code to reproduce the issue, and moreover it appears not to go beyond what is already in this question. $\endgroup$ Jul 29, 2017 at 15:47
  • 4
    $\begingroup$ I do not understand the expression immediately following "Consider the problem" at the beginning of the question. Judging from the comments by others, I do not think that they understand it either. Please explain what you are trying to compute. $\endgroup$
    – bbgodfrey
    Aug 2, 2017 at 1:38
  • 2
    $\begingroup$ I think you can add a bit more background information to your question. Obstacle problem for the heat equation (together with those Sobolev function, etc.) are all unconversant terms (at least for me). Explaining them in more detail or adding some reference may attract more attention. $\endgroup$
    – xzczd
    Aug 9, 2017 at 10:59
  • 2
    $\begingroup$ Assuming you can code the $(\cdot)^+$ operator, whatever that is, the problem $(P)_\epsilon$ seems straightforward to code for NDSolve, unless you really want a solution for ${\bf R}^n$, for an indeterminate $n$. $\endgroup$
    – Michael E2
    Sep 17, 2017 at 0:24