# 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] + rS D[V[S, t], S] + 0.5 sigmasigma(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.
Answer
11 days 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:
Answer
10 days ago
 Thanks Mariusz, that was helpful. Is there a function in Mathematica that can produce analytical solutions for this without requiring any numbers?I tried using DSolve instead of NDSolve, and this works fine from an operational point of view, but doesn't really give a solution. The output is just a summarized version of the setup.
Answer
10 days ago
 Well,it depends on the initial and boundary condition.DSolve can't handle in Your case. Maybe in the future Wolfram Research improve DSolve for more cases to solve more equations. In Mathematica DSolve is now only one function which can solve it symbollicaly.I'm tried solve symbolically Yours case with Maple ,but not success.Regards Mariusz.PS: See this
Answer
10 days ago
 OK, got it. Thanks Mariusz, you were very helpful.
Answer
10 days ago