Skip to content

Latest commit

ย 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฎ Numerical Methods

Computational Mathematics & Scientific Computing using Python


๐Ÿ“š CH2120 Numerical Methods

๐ŸŽ“ IIT Hyderabad


๐Ÿ“– Overview

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.


๐Ÿ‘จโ€๐Ÿ’ป Author

  • Talla Shreyas
  • Engineering Science, IIT Hyderabad

๐Ÿ“‚ Repository Structure

numMethods/
โ”‚
โ”œโ”€โ”€ assignment1.py
โ”œโ”€โ”€ assignment2.py
โ””โ”€โ”€ README.md

๐Ÿš€ Assignment 1

Harshad Numbers & Shifted Legendre Polynomial Toolbox

โšก PyQt5-based Computational Mathematics Application โšก

This assignment combines concepts from number theory, numerical computation, and polynomial analysis through an interactive GUI application.


โœจ Features

๐Ÿ”น Factorial Harshad Numbers

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

๐Ÿ”น Consecutive Harshad Sequences

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

๐Ÿ”น Shifted Legendre Polynomial Tools

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

๐Ÿง  Mathematical Concepts Used

  • Number Theory
  • Harshad Numbers
  • Legendre Polynomials
  • Linear Algebra
  • Eigenvalue Computation
  • Numerical Stability
  • Newton-Raphson Method

๐Ÿš€ Assignment 2

Gauss-Legendre Quadrature & Heat Equation Solver

๐Ÿ”ฅ Spectral Collocation & Numerical PDE Solving ๐Ÿ”ฅ

This assignment focuses on numerical integration, differentiation matrices, and solving boundary value problems using spectral collocation methods.


โœจ Features

๐Ÿ”น Gauss-Legendre Quadrature

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

๐Ÿ”น Differentiation Matrices

Constructs numerical differentiation matrices using barycentric interpolation.

Computes:

  • First derivative matrix D1
  • Second derivative matrix D2

These matrices are used for spectral collocation techniques.


๐Ÿ”น Heat Equation Solver

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(ฮท)

๐Ÿ“Š Outputs

The application generates:

  • Numerical solutions
  • Error plots
  • Quadrature visualizations
  • Root distributions
  • Matrix computations
  • CSV exports
  • Error comparison tables

๐Ÿ› ๏ธ Technologies Used

Technology Purpose
Python Core Programming
PyQt5 GUI Development
NumPy Numerical Computation
SciPy Scientific Computing
Matplotlib Visualization
gmpy2 High Precision Arithmetic

โš™๏ธ Installation

Install required dependencies:

pip install numpy scipy matplotlib pyqt5 gmpy2

โ–ถ๏ธ Running the Programs

Assignment 1

python assignment1.py

Assignment 2

python assignment2.py

๐Ÿ“š Concepts Explored

  • Numerical Integration
  • Scientific Computing
  • Spectral Collocation
  • Error Analysis
  • Polynomial Computation
  • Numerical Linear Algebra
  • Eigenvalue Problems
  • Differentiation Matrices
  • Computational Mathematics
  • Boundary Value Problems

๐ŸŽฏ Learning Outcomes

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

๐Ÿ“ Notes

  • Developed for academic and learning purposes
  • GUI-based implementations built using PyQt5
  • Some higher-order computations may require additional computation time

โญ Computational Mathematics โ€ข Numerical Analysis โ€ข Scientific Computing โญ

About

Python implementations of numerical methods, scientific computing algorithms, and computational mathematics techniques.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages