Solve Black Scholes (above) using Crank-Nicolson Finite Difference method.
This code numerically solves hyperbolic PDEs of the form:
Dt[u] + a Dx[u] + b Dy[u] + b Dxx[u] + u = F(t, x)
where Dt[], Dx[], Dy[], and Dxx[] are the differential operators for t, x, and y
The solutions are animated in a window. Data is saved to text files when 's' is pressed.
The following explicit finite difference schemes are implemented:
- Forward-Time Forward-Space
- Forward-Time Backward-Space
- Forward-Time Central-Space
- Lax Fredrichs
- Leapfrog
- Equilibrium
- Lax Wendroff
The following implicit finite difference schemes are implemented:
- Crank Nicolson