Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 2.46 KB

README.md

File metadata and controls

43 lines (27 loc) · 2.46 KB

Solving the Black-Scholes Equation Numerically

Project Overview

This project numerically solves the Black-Scholes Equation, which is widely used in financial mathematics for pricing options, and compares it with the Time-Dependent Schrödinger Equation (TDSE) from quantum mechanics. By using the Crank-Nicolson Method, the project solves both equations, highlighting their mathematical similarities and providing accurate results for option pricing and quantum wave function evolution.

Features

  • Implements C++ code for numerical solutions using the Crank-Nicolson Method.
  • Compares numerical results with analytical solutions for accuracy verification.
  • Supports both explicit and implicit methods for solving the Black-Scholes and Schrödinger equations.
  • Python is used to plot the results from CSV files generated by the C++ implementation.
  • Efficient matrix-based approach to minimize computational costs.

Key Methods

  1. Crank-Nicolson Method: A stable and accurate finite-difference approach used to solve the Black-Scholes and Schrödinger equations.
  2. LU Decomposition: Solves tridiagonal systems in Crank-Nicolson I.
  3. Thomas Algorithm: Used in Crank-Nicolson II to optimize performance by eliminating matrix-vector operations.

Dependencies

  • Eigen Library: For matrix and vector operations.
  • C++11 or later.
  • Python: To generate plots from the CSV files. The plotting script uses matplotlib.

Usage

C++ Code

To run the project, compile and execute the C++ code. Ensure that the Eigen library is properly installed and linked.

Files

  • main.cpp: The main C++ implementation for solving the equations using Crank-Nicolson methods.
  • data/: Contains the CSV files with numerical and analytical solutions.
  • plot_results.py: A Python script to plot results from the CSV files using matplotlib.

Project Report

A detailed report titled "Solving the Black-Scholes Equation Numerically" is attached to this GitHub repository. The report includes an in-depth analysis of the methods used, the numerical results obtained, and comparisons with analytical solutions. It provides insights into the mathematical foundations of the Black-Scholes Equation and the Time-Dependent Schrödinger Equation, along with graphical representations of the results.

The report can be found in the report folder of this repository under the name Solving_the_Black-Scholes_Equation_Numerically.pdf.