Skip to content

VarunNair19/Computational-Physics-Simulations

Repository files navigation

Computational Physics Simulations ⚛️

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.


📂 Project Structure

The repository is organized into four core modules based on the physical domain and mathematical techniques used.

🔹 Module 1: Stochastic Systems

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.

🔹 Module 2: CFD & Differential Equations

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.

🔹 Module 3: Dynamic Systems & Chaos

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.

🔹 Module 4: Numerical Methods & Algorithms

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.

🛠️ Tech Stack

  • 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.

🚀 How to Run

  1. Clone the repository:
    git clone https://github.com/VarunNair19/Computational-Physics-Simulations.git

About

"A Scientific Computing portfolio implementing 'First-Principles' modeling in Python. Includes custom-built solvers for the Advection-Diffusion equation (FFT), Poisson equation (Finite Difference), and Chaotic systems, demonstrating core skills in numerical analysis and algorithm design

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages