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.