Skip to content

This repository contains the implementation of numerical methods for solving the Black-Scholes Equation and the Time-Dependent Schrödinger Equation. It features C++ code using the Crank-Nicolson method, along with Python scripts for visualizing the results. A detailed report analyzing the findings and methodologies is also included.

Notifications You must be signed in to change notification settings

victorakins02/Solving-BSE-Numerically

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This repository contains the implementation of numerical methods for solving the Black-Scholes Equation and the Time-Dependent Schrödinger Equation. It features C++ code using the Crank-Nicolson method, along with Python scripts for visualizing the results. A detailed report analyzing the findings and methodologies is also included.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published