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