1

I am given the Black Scholes equation as $$\frac{\partial c(t, s)}{\partial t}+\frac{1}{2} s^2 \sigma^2 \frac{\partial ^2c(t, s)} {\partial s^2} + r s\frac{\partial c(t, s)}{\partial s} − rc(t, s) = 0 $$ with terminal and boundary conditions $$c(T,s) = max(s-k,0)$$ $$c(t,0)=0$$ where t $\in$ [0,T]. I have to use finite differencing and runge-kutta to solve this equation and then plot $c(t,s)$ for s $\in$ [10,100] for $k=100, \sigma = 0.2, T=1, r=0.05$ for different t. I also have to evaluate for $t=0$ and $s=100$ but I'm not sure how you go about doing this. Do you have any suggestions on how I could go about doing this please?

Any suggestions would be highly appreciated.

MarcoB
  • 67,153
  • 18
  • 91
  • 189
  • 3
    Do you need to write the PDE solver yourself? If not, use the Runge-Kutta method in NDSolve. – bbgodfrey Jan 25 '22 at 01:26
  • I do need to write the PDE solver myself. Yes i want to use the Runge-Kutta method but i'm not quite sure how. I'm honestly not sure where to start with this question. –  Jan 25 '22 at 09:36
  • @oddbodd247 If this is homework, please add the corresponding tag. If it is not, then please explain why you can't use the built in method but you want to roll your own. Have you searched the site for Runge-Kutta? – MarcoB Jan 25 '22 at 13:21
  • @MarcoB we're meant to learn how to program numerical differentiation by ourselves so cannot directly use NDSolve –  Jan 25 '22 at 13:34
  • @oddbodd247 Understood. Nevertheless, you will want to try and cobble something together in MMA code first and show it here. Surely this is not the very first MMA assignment you were given? That would be jumping into the very deep end of the pool :-) – MarcoB Jan 25 '22 at 14:48
  • 1
    One thing you might do is to first use NDSolve so you know what kind of answer you are looking for. Then you will know whether your version of the solver is working or not. – bill s Jan 25 '22 at 15:33
  • 6
    Potential duplicate? Certainly a useful resource for writing the PDE solver Solving a system of ODEs with the Runge-Kutta method –  Jan 25 '22 at 22:11

0 Answers0