1
$\begingroup$

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.

$\endgroup$
7
  • 3
    $\begingroup$ Do you need to write the PDE solver yourself? If not, use the Runge-Kutta method in NDSolve. $\endgroup$
    – bbgodfrey
    Jan 25, 2022 at 1:26
  • $\begingroup$ 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. $\endgroup$
    – user84766
    Jan 25, 2022 at 9:36
  • $\begingroup$ @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? $\endgroup$
    – MarcoB
    Jan 25, 2022 at 13:21
  • 1
    $\begingroup$ 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. $\endgroup$
    – bill s
    Jan 25, 2022 at 15:33
  • 6
    $\begingroup$ Potential duplicate? Certainly a useful resource for writing the PDE solver Solving a system of ODEs with the Runge-Kutta method $\endgroup$
    – user49048
    Jan 25, 2022 at 22:11

0