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/
- 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.
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.
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.
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-engine2. Install dependencies It is recommended to use a virtual environment.
pip install -r requirements.txt3. Run the backend server
uvicorn main:app --reloadThe 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.
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.