3
$\begingroup$

I am trying to solve numerically Kolmogorov backward PDE with boundary conditions:

\[Sigma] = 0.1; \[Mu] = 0.05; k = 1; T = 1; 
sol = NDSolve[{D[p[a, t], t] + (1/2)*\[Sigma]^2*a^2*D[p[a, t], a, a] + \[Mu]*a*D[p[a, t], a] == 0, 
    p[k, t] == 1, p[a, T] == 0}, p, {a, 1, 10}, {t, 0, 1}]

But it first complains about the boundary conditions (which in a way I can understand because of the p[1,1] point). But more importantly the outputted solution is nonsensical:

Plot3D[Evaluate[p[a, t] /. sol], {a, 1, 10}, {t, 0, 1}]

The physical problem I am trying to solve is the following: what is the probability of default of a firm with debt k and assets given by ito process (variable a). If a=k then the firm has defaulted, hence the first boundary condition. If a>k and t=T (T is the final point) then the probability of default is zero (no time left). This makes perfect sense to me, but something is not right mathematically (or programmatically). Any ideas?

Update

Following xzczd's advice in the comments, I added a condition at infinity (a=10). I also introduced UnitStep function to make boundary conditions consistent and stop the warning.

\[Sigma] = 0.1; \[Mu] = 0.05; k = 1; T = 1; 
sol = NDSolve[{D[p[a, t], t] + (1/2)*\[Sigma]^2*a^2*D[p[a, t], a, a] + \[Mu]*a*D[p[a, t], a] == 0, 
    p[k, t] == 1, p[a, T] == UnitStep[k - a], p[10*k, t] == 0}, p, {a, 1, 3}, {t, 0, 1}]
$\endgroup$
3
  • 1
    $\begingroup$ You haven't set enough b.c., which leads to bcart warning. This is a serious problem. Check the following for more info: mathematica.stackexchange.com/q/73961/1871 $\endgroup$
    – xzczd
    Jan 31 '20 at 11:01
  • $\begingroup$ But the initial boundary conditions I imposed seem to be sufficient, from mathematical standpoint, for a parabolic PDE as backward Kolmogorov equation is. I don't see any logical issue with them. $\endgroup$
    – Al Guy
    Jan 31 '20 at 20:14
  • 1
    $\begingroup$ As mentioned in my last comment, what's not sufficient is boundary condition (b.c.). You're probably solving the problem in a semi-infinite domain, and you need one more b.c. approximating b.c. at infinity, which is often given implicitly when analytically solving the problem. For more info you may check the tag [boundary-condition-at-infinity]. $\endgroup$
    – xzczd
    Feb 1 '20 at 1:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.