# gurunagaraj-v/yuva-yodha-smart-buildings architecture

> Architecture diagram of the GitHub repository gurunagaraj-v/yuva-yodha-smart-buildings, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gurunagaraj-v/yuva-yodha-smart-buildings
- Repository: https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings

## Overview

Building Nervous System is a Streamlit building-energy digital twin and retrofit planning suite. Its principal workflow generates climate conditions, simulates baseline and controlled building operation, applies adaptive setpoints and time-of-day tariffs, then reports energy, comfort and financial outcomes. The dashboard also presents thermal-storage/blackout, CO₂ leak-diagnostic, fleet-scale VPP, sensitivity and EcoStruxure integration capabilities. The edges reflect shown imports, calls or README statements; several dashboard and diagnostic internals are unsampled, so their finer wiring is not asserted.

Main entry points: [`app/app.py`](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/app/app.py) (Digital twin dashboard), [`run_simulation.py`](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/run_simulation.py) (Annual simulation runner), [`model/model.py`](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/model.py) (Thermal building twin), [`model/controller.py`](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/controller.py) (Adaptive controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Simulation"]
  node_weather["Climate generator<br/>[weather.py]"]
  node_twin["Thermal building twin<br/>[model.py]"]
  node_runner["Annual simulation runner<br/>[run_simulation.py]"]
end

subgraph group_control["Control and tariffs"]
  node_controller["Adaptive controller<br/>[controller.py]"]
  node_tariffs["Time-of-day tariffs<br/>[tariff.py]"]
end

subgraph group_analysis["Evaluation"]
  node_economics["Savings and BOM<br/>[economics.py]"]
  node_sensitivity["Sensitivity sweeps<br/>[sensitivity.py]"]
  node_breath["CO₂ leak diagnostics<br/>[breath_test.py]"]
end

subgraph group_integration["Integration"]
  node_bridge["EcoStruxure gateway bridge"]
end

subgraph group_presentation["User experience"]
  node_dashboard["Digital twin dashboard<br/>[app.py]"]
end

node_operator(("Building operator"))
node_building["Building and AC systems"]
node_ecostruxure["EcoStruxure / Zenatix"]

node_operator -->|"configures and explores"| node_dashboard
node_operator -->|"runs annual evaluation"| node_runner
node_runner -->|"generates climate"| node_weather
node_runner -->|"runs annual twin"| node_twin
node_runner -->|"sets control policy"| node_controller
node_runner -->|"calculates savings"| node_economics
node_runner -->|"runs leak demo"| node_breath
node_twin -->|"uses climate inputs"| node_weather
node_twin -->|"uses setpoint control"| node_controller
node_twin -->|"gets tariff schedule"| node_tariffs
node_controller -->|"uses tariff multiplier"| node_tariffs
node_economics -->|"gets tariff rates"| node_tariffs
node_sensitivity -->|"generates climate"| node_weather
node_sensitivity -->|"evaluates scenarios"| node_twin
node_sensitivity -->|"varies control settings"| node_controller
node_sensitivity -->|"scores savings"| node_economics
node_dashboard -->|"loads climate profiles"| node_weather
node_dashboard -->|"presents twin results"| node_twin
node_dashboard -->|"exposes control settings"| node_controller
node_dashboard -->|"shows tariff bands"| node_tariffs
node_dashboard -->|"presents economics"| node_economics
node_dashboard -->|"offers sweep explorer"| node_sensitivity
node_dashboard -->|"shows leak diagnostics"| node_breath
node_dashboard -->|"shows gateway simulation"| node_bridge
node_bridge -->|"uses local control"| node_controller
node_bridge -.->|"exchanges telemetry and control"| node_building
node_bridge -.->|"serializes REST / MQTT telemetry"| node_ecostruxure
node_dashboard -->|"simulates building states"| node_building
node_dashboard -->|"reports operational outcomes"| node_operator

click node_dashboard "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/app/app.py"
click node_weather "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/data/weather.py"
click node_twin "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/model.py"
click node_controller "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/controller.py"
click node_tariffs "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/tariff.py"
click node_runner "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/run_simulation.py"
click node_economics "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/economics.py"
click node_sensitivity "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/sensitivity.py"
click node_breath "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/breath_test.py"
click node_bridge "https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/ecostruxure_bridge.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_weather,node_twin,node_runner toneBlue
class node_controller,node_tariffs toneAmber
class node_economics,node_sensitivity,node_breath toneMint
class node_bridge toneRose
class node_dashboard,node_operator,node_building,node_ecostruxure toneIndigo
```

## Components

### Simulation

- [Climate generator](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/data/weather.py): `data/weather.py`
- [Thermal building twin](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/model.py): `model/model.py`
- [Annual simulation runner](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/run_simulation.py): `run_simulation.py`

### Control and tariffs

- [Adaptive controller](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/controller.py): `model/controller.py`
- [Time-of-day tariffs](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/tariff.py): `model/tariff.py`

### Evaluation

- [Savings and BOM](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/economics.py): `model/economics.py`
- [Sensitivity sweeps](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/sensitivity.py): `model/sensitivity.py`
- [CO₂ leak diagnostics](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/breath_test.py): `model/breath_test.py`

### Integration

- [EcoStruxure gateway bridge](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/model/ecostruxure_bridge.py): `model/ecostruxure_bridge.py`

### User experience

- [Digital twin dashboard](https://github.com/gurunagaraj-v/yuva-yodha-smart-buildings/blob/main/app/app.py): `app/app.py`

### Other components

- **Building operator**
- **Building and AC systems**
- **EcoStruxure / Zenatix**

## Connections

- Building operator → Digital twin dashboard: configures and explores (evidence: `README.md`)
- Building operator → Annual simulation runner: runs annual evaluation (evidence: `README.md`)
- Annual simulation runner → Climate generator: generates climate (evidence: `run_simulation.py`)
- Annual simulation runner → Thermal building twin: runs annual twin (evidence: `run_simulation.py`)
- Annual simulation runner → Adaptive controller: sets control policy (evidence: `run_simulation.py`)
- Annual simulation runner → Savings and BOM: calculates savings (evidence: `run_simulation.py`)
- Annual simulation runner → CO₂ leak diagnostics: runs leak demo (evidence: `run_simulation.py`)
- Thermal building twin → Climate generator: uses climate inputs (evidence: `model/model.py`)
- Thermal building twin → Adaptive controller: uses setpoint control (evidence: `model/model.py`)
- Thermal building twin → Time-of-day tariffs: gets tariff schedule (evidence: `model/model.py`)
- Adaptive controller → Time-of-day tariffs: uses tariff multiplier (evidence: `model/controller.py`)
- Savings and BOM → Time-of-day tariffs: gets tariff rates (evidence: `model/economics.py`)
- Sensitivity sweeps → Climate generator: generates climate (evidence: `model/sensitivity.py`)
- Sensitivity sweeps → Thermal building twin: evaluates scenarios (evidence: `model/sensitivity.py`)
- Sensitivity sweeps → Adaptive controller: varies control settings (evidence: `model/sensitivity.py`)
- Sensitivity sweeps → Savings and BOM: scores savings (evidence: `model/sensitivity.py`)
- Digital twin dashboard → Climate generator: loads climate profiles (evidence: `app/app.py`)
- Digital twin dashboard → Thermal building twin: presents twin results (evidence: `app/app.py`)
- Digital twin dashboard → Adaptive controller: exposes control settings (evidence: `app/app.py`)
- Digital twin dashboard → Time-of-day tariffs: shows tariff bands (evidence: `app/app.py`)
- Digital twin dashboard → Savings and BOM: presents economics (evidence: `app/app.py`)
- Digital twin dashboard → Sensitivity sweeps: offers sweep explorer (evidence: `app/app.py`)
- Digital twin dashboard → CO₂ leak diagnostics: shows leak diagnostics (evidence: `app/app.py`)
- Digital twin dashboard → EcoStruxure gateway bridge: shows gateway simulation (evidence: `app/app.py`)
- EcoStruxure gateway bridge → Adaptive controller: uses local control (evidence: `model/ecostruxure_bridge.py`)
- EcoStruxure gateway bridge → Building and AC systems: exchanges telemetry and control (evidence: `README.md`)
- EcoStruxure gateway bridge → EcoStruxure / Zenatix: serializes REST / MQTT telemetry (evidence: `README.md`)
- Digital twin dashboard → Building and AC systems: simulates building states (evidence: `README.md`)
- Digital twin dashboard → Building operator: reports operational outcomes (evidence: `README.md`)
