Skip to content

ThayLoser/matrix-computing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ma Trận và Cơ Sở của Tính Toán Khoa Học (Matrices and Fundamentals of Scientific Computing)

Course: MTH00051 - Toán Ứng Dụng và Thống Kê (Applied Mathematics and Statistics)

Institution: Ho Chi Minh City University of Science (HCMUS)

Author:

  • Nguyễn Anh Thái
  • Nguyễn Đình Tuấn
  • Nguyễn Huỳnh Gia Bảo
  • Vòng Sau Hậu
  • Lương Nhật Tân

📌 Project Overview

This repository contains a from-scratch Python implementation of core numerical linear algebra algorithms. The project is divided into three main components:

  • Part 1: Gaussian Elimination & Applications
    • Implementation of Gaussian elimination with partial pivoting.
    • Solving systems of linear equations via back-substitution.
    • Calculating matrix determinants and inverses (Gauss-Jordan).
    • Finding matrix rank and bases for column, row, and null spaces.
  • Part 2: Matrix Decomposition & Visualization
    • Implementation of a chosen matrix decomposition (LU, QR, SVD, or Cholesky).
    • Matrix diagonalization (eigenvalues and eigenvectors).
    • Mathematical animation and visualization of the decomposition using Manim.
  • Part 3: Performance Analysis & Numerical Stability
    • Implementation of the Gauss-Seidel iterative method.
    • Benchmarking runtime and relative error against random matrices of varying sizes ($n \in {50, 100, 200, 500, 1000}$).
    • Log-log plotting and stability analysis regarding the matrix Condition Number.

🛠️ Technology Stack

  • Language: Python $\ge 3.10$
  • Visualization: Manim Community v0.18.0
  • Data Analysis & Plotting: Matplotlib, Jupyter Notebook
  • Verification (Not used for core logic): NumPy, SciPy, SymPy

📂 Repository Structure

The codebase strictly follows the required project structure:

Group_<ID>/
|-- README.md
|-- requirements.txt
|-- report/
|   |-- report.pdf
|-- part1/
|   |-- gaussian.py
|   |-- determinant.py
|   |-- inverse.py
|   |-- rank_basis.py
|   |-- part1_demo.ipynb
|-- part2/
|   |-- decomposition.py
|   |-- diagonalization.py
|   |-- manim_scene.py
|   |-- part2_demo.ipynb
|   |-- manim_link.txt
|-- part3/
|   |-- solvers.py
|   |-- benchmark.py
|   |-- analysis.ipynb
|   |-- benchmark_results.json

🚀 Setup & Installation

  1. Clone this repository.
    git clone https://github.com/ThayLoser/matrix-computing.git
  2. Install the required dependencies:
    pip install -r requirements.txt
  3. Navigate to the correct folder if needed.
    cd <FolderName>
  4. To run the Manim visualization for Part 2:
    manim -pqh part2/manim_scene.py <SceneClassName>
  5. Explore the Jupyter notebooks (part1_demo.ipynb, part2_demo.ipynb and analysis.ipynb) to see the implementations and benchmarks in action.

About

Matrices and Fundamentals of Scientific Computing for the Applied Math and Statistics course.

Topics

Resources

License

Stars

Watchers

Forks

Contributors