Skip to content

High-performance, educational C++ project with modular and extensible architecture for solving physics problems using state-of-the-art numerical methods

License

Notifications You must be signed in to change notification settings

Krasnovvvvv/numerical-methods-in-physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Numerical Methods in Physics

GitHub last commit MIT License Issues Stars

Ubuntu Windows macOS

CI Ubuntu CI Windows CI macOS

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


ℹ️ About

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


📁 Project Structure

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

🔬 Laboratory Topics

🧮 Systems of Linear Algebraic Equations (SLAE)

Demonstrates solving tridiagonal and arbitrary systems using direct and iterative methods (e.g., Thomas algorithm, Jacobi, Gauss-Seidel), with application to real modeling tasks

🌱 Root Finding Algorithms

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

📐 Numerical Integration

Features various quadrature methods (rectangular, trapezoidal, Simpson's), with error analysis and comparisons on benchmark test cases

📊 Ordinary Differential Equations (ODEs)

Includes explicit and implicit schemes for ODEs, such as Euler, improved Euler and Runge-Kutta methods, tested on classical physical systems (oscillator, decay, etc.)

🏁 Boundary Value Problems for ODEs

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


🚀 Getting Started

🛠️ Prerequisites

  • 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)

⚡ Build

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_executable

📄 Reports

All 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

📦 Dependencies

  • 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)


🤝 Contribution

Contributions, bug reports, and feature requests are welcome!
Please open issues or pull requests on the GitHub repository


📝 License

This project is licensed under the MIT License — see License

Languages