Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Numerical Integration in C++

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.

Implemented Methods

  • Trapezoidal Rule
  • Simpson’s Rule
  • Monte Carlo Integration

Each numerical result is compared to an analytical solution to compute absolute errors.

Features

  • 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 Analysis & Visualization

  • Error data is written to data/errors.csv and not published on github
  • A Jupyter notebook is included that loads this file and visualizes the convergence behavior of the different methods

Project Structure

. 
β”œβ”€β”€ src/
β”‚ └── main.cpp
β”‚ └── integration.h
β”‚ └── integration.cpp
β”œβ”€β”€ data/
β”‚ └── errors.csv
β”œβ”€β”€ plots/
β”‚ └── making_plots.ipynb
└── Makefile

Purpose

This project was used to experiment with:

  • Numerical integration techniques
  • Clean C++ code structure
  • Basic performance and error analysis

About

Numerical integration in C++ (Trapezoid, Simpson, Monte Carlo)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages