This project contains C++ implementations of a variety of classic and modern numerical techniques, applied to physical problems encountered in laboratory courses and practical assignments. The codebase is designed with clarity, scalability, and reproducibility in mind
These laboratory works showcase algorithms for solving core computational physics problems. The implementations are modular and leverage clean C++ patterns to facilitate study, reuse, and extension for new problems
numerical-methods-in-physics/
├── images/ # Necessary graphs
├── include/ # Public headers for numerical modules and solvers
├── reports/ # Markdown lab reports and practical results
├── src/Labs # Source files (lab tasks implementations)
├── CMakeLists.txt # Build configuration (CMake)
├── vcpkg.json # Dependency manifest
├── README.md # Project overview and instructions
├── LICENSE # MIT License
├── .gitignore # Git ignore rules
Demonstrates solving tridiagonal and arbitrary systems using direct and iterative methods (e.g., Thomas algorithm, Jacobi, Gauss-Seidel), with application to real modeling tasks
Contains implementations of the bisection (dichotomy), Newton, and simple iteration methods for solving non-linear equations. Demonstrates convergence efficiency and robustness on real physical functions
Features various quadrature methods (rectangular, trapezoidal, Simpson's), with error analysis and comparisons on benchmark test cases
Includes explicit and implicit schemes for ODEs, such as Euler, improved Euler and Runge-Kutta methods, tested on classical physical systems (oscillator, decay, etc.)
Presents approaches for numerically solving ordinary differential equations with boundary conditions, including finite difference schemes, shooting methods, and matrix formulations. Analysis includes stability, convergence on heat conduction and physical diffusion models
- C++17 compatible compiler (GCC, Clang, MSVC)
- CMake 3.14 or newer
- matplot++ development files
- Eigen library (header-only, managed via CMake or package manager)
To build the code, standard CMake workflows are recommended:
git clone https://github.com/Krasnovvvvv/numerical-methods-in-physics.git
cd numerical-methods-in-physics
mkdir build && cd build
cmake ..
make
./lab_executableAll completed laboratory reports (including results, and code descriptions) can be found here:
| 📝 Report | Link |
|---|---|
| Systems of Linear Algebraic Equations 📄 | Read |
| Root Finding Algorithms 📄 | Read |
| Integrating Algorithms 📄 | Read |
| Solving ODEs Algorithms 📄 | Read |
| Boundary Value Problems for ODEs 📄 | Read |
- matplot++ — a high-quality C++ plotting library for scientific visualization
- Eigen — a fast, versatile C++ library for linear algebra and matrix operations
These dependencies are automatically handled via CMake (assuming installed on your system or via package managers like vcpkg)
Contributions, bug reports, and feature requests are welcome!
Please open issues or pull requests on the GitHub repository