ALLSHIFT/docs/03-energy-management/bidmc-ucsd-energy-flow-and-balances.md
pepe 72dd781dbc Organize documentation into docs/ and superseded/
Audit every document in the repository, convert the non-markdown ones into
markdown reports, and split current documentation from outdated material.

docs/ — 31 markdown documents in seven numbered sections. Twenty are new
reports generated from .docx / .pdf / .xlsx / .mlx / .m sources that were
previously unreadable in the browser and undiffable in git. Each report
carries a provenance block (source path, format, MD5) and links back to its
original; all 13 recorded checksums verify against the files on disk.
Machine-extraction losses (PDF table column interleaving, Word OMML
equations, embedded figures) are called out explicitly rather than silently
smoothed over.

superseded/ — outdated material with a documented reason per entry:
two byte-identical ClickUp re-exports, an older revision of the BIDMC/UCSD
energy-flow doc (the retained copy adds the SoC Violation Rate KPI), a
duplicate of Shift input data.docx, the May 2026 simulation plan, the
root PV+Battery.md now covered by a fuller report, GitHub's stock
demo-repository template, and a zero-byte placeholder. Its README also
records what was deliberately NOT retired and why — the "Old Frameworks"
and "Old Simulations" folders hold unique Simulink revisions, and
"Big Ugly Folder" holds the only copy of framework revision 1.3.

Findings worth flagging, all documented in the reports:
- Simulink lineage recovered from each .slx's internal coreProperties.xml
  revision counter. The current model is
  Current Framework/Bobert0206_Initial_Simulation_Framework.slx (rev 2.7);
  the top-level copy is rev 1.3, five revisions behind.
- Simulations/Constants.m is a truncated byte-prefix of the Current
  Framework copy, silently missing H2_leak, H2_cap and E_H2_vol_h.
- The PEM electrolyser and fuel cell are unmodified MathWorks Simscape
  examples still at vendor defaults; the "10x bigger" sizing TODO recorded
  in Constants.m was never carried out.
- controller-claude.m does not compile — undefined P_Electro_max, outputs
  unassigned on several paths.
- The specification set uses two incompatible variable naming conventions
  and disagrees on action-space size (5 vs 16).
- MA_hourly_load.csv (13.7 MB) is the same 35,040 rows as 89993-0.parquet
  (2.4 MB).
- Clinical data is the MIMIC-IV *demo* (ODbL, 100 patients), not full
  MIMIC-IV — redistributable, but the licence and citation are unrecorded.

Housekeeping: untrack 21 Simulink build artefacts (slprj/, *.slxc) and add
ignore rules for them. Root README rewritten around the new layout.

Recruitment notes naming individual candidates are excluded from version
control via .gitignore rather than committed; the generic question template
is kept in docs/07-team-and-operations/.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 21:20:33 -07:00

