I was trying to come up a some numerical solution to the following PDE system, but it failed for a good reason. Is there a way that we can get around it?
r = 0.1; σ = 0.2; K = 40; n = 20; T = 1; q = 0.05;
sol2 = NDSolve[{Min[-D[c[S, t], t] -
1/2 σ^2 S^2 D[c[S, t], {S, 2}] -
D[c[S, t], S] (r - q) S + r c[S, t], c[S, t] - (S - K)] == 0,
c[0, t] == 0,
c[S, T] == (S - K) Boole[S > K],
c[3 K, t] == 3 K - K E^(-r (T - t))
}, c, {t, 0, T}, {S, 0, 120}
]
Kis used as a dummy variable in solutions expressed in terms of sums and integrals. Probably not an issue here, but it's a good habit. – Michael E2 May 16 '17 at 20:42NDSolvecan handle this directly as a PDE, but maybe it could with a system of ODEs, for which more robust discontinuity processing is available. – Michael E2 May 16 '17 at 22:32Minwill still not allow it. – Al Guy May 17 '17 at 00:47Min,NDSolvewill have trouble in solving the problem, because part of the equation is inverse problem for parabolic equation (the i.c. is given atT, while you're solving the equation fromTto0), which is a well-known ill-posed problem. – xzczd May 17 '17 at 03:19