Scientific Computing and Irrigation Modeling Project
# HydroSense-Kenya
**A Scientific Computing System for Smart Irrigation, Water Balance Simulation, and Climate-Aware Decision Support**
> ICS 2207: Scientific Computing — Capstone Project, February–May 2026 Semester
---
## Project Overview
HydroSense-Kenya is an end-to-end scientific computing project that addresses water-use efficiency for smallholder farming in Kenya. Using daily weather records, soil-moisture sensor readings, and crop-zone parameters, the system:
- **Models** soil-water balance using a discrete difference equation
- **Estimates** daily evapotranspiration from weather variables
- **Detects** data quality issues (missing values, outliers, sensor faults)
- **Implements** numerical methods from scratch (root finding, integration, differentiation, linear systems)
- **Simulates** soil moisture trajectories using Euler and Runge-Kutta ODE solvers
- **Quantifies** rainfall uncertainty through Monte Carlo simulation (1000+ scenarios)
- **Optimizes** irrigation schedules to minimize water use while preventing crop stress
- **Validates** all results with automated tests (pytest)
### Central Scientific Question
> Given weather and soil-sensor data, how can we model water availability, estimate water deficit, simulate future soil moisture, and recommend an efficient irrigation plan that minimizes water use without exposing crops to moisture stress?
### Core Models
**Water Balance Equation:**
```
S(t+1) = S(t) + R(t) + I(t) - ET(t) - D(t)
```
| Term | Meaning |
|------|---------|
| S(t) | Soil moisture at time t (%) |
| R(t) | Rainfall (mm) |
| I(t) | Irrigation applied (mm) |
| ET(t) | Evapotranspiration (mm) |
| D(t) | Drainage loss (mm) |
**Simplified Evapotranspiration:**
```
ET = max(0, 0.12*T + 0.35*W + 2.4*Solar - 0.025*H)
```
**Drainage Model:**
```
D(t) = drainage_coefficient * max(0, S_interim - field_capacity)
```
---
## Project Structure
```
HydroSense-Kenya/
│
├── data/
│ ├── raw/ # Original unmodifie …