224 lines
10 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Energy Flow and Specifications for the Hybrid Hospital
> **Markdown report of a non-markdown source document.**
>
> | | |
> |---|---|
> | **Source** | `Shift Matlab Drive/Shift Matlab Drive/Energy_Managment/Beth Israel Deaconess Medical Center/BIDCM-UCSD hybrid hospital energy flow and balances.docx` |
> | **Format** | Microsoft Word (.docx), 162 kB |
> | **MD5** | `27a86f331086ce60c078b412d5205e5b` |
> | **Owner** | Energy Management cluster |
> | **Status** | **Current revision.** An earlier copy sits in [`superseded/`](../../superseded/) — see [Revision history](#revision-history) |
> | **Report generated** | 2026-07-25 |
> [!NOTE]
> The source document contains one embedded figure (`Fig-1: Energy Flow Diagram`) and twelve
> OOXML equations. The equations are transcribed below in plain notation. **The figure is not
> reproducible in this report** — open the original `.docx` to see it.
>
> The document title spells the hospital *"BIDCM"*; the correct abbreviation is **BIDMC**
> (Beth Israel Deaconess Medical Center). Filename retained as-is for traceability.
## Dispatch priority
| Priority | Source | Mode | Purpose |
|---|---|---|---|
| **Level 1** | Solar PV | Sustainability | Normal daylight operations & storage charging |
| **Level 2** | Battery / H₂ | Resilience | After-hours operations and bridging short gaps |
| **Level 3** | MATEP CHP | Reliability | Constant baseload and thermal support |
| **Level 4** | Eversource Grid | Redundancy | Last-resort emergency backup for critical areas |
*MATEP* — Medical Area Total Energy Plant, the CHP plant serving the Longwood Medical Area.
*Eversource* — the New England utility serving Boston.
### Primary generation (daytime)
- **Solar lead.** Solar energy is the main source.
- **Direct supply.** Solar energy flows to the AC electrical bus (distribution point) to power
the hospital immediately.
- **The "deposit".** Any electricity not needed by the hospital is diverted to charge the
battery and run the electrolyzer.
### Transition to storage (evening)
- **Solar fade.** Solar production stops.
- **The "withdrawal".** The battery is the *first responder*, discharging immediately to keep
the bus powered. If the battery runs low, the hydrogen fuel cell activates, converting the
stored hydrogen back into electricity.
- **Baseload support.** The MATEP CHP plant provides a steady stream of natural-gas-generated
power to bridge any gaps.
### The safety net (emergency)
- **Grid activation.** The Eversource grid stays on standby until a major failure occurs or
on-site storage is depleted.
- **Load shedding.** To protect the most critical patients, the system pauses power to Tier 2
loads (HVAC, general wards, imaging) to ensure Tier 1 loads (ICU, operating rooms, life
safety) stay running indefinitely.
## Critical load management
### Load tiers
| Tier | Priority | Includes | Status in emergency |
|---|---|---|---|
| **Tier 1** | Critical | ICU, Operating Rooms (OR), Life Safety (fire/alarms), Critical Communications | **Always on** — guaranteed by battery, fuel cell, and grid |
| **Tier 2** | Essential | Clinical HVAC, Imaging (MRI/CT), Medical Wards, Critical Lighting | **Shiftable** — may be curtailed or cycled to preserve storage |
| **Tier 3** | Non-critical | Administrative Offices, Cafeteria, Gift Shop, Non-essential Lighting | **Shed first** — paused immediately during a grid emergency |
**Tier 1 — what should not go down.** These systems are defined as *never interrupted* and are
the only loads guaranteed during an emergency grid backup scenario: intensive care units
(continuous monitoring and life-support), operating rooms (surgical equipment and critical
environment controls), and life safety (emergency lighting, fire systems, critical
communications).
**Tier 2 — shiftable/interruptible.** Considered *essential* but may be paused if on-site
storage is depleted or during a grid emergency to prioritise Tier 1: building climate control
(HVAC), diagnostic imaging (MRI, CT), and general wards.
### Approximate power requirements
Derived from `hospital_communication_energy_system.csv` at 5-minute intervals:
| Tier | Average per interval | Approx. continuous | Note |
|---|---|---|---|
| Tier 1 — Medical Equipment | ~3.01 kWh | **~36 kW** | Baseline for patient monitoring and life-support machines that must never be interrupted |
| Tier 2 — HVAC & Clinical Support | ~4.99 kWh | **~60 kW** | Largest single draw. Essential for patient comfort, but designed to be shifted when running solely on backup storage |
| Tier 3 — Lighting & Admin | ~2.00 kWh | **~24 kW** | General lighting and non-clinical support. First area reduced in "Energy Saving Mode" |
> [!WARNING]
> These figures come from a **synthetic** dataset (`hospital_communication_energy_system.csv`,
> 10,000 rows covering 2025-01-01 to 2025-02-04) that represents a *single patient room
> snapshot per row*, not whole-hospital totals. The ~36/60/24 kW figures are therefore not
> whole-building loads. For comparison, the
> [NREL ComStock hospital profile](bidmc-parquet-load-data-manual.md) puts a comparable
> 500,000 sq ft hospital at **8,026 MWh/year** ≈ 916 kW average. Treat the tier split as a
> *ratio* (roughly 26% / 44% / 18% by these numbers), not as absolute magnitudes.
## Energy balances
### Overall balance
```
P_solar(t) + P_CHP(t) + P_Grid(t) + P_FuelCell(t) + P_Battery_discharge(t)
= P_Load(t) + P_Battery_charging(t) + P_Electrolyzer(t)
```
where `P_Load` is the sum of all tiers (Tier 1 + 2 + 3) and `P_Grid` is typically zero unless
there is an emergency.
### Battery storage — state of charge update
```
P_Battery_charging(t) × η_charging × Δt P_Battery_discharging(t) × Δt
SoC(t) = SoC(t1) + ──────────────────────────────────────── ─────────────────────────────
E_cap E_cap × η_discharging
```
where `η` are the round-trip efficiencies and `E_cap` is the total energy the battery can store
when fully charged (kWh). `SoC(t)` should remain between its min and max values.
### Hydrogen loop
**Electrolyzer (charging):**
```
P_Electrolyzer × Δt
m_H2_produced = ─────────────────────────
LHV_H2 × η_electrolyzer
```
**Fuel cell (discharging):**
```
P_FuelCell × Δt
m_H2_consumed = ─────────────────────────
LHV_H2 × η_fuel_cell
```
**Hydrogen tank balance:**
```
Mass(t) = Mass(t1) + m_H2_produced m_H2_consumed
```
where `LHV_H2` is the heat released by combusting a given amount of hydrogen —
**approximately 33.3 kWh/kg, or 120 MJ/kg**.
### Load tier dispatch logic
- If `P_available ≥ P_Total_Load` → all tiers are powered
- If `P_available < P_Total_Load` → shed Tier 3 (not critical)
- If `P_available < (Tier 1 + Tier 2)` → shed Tier 2
- `P_available` **must always exceed Tier 1**, as it is critical
## KPI formulae
**Self-Sufficiency Rate (SSR)**
```
Σ (P_solar + P_CHP + P_FuelCell + P_Battery_discharge)
SSR = ───────────────────────────────────────────────────── × 100
Σ P_Load
```
**Grid Dependency Ratio** — aiming for **0%** in normal operation
```
Σ P_Grid
GDR = ────────── × 100
Σ P_Load
```
**Critical Load Uptime** — aiming for **100%**, showing critical points have power at all times
```
Total hours of full Tier 1 powered
CLU = ──────────────────────────────────── × 100
Total hours in period
```
**SoC Violation Rate** — aiming for **0%**, so the battery never goes dangerously low (risking
loss of Tier 1 load) or overcharges (risking hardware damage)
```
# of intervals where SoC < SoC_min or SoC > SoC_max
SVR = ──────────────────────────────────────────────────── × 100
Total intervals
```
## Revision history
Two copies of this document exist in the repository with different content:
| Location | Size | MD5 | Status |
|---|---|---|---|
| `Energy_Managment/Beth Israel Deaconess Medical Center/` | 161,868 B | `27a86f33…` | **Current** — this report |
| `Energy_Managment/` (parent folder) | 161,536 B | *(differs)* | **Superseded** |
The only difference: the current revision adds the **SoC Violation Rate** KPI and its target.
Everything else is byte-identical in content. The parent-folder copy is retired to
[`superseded/`](../../superseded/).
## Notes on scope
The title and content mix two case studies. The dispatch chain described here — MATEP CHP,
Eversource grid, Boston — is **BIDMC-specific**. UCSD's microgrid uses entirely different
plant (a 2.8 MW molten-carbonate fuel cell, 30 MW of gas turbines, a 2.5 MW / 5 MWh BYD
battery) documented separately in the [UCSD Equipment Manual](ucsd-equipment-manual.md). The
"hybrid" in the title refers to combining lessons from both sites, not to a single physical
plant.
Note also that this document's **three-tier** load model does not match the **two-way**
`L_crit` / `L_noncrit` split in the
[Simulator I/O Interface](../02-specifications/simulator-io-interface.md). Mapping Tier 1 →
critical and Tiers 2+3 → non-critical is the obvious reconciliation, but it has not been
written down anywhere as a decision.
## Related
- [UCSD Equipment Manual](ucsd-equipment-manual.md) — the other case study's plant
- [BIDMC Datasets Manual](bidmc-datasets-manual.md) — the `hospital_communication_energy_system.csv` schema
- [BIDMC ComStock Load Profile](bidmc-parquet-load-data-manual.md) — the whole-building load proxy
- [Simulator I/O Interface](../02-specifications/simulator-io-interface.md) — the simulator contract these balances must satisfy
- [Rule-Based Controller](../02-specifications/rule-based-controller.md) — the dispatch logic in policy form