This repository contains C++ implementations of various numerical methods commonly used in engineering, mathematics, and scientific computing. Each program is self-contained and demonstrates a fundamental numerical technique.
- Bisection Method
- Fixed Point Iteration
- Newton–Raphson Method
- Gauss Elimination
- Gauss–Jordan Elimination
- Jacobi Method
- LU Decomposition
- Matrix Inversion
- Power Method
- Monte Carlo Integration
- Runge–Kutta 4th Order
- Relaxation (SOR) Method
- Simpson 1/3 Rule
- Matrix Multiplication
Purpose: Find a root of an equation f(x) = 0 using interval halving.
File: bisection_method.cpp
Purpose: Solve x = g(x) iteratively.
File: fixed_point_iteration.cpp
Purpose: Solve f(x) = 0 using derivative-based iteration.
File: newton-rapson.cpp
Purpose: Solve a system of linear equations Ax = b using forward elimination and back substitution.
File: gauss_elim.cpp
Purpose: Solve Ax = b using Gauss–Jordan elimination (Reduced Row Echelon Form).
File: gauss_jordon.cpp
Purpose: Iteratively solve Ax = b using Jacobi iteration.
File: jacobi_nethod.cpp
Purpose: Solve Ax = b by decomposing A = L * U.
File: LU.cpp
Purpose: Find the inverse of a square matrix A using Gauss–Jordan elimination.
File: matrix_inversion.cpp
Purpose: Find the dominant eigenvalue and eigenvector of a matrix.
File: power_method.cpp
Purpose: Approximate definite integral ∫ f(x) dx using random sampling.
File: monte_carglo.cpp
Purpose: Solve first-order ODE dy/dx = f(x, y) with initial condition y(x0) = y0.
File: range_kutta.cpp
Purpose: Solve Ax = b iteratively with relaxation factor ω to accelerate convergence.
File: relaxtion_method.cpp
Purpose: Numerical integration using Simpson’s 1/3 formula.
File: simpson.cpp
Purpose: Multiply two matrices C = A * B.
File: matrix_multiplication.cpp
g++ filename.cpp -o program
./program
- Some methods (like Simpson 1/3, Bisection, Monte Carlo) use example functions in the code which can be modified.
- Jacobi and Relaxation methods require diagonally dominant matrices for guaranteed convergence.
- Always ensure matrix dimensions are compatible for multiplication or inversion.
- The Table of Contents links directly to the corresponding
.cppfiles in this repository.