Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Simulator

A full-stack, geospatial solar and battery simulation engine.

Solar Simulator bridges the gap between residential solar calculators and commercial-grade engineering software. It allows users to map real-world roof geometry, process 8,760-hour localized weather and load data, and instantly run complex combinatorial physics simulations to determine optimal hardware sizing, stringing combinations, and battery logic.

Live Demo: https://solar-simulator-cstio.vercel.app/


Key Features

  • Interactive Geospatial Mapping: Built with Leaflet, users can search for any address, draw polygon roof boundaries over satellite imagery, and set exact roof azimuths and tilts.
  • Hybrid Physics Engine (Residential & Commercial):
    • Residential Scale: Uses exhaustive combinatorial search to find the perfect MPPT stringing math for standard homes.
    • Commercial Scale: Automatically detects large systems (>150 panels) and switches to a lightning-fast greedy heuristic algorithm with automated Inverter Cascading to prevent memory freezing.
  • 8,760-Hour Time-Series Simulation: Pulls raw hourly irradiance data from the European Commission's PVGIS API, shifted dynamically to match local timezones based on longitude.
  • Dynamic Load Curve Normalization: Automatically scales 15-minute timestamped template CSVs into precise 8,760-hour continuous arrays to map against solar generation.
  • Battery State-of-Charge (SOC) Logic: Calculates optimal battery sizing and simulates hour-by-hour charging and discharging against localized household consumption.
  • Interactive Dashboard (Cross-Filtering): Features dynamic Chart.js visualizations. Clicking a specific month on the bar chart recalculates and redraws the 24-hour average load and generation curves for that specific month.

Roadmap & Upcoming Features

This project is in active development. While the core physics engine is fully operational, upcoming updates will focus on financial modeling and localized regulations:

  • Financial & ROI Modeling: Automated Return on Investment (ROI) calculations, payback periods, and savings projections tailored to the user's specific location and local energy tariffs.
  • Indonesian Regulatory Integration: Logic to handle specific Indonesian PV installation quotas, net-metering policies, and export limits.
  • Expanded Databases: A larger, more comprehensive hardware database for solar panels and inverters, localized cost data, and a wider variety of granular load curve templates.

Screenshots

Screenshot 2026-07-13 224208

Tech Stack

Backend (Physics & Data Engine):

  • Python 3
  • FastAPI: High-performance async API routing.
  • pvlib: Industry-standard solar physics calculations.
  • Pandas & NumPy: Time-series array manipulation and interpolation.
  • Uvicorn: ASGI web server.

Frontend (UI & Visualization):

  • Vanilla JavaScript / HTML5 / CSS3
  • Leaflet.js & Leaflet-Draw: Geospatial mapping and polygon area calculation.
  • Chart.js: Interactive, multi-axis data visualization.
  • OpenStreetMap Nominatim API: Geocoding and location search.

Local Installation & Setup

To run this application locally, you will need Python installed on your machine.

1. Clone the repository

git clone https://github.com/YourUsername/indo-solar-pro-engine.git
cd indo-solar-pro-engine

2. Install dependencies It is recommended to use a virtual environment.

pip install -r requirements.txt

3. Run the backend server

uvicorn main:app --reload

The FastAPI server will boot up and listen on http://127.0.0.1:8000.

4. Launch the Frontend Simply open the index.html file in any modern web browser.


Project Structure

  • main.py: The FastAPI backend, physics engine, combinatorial stringing logic, and PVGIS data parser.
  • index.html: The complete frontend UI, map logic, API fetch calls, and Chart.js rendering.
  • Load Curve/: Directory containing the 15-minute and hourly consumption CSV templates.
  • requirements.txt: Python package dependencies.

About

A full-stack geospatial solar and battery simulation engine. Features interactive multi-face roof mapping, 8,760-hour localized climate/load data processing, and algorithmic hardware optimization.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages