Skip to content
Tanishka-CodesPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Renewise — Energy Intelligence

Forecast. Optimize. Explain. A local-first decision-support prototype for institutional renewable-energy planning, prepared for PCCOE Indradhanu 2026 (AI for Climate Change / SDG 13).

Evidence warning: The default dashboard uses an explicitly labelled synthetic reference scenario. It is not PCCOE or any real campus's measured energy data. Historical Dataset A, Dataset B (I-BLEND) and Dataset C are kept as independent sources. The application does not silently synchronize or merge them.

What works in this build

  • Responsive multi-page web application: overview, solar intelligence, forecasting lab, dispatch optimizer, scenario studio, AI assistant and data provenance.
  • FastAPI backend with CSV/ZIP upload slots for Dataset A, I-BLEND Dataset B and India Solar Benchmark Dataset C.
  • Actual uploaded rows/columns and row counts shown after ingestion; source files retained under data/uploads/.
  • Chronological Random Forest evaluation against a 24-hour persistence baseline for an uploaded timestamped numeric series.
  • Mixed-integer linear dispatch optimization (SciPy MILP): hourly energy balance, SOC recurrence, charge/discharge power bounds, mutually exclusive charging/discharging, no grid export, configurable battery and tariffs.
  • No-storage baseline comparison using identical demand, solar and tariff inputs.
  • What-if recalculation for solar availability, configurable solar capacity, demand, battery capacity and tariff.
  • Backend-only Nugen chat-completions integration using the configured aligned model; missing key or API failure triggers an explicitly labelled deterministic explanation fallback.
  • Dispatch CSV and PDF exports.
  • Dataset A inverter-aware power-to-energy inspection with interval gaps, duplicate timestamps, negative values and yield-counter anomaly checks.
  • I-BLEND building selection and historical mean 24-hour demand profile import (when the uploaded schema is recognized).
  • Dataset C city selector and monthly/hour-of-day historical GHI profiles using the published CITY, datetime and ALLSKY_SFC_SW_DWN schema.
  • Recursive 24-hour historical-series forecast with no unsupported confidence interval.

Architecture

Browser (HTML/CSS/JS)
      │ REST
      ▼
FastAPI backend ─── pandas / NumPy / scikit-learn
      │                       │
      ├── Dataset ingestion   └── Chronological model evaluation
      ├── SciPy MILP optimizer ─── hourly dispatch + baseline
      ├── scenario engine
      └── Nugen aligned-model API (server-side key only)

Run locally (Windows PowerShell)

  1. Install Python 3.11+.
  2. Open a terminal in the Renewise project folder.
  3. Create and activate a virtual environment:
py -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r backend\requirements.txt
  1. Optional: copy .env.example to .env and add your Nugen API key. The default endpoint follows the current Nugen chat-completions documentation; the model ID is the aligned Renewise model ID supplied earlier. A real inference call still requires the user's API key and account-side model availability.
  2. Start the app:
uvicorn backend.app.main:app --reload --host 127.0.0.1 --port 8000
  1. Open http://127.0.0.1:8000

API health: http://127.0.0.1:8000/api/health

Dataset connections

Use Data & provenance in the UI.

  • A — Solar Power Generation: upload original archive_1.zip or prepared CSVs. Keep AC/DC power as kW; do not treat them as kWh. Integrate power over actual intervals for energy. Do not sum cumulative yield counters blindly.
  • B — I-BLEND: upload Renewise_IBLEND_Final.zip or the three prepared hourly CSVs (academic_hourly.csv, library_hourly.csv, boys_hostel_hourly.csv). These are IIIT Delhi building observations, not PCCOE measurements. Expected processed power/energy interpretation should be checked against quality_report.txt and source metadata before treating it as a campus forecast.
  • C — India Solar Benchmark: upload prepared CSV/ZIP. The city selector is populated from actual CITY values. The explorer uses datetime and ALLSKY_SFC_SW_DWN (hourly GHI in W/m²) for monthly and hour-of-day historical profiles; it also summarizes available weather fields.

The ZIP ingestion reads all CSV members and adds _source_file; it does not claim that records from independent sources are synchronized. Large multi-GB archives may exceed memory; prefer prepared year/building CSV splits.

Optimizer model

For each hourly interval, the solver separates direct solar-to-load, solar-to-battery, grid-to-battery, grid-to-load, battery discharge and curtailment. It enforces:

grid_to_load + solar_to_load + battery_discharge = demand

solar_to_load + solar_to_battery + curtailment = solar_available

SOC[t+1] = SOC[t] + η_charge × (solar_charge + grid_charge) − discharge / η_discharge

  • Round-trip efficiency is split evenly between charge and discharge efficiencies (sqrt(RTE)).
  • The illustrative solar profile is scaled linearly from the 50 kWp reference capacity when the solar capacity input changes; replace it with a validated site-specific generation forecast before operational interpretation.
  • The binary operating mode prevents simultaneous charge and discharge.
  • Grid export is disabled in this prototype.
  • The objective minimizes time-of-use grid energy cost, with small throughput/curtailment tie-break penalties.
  • No-storage baseline serves demand with solar first and imports the remaining demand from grid.
  • Savings are estimates under the user-entered tariff and reference scenario, not guaranteed or measured savings.

Nugen setup

Set NUGEN_API_KEY in the project-root .env file. Do not put the key in frontend files or commit it. The backend sends the selected calculated context and user question to the model. The model is instructed not to invent values. The deterministic optimizer remains the source of truth. If the endpoint fails or the key is missing, the assistant displays a fallback explanation and states that Nugen inference did not occur.

Validation and known limitations

  • The source dataset binaries are not bundled because the Project Library files did not expose an authorized raw-byte path to this build environment. Upload your locally prepared ZIPs in the app; no ChatGPT re-upload is needed.
  • Dataset C explorer computes historical summaries from the recognized published schema. It does not claim future weather conditions or actual PV output.
  • The 24-hour forecast is a recursive statistical extrapolation from the uploaded historical series only; it does not use a live weather forecast and displays no confidence interval.
  • Dataset A integration is conservative and limited to adjacent non-negative AC power samples with gaps no larger than one hour. Review the generated report and original source documentation before using the values operationally.
  • The I-BLEND profile importer requires recognizable timestamp and hourly energy/power columns. If not recognized, it returns the available columns and refuses to guess units.
  • Database persistence, user authentication, live weather API and physical device control are not included. The prototype is local-first and decision-support only.
  • The Nugen route, bearer authentication, messages format and response parsing follow current chat-completions documentation. The aligned model ID is configured from the earlier supplied value; verify the actual model exists in the Nugen account and run a real inference test with a valid key before claiming live inference.

Tests

pytest -q

The tests cover energy balance, direct-solar priority, SOC bounds, mutual exclusivity and baseline comparison. Solver availability requires SciPy with milp support.

Suggested hackathon demo flow

  1. Open /landing, then enter the workspace.
  2. Show the clearly labelled reference dashboard and run the dispatch optimizer.
  3. Change battery capacity, demand and solar availability in What-if studio.
  4. Open the dispatch table and explain the energy-balance validation.
  5. Ask the assistant why a charge/discharge window was selected. Without a Nugen key it explicitly uses the deterministic fallback.
  6. In Data & provenance, upload your local Renewise_IBLEND_Final.zip, prepared Dataset A ZIP and prepared Dataset C ZIP. The files are read locally by your running app; they do not need to be re-uploaded to ChatGPT.
  7. Select an I-BLEND building to load its historical mean hourly demand profile. Select a Dataset C city and compare it with another city.
  8. Export the dispatch CSV/PDF and explain the assumptions.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages