This project implements and compares several numerical integration methods in C++.
It was created as a small playground to practice and improve my C++ programming skills while working with classical numerical algorithms.
- Trapezoidal Rule
- Simpsonβs Rule
- Monte Carlo Integration
Each numerical result is compared to an analytical solution to compute absolute errors.
- Arbitrary functions via function pointers
- Analytical reference integrals for validation
- Runtime measurement using
std::chrono - Error analysis for increasing numbers of intervals
- Export of error data to CSV
- Error data is written to
data/errors.csvand not published on github - A Jupyter notebook is included that loads this file and visualizes the convergence behavior of the different methods
.
βββ src/
β βββ main.cpp
β βββ integration.h
β βββ integration.cpp
βββ data/
β βββ errors.csv
βββ plots/
β βββ making_plots.ipynb
βββ Makefile
This project was used to experiment with:
- Numerical integration techniques
- Clean C++ code structure
- Basic performance and error analysis