A comprehensive collection of Python simulations and numerical solvers for modeling physical systems. This repository implements algorithms from scratch to solve problems in Fluid Dynamics, Stochastic Processes, Non-linear Dynamics, and Signal Processing.
Primary Focus: Scientific Computing, Numerical Analysis, and "First-Principles" Modeling.
The repository is organized into four core modules based on the physical domain and mathematical techniques used.
Simulating systems governed by randomness and probability.
- Monte Carlo Random Walks:
- Simulates particle diffusion in 2D and 3D space.
- calculates displacement statistics to model Brownian motion and diffusion processes.
- Ising Model & Phase Transitions:
- (Optional/In-progress) Models magnetic dipole spins to study ferromagnetism and phase transitions using statistical mechanics.
Solvers for Partial Differential Equations (PDEs) in fluid mechanics and electromagnetism.
- Spectral Advection-Diffusion Solver:
- Solves the time-evolution of transport phenomena using Fast Fourier Transforms (FFT) (Spectral Methods).
- Demonstrates high-accuracy solutions for fluid flow compared to traditional grid methods.
- Poisson Equation Solver (1D):
- Solves the electrostatic Poisson equation using Finite Difference Methods (FDM).
- Implements boundary value problem solvers for potential fields.
- Wave Equation Solver:
- Simulates wave propagation and interference patterns in time and space.
Modeling time-dependent coupled systems and non-linear behavior.
- Lotka-Volterra Equations:
- Numerical solution for Predator-Prey population dynamics using coupled ODEs.
- Chaos & Bifurcation:
- Simulation of the Logistic Map to visualize the transition from stability to deterministic chaos (Period Doubling).
- Damped Harmonic Oscillator:
- Solves the equation of motion for damped systems using Runge-Kutta (RK4) integration methods.
Implementation of core mathematical algorithms from scratch.
-
Fast Fourier Transform (FFT):
- A custom recursive implementation of the Cooley-Tukey algorithm.
- Application: Used for signal processing and spectral derivatives.
-
Image Compression via SVD:
- Application of Singular Value Decomposition (SVD) to compress images by retaining only principal singular values.
-
Image Filtering (FFT):
- 2D Fourier Transform for low-pass and high-pass filtering of images in the frequency domain.
-
Linear Algebra Solvers:
- Direct Methods: Gaussian Elimination and LU Decomposition (Doolittle’s Method).
-
Iterative Methods: Jacobi Method for solving large linear systems
$Ax=b$ . - Eigenvalue Solvers: QR Decomposition algorithm.
- Language: Python 3.x
- Core Libraries:
NumPy(Vectorized computation),Matplotlib(Visualization),SciPy(Scientific tools). - Techniques: Monte Carlo, Finite Difference (FDM), Spectral Methods, Runge-Kutta, SVD.
- Clone the repository:
git clone https://github.com/VarunNair19/Computational-Physics-Simulations.git