Authors: Aaitijhya Goswami & Ritaja Dutta
This project is an interactive Computational Ecology Dashboard developed to visualize complex biological systems through the lens of statistical physics and differential equations.
By integrating Reaction-Diffusion Partial Differential Equations (PDEs) with Probabilistic Cellular Automata, the application simulates how microscopic local interactions—such as competition, predation, and mutation—drive emergent global phenomena like spiral waves, fractal branching, and evolutionary rescue.
The simulation suite runs on Streamlit, leveraging NumPy for high-performance vectorized grid operations to model thousands of agents in real-time.
Bio-Physical Concept: Resource Depletion & Growth Phases
Visualizes the competition between 12 distinct bacterial colonies for a single, finite nutrient source on an agar plate. It accurately models the three phases of bacterial growth:
- Lag Phase: Adaptation and synthesis of raw materials.
- Log (Exponential) Phase: Rapid division driven by nutrient abundance.
-
Stationary Phase: Growth arrest due to resource exhaustion (
$N \to 0$ ).
Mathematics:
Modeled as a consumption-diffusion system where biomass growth (
Bio-Physical Concept: Trophic Cascades & Diffusive Instability
Simulates the spatiotemporal dynamics between a Prey species (e.g., E. coli) and a Predator species (e.g., Bdellovibrio) in a finite environment. Unlike standard ODE models, this spatial implementation reveals traveling waves and phase shifts (Prey peaks
Governing Equations:
(Where P is Prey, Q is Predator, N is Nutrient)
Bio-Physical Concept: Evolutionary Rescue & Fitness Landscapes
Inspired by the Harvard Medical School experiment, this module models stepwise evolution across a spatial antibiotic gradient. Bacteria must mutate to survive in concentric zones of increasing toxicity.
- Zone 1 (Black): Safe haven (Wild Type thrives).
- Zone 2 (Grey): Moderate toxicity (Single Mutant survives).
- Zone 3 (White): High toxicity (Superbug survives).
Algorithm: Stochastic Cellular Automata with probabilistic mutation events allowing lineages to "tunnel" through fitness barriers.
Bio-Physical Concept: Non-Transitive Competition
Models the stability of biodiversity through intransitive competition loops, often observed in E. coli Colicin production.
- 🔵 Sensitive (Paper): Fast grower, no toxin. Beats Resistant.
- 🟢 Resistant (Rock): Immune to toxin, metabolic cost. Beats Toxic.
- 🔴 Toxic (Scissors): Produces poison, slow grower. Beats Sensitive.
Outcome: Low mobility leads to stable spiral waves, while high mobility causes stochastic extinction (biodiversity collapse).
Bio-Physical Concept: Syntrophy & Mutualism
Simulates an obligate mutualistic relationship where species depend on each other's metabolic byproducts (e.g., the Human Gut Microbiome or Biofilms).
- Syntrophy: Species B eats the waste of Species A.
- Toxicity Feedback: Species B produces a byproduct that is toxic to A. This creates complex "chasing" patterns where partners must stay close to feed but far enough to avoid poisoning.
- Language: Python 3.9+
- Core Logic:
NumPy(Vectorized Finite Difference Method, Monte Carlo steps) - Visualization:
Streamlit(UI),Pandas,Altair(Real-time Analytics),Matplotlib(Static Run) - Image Processing:
SciPy(Gaussian filters for chemical diffusion halos)
-
Clone the repository:
git clone [https://github.com/AaitijhyaGoswami/biophysics-module.git](https://github.com/AaitijhyaGoswami/biophysics-module.git) cd biophysics-module -
Install dependencies:
pip install -r requirements.txt
-
Run the application:
streamlit run app.py
biophysics-module/
├──.devcontainer # config directory
├── app.py # Entry point for the Streamlit app
├── localruns/
│ ├── growth-sim.py # Module 1: Multi-Colony Competition
│ ├── lv-sim.py # Module 2: Predator-Prey
│ ├── mega-plate.py # Module 3: Evolutionary Rescue
│ ├── rps-sim.py # Module 4: Cyclic Dominance
├── simulations/
│ ├── growth_sim.py # Module 1: Multi-Colony Competition
│ ├── lotka_volterra.py # Module 2: Predator-Prey
│ ├── mega_plate.py # Module 3: Evolutionary Rescue
│ ├── rps_sim.py # Module 4: Cyclic Dominance
│ └── cross_feeding.py # Module 5: Cross-Feeding
├── requirements.txt # Python dependencies
└── README.md # Project documentation
Contributions are welcome! Please open an issue or submit a pull request if you have ideas for new biological models or optimization improvements.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.