[✓] Solve a Black-Scholes PDE?

GROUPS:
 I wanted to see if anyone had the setup for solving the Black-Scholes PDE and deriving the final version of the options pricing formula. With some help from Youtube, I have managed to find a setup that comes up with a specific price for an option contract given some numbers, but I'm looking for the general form with no numbers in it. I have the following form at the moment: sol = NDSolve[{D[V[S, t], t] + r*S *D[V[S, t], S] + 0.5 *sigma*sigma*(S^2)*D[V[S, t], {S, 2}] - r*V[S, t] == 0, V[S, 1] == Max[S - K, 0], V[1000, t] == 1000 - K, V[0, t] == 0}, V, {S, 0.1, 1000}, {t, 0, 1}] The specification of time seems to be the problem in coming up with a solution. When I specify t as going from 0 to T Mathematica does not like that T is not a number. When I put in an arbitrarily chosen number (like t going from 0 to 1 above) it doesn't like it because it generates a non-numerical value when t is the upper limit (whatever number is used, not just for 1)If anybody has the general form for solving Black-Scholes or can offer any help on this problem I'd greatly appreciate it.
1 year ago
4 Replies
 Hello Ryan.NDSolve is a numeric solver,you must first assign numerical values to constans.  k = 100; sigma = 0.2; r = 5/100; PDE = D[V[S, t], t] + r*S*D[V[S, t], S] + sigma^2/2*S^2*D[V[S, t], {S, 2}] - r*V[S, t] == 0; COND = {V[S, 1] == Max[S - k, 0], V[1000, t] == 1000 - k, V[0, t] == 0}; sol = NDSolve[{PDE, COND}, V, {S, 0.1, 1000}, {t, 0, 1}] // Quiet Plot3D[V[S, t] /. sol, {S, 0.1, 1000}, {t, 0, 1}, AxesLabel -> Automatic] Regards Mariusz. Attachments: