This repository contains implementations of advanced numerical methods, computational mathematics concepts, and scientific computing techniques using Python.
The assignments focus on:
- Numerical computation
- Polynomial methods
- Scientific programming
- Numerical integration
- Spectral collocation
- Matrix computations
- Error analysis
- Mathematical problem solving
The implementations were developed as part of coursework and computational exploration in CH2120 Numerical Methods.
- Talla Shreyas
- Engineering Science, IIT Hyderabad
numMethods/
โ
โโโ assignment1.py
โโโ assignment2.py
โโโ README.md
โก PyQt5-based Computational Mathematics Application โก
This assignment combines concepts from number theory, numerical computation, and polynomial analysis through an interactive GUI application.
The program checks whether factorial values:
n!
are Harshad numbers.
Features include:
- Harshad divisibility checks
- Non-Harshad factorial detection
- Digit-sum analysis
- Range-based computations
The application explores sequences of consecutive Harshad numbers and analyzes their computational behavior.
Includes:
- Trivial sequences
- Non-trivial sequence exploration
- Consecutive sequence analysis
- Computational complexity observations
Implements shifted Legendre polynomial computations on the interval:
[0,1]
The toolbox computes:
- Polynomial coefficients
- Companion matrices
- LU decomposition
- Eigenvalues
- Polynomial roots
- Newton-Raphson root refinement
- Linear system solutions
- Number Theory
- Harshad Numbers
- Legendre Polynomials
- Linear Algebra
- Eigenvalue Computation
- Numerical Stability
- Newton-Raphson Method
๐ฅ Spectral Collocation & Numerical PDE Solving ๐ฅ
This assignment focuses on numerical integration, differentiation matrices, and solving boundary value problems using spectral collocation methods.
Implements Gauss-Legendre quadrature using the:
Golub-Welsch Algorithm
Capabilities include:
- Computing quadrature nodes
- Computing quadrature weights
- Eigenvector-based weight computation
- Lagrange moment comparison
- Visualization of roots and weights
- CSV export support
Constructs numerical differentiation matrices using barycentric interpolation.
Computes:
- First derivative matrix
D1 - Second derivative matrix
D2
These matrices are used for spectral collocation techniques.
Numerically solves the boundary value problem:
f''(ฮท) + 2ฮทf'(ฮท) = 0
with boundary conditions:
f(0)=0
f(ฮท_max)=1
The numerical solution is compared with the analytical solution:
erf(ฮท)
The application generates:
- Numerical solutions
- Error plots
- Quadrature visualizations
- Root distributions
- Matrix computations
- CSV exports
- Error comparison tables
| Technology | Purpose |
|---|---|
| Python | Core Programming |
| PyQt5 | GUI Development |
| NumPy | Numerical Computation |
| SciPy | Scientific Computing |
| Matplotlib | Visualization |
| gmpy2 | High Precision Arithmetic |
Install required dependencies:
pip install numpy scipy matplotlib pyqt5 gmpy2python assignment1.pypython assignment2.py- Numerical Integration
- Scientific Computing
- Spectral Collocation
- Error Analysis
- Polynomial Computation
- Numerical Linear Algebra
- Eigenvalue Problems
- Differentiation Matrices
- Computational Mathematics
- Boundary Value Problems
Through these implementations, the following areas were explored:
- Efficient numerical algorithms
- Computational problem solving
- Matrix-based numerical methods
- Numerical approximation techniques
- Stability and accuracy analysis
- GUI-based scientific applications
- Developed for academic and learning purposes
- GUI-based implementations built using PyQt5
- Some higher-order computations may require additional computation time