GriddyAbout← Back to the app

About Griddy

Plan the grid infrastructure growing demand needs.

Choose sites for power plants, storage and grid connections, simulate every hour of 2024, and compare cost, carbon and resilience with a source behind every number. Home mode keeps the map and explores one household's electricity use, bills and solar options.

Mission

Growing communities, electrification and new industry need more grid infrastructure. Before anyone files an interconnection request, the first questions are simple to ask and slow to answer: where could this go, what would power it, what would it cost, how much carbon would it emit, and what could go wrong?

Griddy helps plan power plants, energy storage and grid connections. Choose a site on a real map of the grid, design infrastructure to serve demand, run every hour of a real year, and read the cost, the carbon and the risks, with a source behind every number and the caveats said out loud. It is a screening tool for planners, communities, developers and students, built at the Stanford Cleantech Hackathon 2026.

Data centers are one optional demand profile. The primary workflow plans electricity infrastructure for an area's needs; it does not replace a utility interconnection study or detailed power-system design.

What Griddy does

  • Explore the real grid

    A map of California's power plants (EIA-860), transmission lines of 69 kV and up (CEC), substations (OpenStreetMap), utility and county boundaries (the balancing authority is shown in the site summary), and the interconnection queue by county (LBNL). Click anywhere for the nearest substation and line, their voltage and distance.

  • Plan and build a power supply

    Enter the demand to serve and let Griddy size a hybrid, solar + storage, wind + storage, combined-cycle or peaker plant, or build your own mix of generation, batteries and a grid connection. Data-center load profiles are an optional customer use case.

  • Simulate every hour of a year

    8,784 hours of 2024: real weather at the site, real CAISO prices and grid carbon, and a battery that charges and discharges hour by hour. Demand is met, or the shortfall is counted.

  • Count the cost

    Up-front and yearly costs, net present cost and cost per MWh over 20 years in real 2024 dollars, from the national lab cost baseline (ATB 2025) and utility interconnection cost guides, plus a bill of materials and land use.

  • Count the carbon and the air

    Annual operational CO₂e from on-site combustion and hourly grid imports, separately from a partial estimate of construction carbon. Show cumulative modeled carbon and carbon-price sensitivity, with editable reference footprints. NOx and PM2.5 come from on-site gas; the 24/7 carbon-free energy score checks every hour.

  • Stress-test it

    A heat wave, the loss of the biggest gas unit, a three-day renewable drought, a full grid outage, firm capacity at the peak, and flags for everything that needs a real utility interconnection study.

  • Screen the site

    Google Earth Engine land screening (land cover, fallowed farmland, slope, protected land, water, sunshine), Sentinel-2 imagery, air quality and EPA nonattainment areas, and carbon-aware scheduling of flexible AI load with a Green Software Foundation SCI score per GPU-hour.

  • Look ahead

    County-level demand to 2030, 2035 and 2040 under editable scenarios (population, electrification, efficiency, new data centers), and recommended places to build the new capacity that growth needs.

  • Show the work

    Every number carries a source and a kind: observed (read from data), assumption (a stated choice), simulated (Griddy's model) or inferred (derived from observed values). The report collects them all.

How to use it

Nine steps from an empty map to a report you can hand to someone.

Either sidebar folds to a slim rail so the map can use the full width. On a phone, Plan/Site/Layers/Build sit above the map and the results below it.
  1. Find a site

    Type a city, county, power plant, substation or lat, lon into the map's search box, or click the map. “California” zooms out to the whole state and “Site” flies back to yours. Clicking a site opens the Site tab on the left (on a phone, tap it above the map): the nearest substation and transmission line with their voltage and distance, plus the satellite and air-quality screening.

  2. Plan the project

    In Plan, enter the peak demand to serve and load factor, then pick a plant type. The design updates automatically. Check projected demand, cost, operational and upfront carbon, and unmet hours. Want to know who lives nearby? “Highlight area” on the map lets you draw an area and see its people and household demand.

  3. Choose what the map shows

    Layers turns plants, transmission lines, substations, boundaries, the interconnection queue and the other overlays on and off, and holds the legend.

  4. Fine-tune the design (Advanced)

    Switch the header to Advanced and open Build: start from a preset, change each asset's size (and a battery's hours), the grid connection (import and export limits, length of the new line) and the assumptions (discount rate, gas price, carbon price, analysis period, import adder). Every change re-runs the whole year.

  5. Read the results

    In Basic, the right sidebar's Summary has the headline numbers and the report link. In Advanced: Simulate is the hour-by-hour dispatch chart (pick any day), Costs has NPC, LCOE, the cost waterfall, emissions, the 24/7 CFE score, the bill of materials and the method notes, Stress lists every finding by severity (look for “needs a utility study”), and Report has the report link and CSV export. Hover any number with a source icon to see where it came from; dotted-underlined jargon explains itself.

  6. Compare designs

    Single | Compare in the header puts the presets side by side: cost, carbon, clean-energy hours and air pollutants. Power plants & grid | Community switches between larger infrastructure and a community microgrid. Data-center settings are optional under Build.

  7. Explore a household

    Choose Individual / Home, then click the map or search to place a house. Enter usage and provider details under Home. In the results, choose a month, weekday/weekend and local clock hour: the daily usage, solar, grid mix and carbon charts follow that selection. Annual bills and what-if savings remain full-year estimates. Solar uses a nearby cached typical-year profile; hourly grid context is historical CAISO 2024.

  8. Look ahead

    “Forecast” on the map opens the forecast drawer: pick the low, mid or high scenario and a target year, adjust population, electrification, efficiency and new data centers, and see peak demand by region and county. Its Sites panel places the new capacity on the map; “Use this site” moves your project there.

  9. Share it

    Report in the header opens a printable report with every assumption and source: “Download CSV” or “Print / Save as PDF”.

  10. Make it comfortable

    The ⚙ Settings gear (on this page too) sets the theme (Auto follows your device; Light; Dark; or Mixed: black panels with a light map), text size, jargon tooltips, reduced motion, the basemap, map contrast and brightness, and which sidebars are folded.

The math

Every equation below is the one the code runs, with its symbols, units, where the result appears in the app, and the file it comes from. Nothing is fitted to make a design look good. Defaults first:

Discount rate
7% / yr, real
Griddy default, editable
Analysis horizon
20 years
Griddy default, editable
Dollars
real 2024 USD
BLS CPI-U: ×1.029494 from 2023$, ×0.974362 from 2025$
Weather and prices
2024, 8,784 hours
Open-Meteo; CAISO OASIS day-ahead LMP
Gas price
$3.65 / MMBtu
EIA 2024 California citygate (N3050CA3)
Import delivery adder
$20 / MWh
assumption (transmission access + delivery)
Carbon price
$0 / t (on-site combustion only)
editable; CA allowance $32.48/t (Aug 2026 auction) shown as a hint
Gas CO₂ factor
53.06 kg CO₂ / MMBtu
EPA 40 CFR 98, Table C-1
CARB unspecified imports
0.428 t CO₂e / MWh × 1.02
17 CCR 95111(b)(1)
Heat rate, CC / CT
6.087 / 9.717 MMBtu / MWh
NLR ATB 2025, full load
Battery
85% round trip, 4 h default
NLR ATB 2025
Lifetimes
PV, wind, gas 30 yr · battery 15 · grid tie 47
ATB 2025 Definitions; PG&E 2027 GRC depreciation study
NOx / PM2.5
0.099 / 0.0066 lb / MMBtu
EPA AP-42 §3.1 (no SCR; total PM as PM2.5)
Upstream methane (off)
12.47 kg CO₂e / MMBtu
Alvarez et al. 2018 (2.3% leak); IPCC AR6 GWP100 29.8
Unserved energy (dispatch only)
$1,000 / MWh
assumption; used only to choose the battery policy

1 · Simulating the year, hour by hour

The simulator walks through all 8,784 hours of 2024 (a leap year; other weather years drop Feb 29). Hour h starts at Jan 1 00:00 PST + h hours, fixed UTC−8 with no daylight saving. Each hour lasts one hour, so a power in MW held for that hour is the same number in MWh.

Campus demand each hour

Dh=Ppeak·clip(1+b(zh−1),0,1)
zh=rh−mean(r)max(r)−mean(r)
b=1−LF
PUEh=PUE0(1+0.006·max(Th−18,0))
Dh
demand at the meter in hour h, cooling included [MW]
Ppeak
facility peak you enter (IT load × PUE) [MW]
LF
load factor = average ÷ peak [0–1]
rh
raw shape: AI training, AI inference, or the EIA-930 PG&E 2024 community load [relative]
Th
outdoor 2 m temperature at the site (Open-Meteo, 2024) [°C]

The shape is stretched so its maximum is exactly the peak and its average is peak × LF. If clipping at zero lifts the average, b is raised by bisection until the mean is within 0.01% of the target; a load factor the shape cannot reach is flagged. For the AI profiles, cooling adds 0.6% of load per °C above 18 °C (about +13% at 40 °C). The flat profile is simply peak × LF every hour.

Used in: Plan tab (facility peak, load factor) and Build tab (profile, PUE); the first input to every hour.

Code: backend/app/simulate/demand.py

Solar and wind output

Gsolar,h=Psolar·clip(cfh,0,1)
cfwind(v)=(1−0.12)·f(v)
f(v)={v3−33123−333≤v<12112≤v≤250otherwise
Gsolar,h
solar output in hour h, before any curtailment [MW]
Psolar
installed solar capacity (AC) [MW]
cfh
output per MW installed that hour, from real 2024 weather [0–1]
v
wind speed at 100 m hub height [m/s]

Solar per MW comes from pvlib: a single-axis tracker (±60°, backtracking, ground-coverage ratio 0.35, albedo 0.2), PVWatts temperature coefficient −0.37%/°C, 14% system losses, DC/AC ratio 1.2 and a 96% inverter, run on Open-Meteo's 2024 hourly irradiance at the site. Wind uses a generic utility turbine curve (cut-in 3, rated 12, cut-out 25 m/s) with 12% availability, wake and electrical losses. Wind output is the same formula with Pwind. Both are must-take: the simulator never turns them down on purpose; surplus is stored, exported or curtailed.

Used in: Simulate tab (dispatch chart), every cost and carbon number downstream.

Code: backend/app/simulate/dispatch.py, backend/app/simulate/weather.py

Power balance, every hour

Dh=∑kGk,h+Bhdis+Ih+Uh−Bhch−Xh−Ch
cgas=HR·pgas+VOM+pCO₂·HR·53.061000
cimp,h=λh+a
Gk,h
generation of kind k (solar, wind, gas CC, gas CT); solar and wind include curtailed output [MW]
Bhdis
battery discharge [MW]
Bhch
battery charge [MW]
Ih
grid imports, at most the import limit [MW]
Xh
grid exports, at most the export limit, only when the price is ≥ 0 [MW]
Uh
unmet (unserved) demand [MW]
Ch
curtailed solar and wind (made, then thrown away) [MW]
λh
CAISO 2024 day-ahead hourly price at your utility's load point (PG&E, SCE or SDG&E DLAP); sites outside SCE and SDG&E territory, municipal utilities included, use the PG&E price [$/MWh]
a
import delivery adder (transmission access + delivery), default 20 [$/MWh]
HR
gas heat rate at full load (ATB 2025): CC 6.087, CT 9.717 [MMBtu/MWh]

Dispatch order. A surplus hour charges the battery, then exports (if the price is not negative), then curtails. A deficit hour discharges the battery, then runs firm supply in merit order of this hour's cost: gas combined cycle always before the gas peaker, and imports jump ahead of a gas tier only when strictly cheaper. Whatever is still missing is unmet. At the default $3.65/MMBtu gas price, CC costs ≈ $24.3/MWh and CT ≈ $44.2/MWh to run.

Grid charging (on by default when grid-connected). In a “cheap” hour, where cimp,hRTE+$5 per MWh is below the value of stored energy over the next 24 h, the battery may also charge from spare import capacity. That uses perfect day-ahead foresight (an upper bound), and the year is kept only if it costs no more than the same year without grid charging, with unserved energy valued at $1,000/MWh. The year is cyclic: a first pass from 50% charge finds the Dec 31 state of charge, and the real pass starts from it.

Carbon is not priced on imports because CAISO prices already include California cap-and-trade costs. Results are rounded to 0.001 MW, so the balance holds to within a few kW.

Used in: Simulate tab (dispatch chart and totals); checked for every hour of every preset by backend/tests/test_contract.py.

Code: backend/app/simulate/dispatch.py, backend/app/simulate/engine.py

Battery state of charge, with round-trip efficiency

SOCh=SOCh−1+ηBhch−Bhdisη
η=RTE=0.85≈0.922
0≤SOCh≤E=PB·d
Bhch≤min(PB,E−SOCh−1η)
Bhdis≤min(PB,ηSOCh−1)
SOCh
energy stored at the end of hour h [MWh]
RTE
round-trip efficiency, 0.85 (ATB 2025 utility-scale battery) [0–1]
η
one-way efficiency; losses split evenly between charging and discharging [0–1]
PB
battery power rating (charge and discharge limit) [MW]
d
duration, default 4 h [h]
E
energy capacity [MWh]

A surplus hour only charges and a deficit hour only discharges, so the battery never does both at once. It charges from on-site solar and wind surplus (and, with grid charging, spare imports), never from gas. Battery cycles per year = ∑hBhdis/E.

Used in: Simulate tab (charge, discharge and state of charge in the dispatch chart; battery cycles), Stress tab (storage duration, grid outage).

Code: backend/app/simulate/dispatch.py, backend/app/simulate/engine.py

Capacity factor and curtailment

CFk=∑hGk,hPk·H
curtailment share=∑hCh∑h(Gsolar,h+Gwind,h)
CFk
capacity factor of kind k: average output ÷ nameplate [0–1]
Pk
installed capacity of kind k [MW]
H
hours in the year (8,784 in 2024) [h]

Generation counts curtailed output, so CF says what the weather allowed, not what was used; the curtailment share says how much was thrown away. ATB's reference CFs (PV 0.3085, wind 0.4481) are shown for comparison only: the simulation uses the site's hourly weather.

Used in: Simulate tab; the site recommender's sizing (annual solar and wind capacity factors from the same 2024 profiles).

Code: backend/app/simulate/engine.py

Firm capacity margin (stress test)

Firm=0.95PCC+0.92PCT+cBPB+csolarPsolar+cwindPwind+Imax
margin=FirmDpeak−1≥15%
Firm
capacity you can count on at the peak [MW]
cB
battery credit = min(0.9, duration ÷ the typical daily deficit, at least 4 h) [0–0.9]
csolar
solar (or wind) credit: its average output in the year's 100 highest net-load hours [0–1]
Imax
grid import limit [MW]

Gas is derated by approximate NERC GADS forced-outage rates (5% CC, 8% CT). The 15% target is in line with the CPUC planning reserve margin (~15–17%). This is a screening proxy, not an ELCC or resource-adequacy study. The other stress tests rerun the hottest July week (+2 °C, gas derated 0.4–0.6%/°C) and the tightest week without the largest gas unit (400 MW CC / 100 MW CT blocks), check the year's lowest 72 h of solar + wind, and dispatch critical load through a full grid outage.

Used in: Stress tab, “Firm capacity” finding (pass at ≥ 15% margin, warn below, fail below 0%).

Code: backend/app/simulate/stress.py

2 · Turning the year into money

All dollars are real 2024 US dollars and the discount rate is real. The campus owner builds and owns every on-site asset and the new interconnection, pays O&M and fuel, and buys grid imports. Owned generation is never also counted as purchased power, exports earn nothing by default, and there are no tax credits.

Up-front cost (CAPEX) and yearly operating cost (OPEX)

Ki=1000·Pi·cikW
Kbattery=1000·PB·(ckW+d·ckWh)
O=FOM+VOM+Fuel+∑hIh(λh+a)+pCO₂Edirect−φ∑hXhλh
Ki
CAPEX of asset i, paid in year 0 [$]
Pi
capacity of asset i (AC for solar) [MW]
cikW
catalog cost per kW of capacity, table below [$/kW]
ckWh
battery cost per kWh of storage; d is its duration in hours (default 4) [$/kWh]
O
operating cost of the simulated year, repeated in years 1…N [$/yr]
FOM
fixed O&M per kW-year (battery: per kW plus per kWh) [$/yr]
VOM
variable O&M × simulated MWh (gas only; zero for PV, wind, battery in ATB) [$/yr]
φ
share of the hourly price paid for exports, default 0 [0–1]
pCO₂
carbon price, default $0/t, applied to on-site combustion CO₂ only [$/t]

Costs come from NLR (formerly NREL) ATB 2025 v1.0.0, Moderate scenario, 2027 online date, no tax credits, converted from 2023$ with the BLS CPI-U deflator 1.029494. ATB's CAPEX includes a generic grid-connection cost (GCC); Griddy removes it, using OCC + CFC × OCC/(OCC + GCC), because it prices each site's own line and substation from the CAISO participating-utility 2025 unit cost guides (flat rural terrain, 35% line contingency included; 2025$ × 0.974362). POI ≥ 345 kV uses the 500 kV tier, ≤ 161 kV the 115 kV tier, anything else 230 kV.

Catalog defaults, 2024$ (per-asset overrides are allowed):

  • Solar PV (single-axis tracking) · 30 yr

    $1,235.48 /kWac · O&M $23.30 /kW-yr

  • Onshore wind · 30 yr

    $1,714.67 /kW · O&M $39.61 /kW-yr

  • Gas combined cycle (H-frame 2-on-1) · 30 yr

    $1,263.55 /kW · O&M $30.78 /kW-yr + $2.04 /MWh

  • Gas combustion turbine (F-frame) · 30 yr

    $1,234.71 /kW · O&M $27.18 /kW-yr + $8.75 /MWh

  • Battery (Li-ion) · 15 yr

    $370.86 /kW + $218.15 /kWh · O&M $14.35 /kW-yr + $8.44 /kWh-yr

  • New line + substation · 47 yr

    230 kV: $2.43M /km + $22.4M

Lifetimes: ATB 2025 Definitions, “Technical Lifetimes for Technologies”. Interconnection: PG&E 2027 rate case depreciation study, station equipment 47-R2 survivor curve (the shortest major component, so the least salvage credit).

Used in: Costs tab (cost lines, waterfall), Summary, Report.

Code: backend/app/evaluate/economics.py, backend/app/evaluate/catalog.py

Fuel: MWh × heat rate × gas price

Qk=HRk∑hGk,h
Fuel=∑kHRk∑hGk,hph
ph=p¯·mmonth(h)mean(m)
Qk
gas burned by kind k (CC or CT) [MMBtu/yr]
HRk
full-load heat rate: CC 6.087, CT 9.717 (ATB 2025) [MMBtu/MWh]
ph
gas price in hour h [$/MMBtu]
p¯
your annual-average gas price, default $3.65 (EIA 2024 California citygate, $3.79/Mcf ÷ 1.038) [$/MMBtu]
mmonth(h)
2024 PG&E Citygate monthly price, used only as a shape (normalized to mean 1) [$/MMBtu]

No part-load penalty: the code uses ATB's full-load heat rate at every output level, so a gas unit idling at low output burns the same MMBtu per MWh as at full load (real units burn more). The monthly shape (Jan $6.07 … Jun $2.14 … Dec $3.39, read from CAISO DMM's 2024 Annual Report, Fig. 2.7) applies only with weather year 2024, so gas and power prices come from the same year; the price you enter stays the authoritative annual average. Dispatch ranks gas by that annual average.

Used in: Costs tab (“Natural gas” lines), and the gas burn every emission number starts from.

Code: backend/app/evaluate/economics.py

Annuity factor and capital recovery factor (CRF)

AF(r,N)=1−(1+r)−Nr
CRF(r,L)=r(1+r)L(1+r)L−1=1AF(r,L)
r
real discount rate, default 7% [/yr]
N
analysis horizon, default 20 years [yr]
L
an asset's lifetime [yr]

AF is what $1 a year for N years is worth today. CRF is the reverse: the level yearly payment that repays $1 of CAPEX over L years. At r = 7%: AF(7%, 20) = 10.594, CRF(7%, 30) = 0.0806, CRF(7%, 15) = 0.1098.

Used in: Costs tab: present value of 20 years of OPEX, and the CRF cross-check on LCOE.

Code: backend/app/evaluate/finance.py

Net present cost (NPC), with replacements and salvage

NPC=∑t=0NFt(1+r)t
F0=∑iKi
Ft=O+∑i:t=kLi<NKiρi(t)−[t=N]∑iSi
Si=Kiρi(tilast)·tilast+Li−NLi
Ft
net cash flow in year t (t = 0 … N) [$]
ρi
replacement cost ratio: ATB Moderate projected CAPEX in 2027 + t ÷ CAPEX in 2027 [×]
tilast
year of asset i's last installation: the largest k·L < N (0 if it outlives the horizon) [yr]
Si
salvage credit for the life left at year N (straight-line) [$]
[t=N]
1 in the final year, 0 otherwise

Year 0 holds all CAPEX; years 1 … N repeat the simulated year's OPEX; an asset with life L is re-bought in every year k·L < N; in year N the unused life of the last installation is credited back. At N = 20: 30-year solar, wind and gas get 1/3 back; a 15-year battery is replaced in year 15 at 0.708× its 2027 cost (ATB Moderate, 2042 ÷ 2027) and gets 2/3 of that back; the 47-year interconnection gets 27/47 back.

Worked example from data/evaluate/README.md: a 300 MW / 1,200 MWh battery costs $373.0M in year 0; its year-15 replacement is $264.2M (present value $95.7M) and its year-20 salvage $176.1M (present value −$45.5M).

Used in: Costs tab (NPC headline, year-by-year cash flows, NPC breakdown), Compare view, Report.

Code: backend/app/evaluate/finance.py

Levelized cost of energy (LCOE) = NPC ÷ discounted MWh

LCOE=NPC∑t=1NEserved(1+r)t
LCOE=NPCEserved·AF(r,N)
Eserved=∑h(Dh−Uh)
LCOECRF=∑iKiCRF(r,Li)+OEserved
Eserved
energy actually delivered to the campus each year = demand − unmet [MWh/yr]
LCOECRF
cross-check: each CAPEX spread over its own life with CRF [$/MWh]

Discounting the MWh as well as the dollars is what makes LCOE a fair “price per MWh” over the project's life. Unmet energy is not counted as served, so a design that leaves load unserved does not look cheaper per MWh.

Used in: Summary and Costs tab headline, Compare view, Report.

Code: backend/app/evaluate/finance.py

3 · Carbon, air quality and 24/7 clean energy

Annual CO₂e = on-site gas + imports × hourly grid intensity

E=∑kQk·53.061000+∑hIhgh1000
gh=∑fMf,hef∑fMf,h
E
annual emissions [t CO₂e/yr]
Qk
gas burned by kind k, from the fuel equation [MMBtu/yr]
gh
CAISO's average grid CO₂ intensity in hour h (2024 fuel mix) [kg/MWh]
Mf,h
CAISO supply from fuel f in hour h (imports and batteries included, negatives dropped) [MW]
ef
emission factor: gas 400, unspecified imports 428, coal 1,000, other 400; solar, wind, hydro, nuclear, geothermal, biomass 0 [kg/MWh]

53.06 kg CO₂/MMBtu is EPA's natural-gas factor (40 CFR 98 Table C-1); combustion CH₄ and N₂O (under 0.1% of CO₂e) are left out. Using hourly intensity rewards importing when the grid is clean. The batteries and exports carry no emissions and earn no credit. Factors are never tuned to make one design win: an on-site combined cycle (6.087 × 53.06 ≈ 323 kg/MWh) can be dirtier than CAISO's average imports. As a sanity check the Costs tab shows eGRID2023's CAMX rate, 194.3 kg/MWh (generation inside California only).

Upstream methane (off by default, always reported): Q×12.47 kg CO₂e/MMBtu = 0.023/0.977 × 17.78 kg CH₄/MMBtu × 29.8 (2.3% supply-chain leakage, Alvarez et al. 2018; GWP100 29.8, IPCC AR6). Emission intensity is 1000E/Eserved kg/MWh.

Used in: Summary, Costs tab (emissions breakdown, intensity), Compare view, Report.

Code: backend/app/evaluate/emissions.py, backend/app/simulate/profiles.py

Alternative import accounting: CARB's unspecified-import factor

EimportsCARB=1.02×0.428×∑hIh
1.02×0.428=0.43656t / MWh
EimportsCARB
import emissions under California's reporting rule [t CO₂e/yr]
1.02
transmission-loss factor [×]
0.428
default factor for electricity of unspecified origin [t CO₂e/MWh]

From CARB's Mandatory Reporting Regulation, 17 CCR 95111(b)(1): CO₂e = MWh × TL × EF. It is the regulator's proxy for marginal, dispatchable imports, so it is usually higher than the hourly average and is shown next to it rather than replacing it.

Used in: Costs tab (switch between CAISO hourly and CARB import accounting).

Code: backend/app/evaluate/emissions.py

NOx and PM2.5 from EPA AP-42

mNOx=Q·0.099·κ
mNOxSCR=(0.00737QCC+0.00921QCT)·κ
mPM2.5=Q·0.0066·κ
κ=0.453592371000t / lb
Q
total on-site gas burned [MMBtu/yr]
κ
0.45359237 kg per lb ÷ 1000: turns pounds into metric tonnes [t/lb]

The primary NOx case is AP-42 Table 3.1-1 lean-premix turbines with no SCR, 0.099 lb/MMBtu (conservative). The California BACT alternative with SCR uses 0.00737 lb/MMBtu for CC (2.0 ppm) and 0.00921 lb/MMBtu for CT (2.5 ppm), from BAAQMD BACT guidelines. PM2.5 counts all of AP-42 Table 3.1-2a total PM, 0.0066 lb/MMBtu, as PM2.5 (an upper bound). All are zero without gas.

Used in: Costs tab (NOx, PM2.5), Compare view, and the Stress tab's air-permit-risk finding when on-site gas NOx lands in an EPA nonattainment area.

Code: backend/app/evaluate/emissions.py

24/7 carbon-free energy (hourly matching)

Rh=max(Gsolar,h+Gwind,h−Ch−Xh,0)
CLh=min(Rh,Dh)+Bhdisfh+(Ih−Ihch)γh
24/7 CFE=#{h:CLh≥Dh}#{h:Dh>0}
Rh
on-site solar and wind kept on site (not curtailed, not exported) [MW]
CLh
clean supply reaching the load in hour h [MW]
fh
clean fraction of the energy in the battery (a well-mixed pool, updated every charge) [0–1]
Ihch
imports that went into the battery (charge not covered by on-site renewables, split pro rata between imports and gas) [MW]
γh
CAISO's clean share that hour: (solar + wind + geothermal + nuclear + hydro) ÷ all supply [0–1]

An hour counts only when clean supply covers all demand that hour; the score is the share of such hours. For contrast the Costs tab also shows the energy-weighted hourly share, ∑min(CLh,Dh)/∑Dh, and the annual-netting share (all clean MWh over the year ÷ all demand, capped at 100%), which is what most “100% renewable” claims use.

Used in: Costs tab (24/7 CFE card, by month and hour of day), Summary, Compare view.

Code: backend/app/evaluate/cfe.py

4 · Demand forecast and where to build

Which models are live. The trained ones. The forecast is the XGBoost model below (API mode ml; on held-out test data its P50 misses hourly load by 8.7% on average (given the year's mean load), against 11.2% for a climatology baseline, and its P10–P90 band held 50% of hours against a nominal 80%, so read P10 and P90 as a planning range, not calibrated odds). Site suitability is the trained classifier (mode model; spatial cross-validation ROC-AUC 0.92–0.96 by technology). Each has a fallback for when no trained artifact has been exported: the observed 2024 baseline (mode scenario_on_observed: the same scenario formulas, with 2024's observed peak-to-mean ratio in every year, so P50 = P90) and the documented screening score heuristic-v1 (mode heuristic, shown below). The API's mode field always says which one answered.

Hourly demand shape: XGBoost quantile model (P10 / P50 / P90)

ŷr,h(α)=fα(xr,h)
ℓα(y,ŷ)=max(α(y−ŷ),(α−1)(y−ŷ))
yr,h
load in region r, hour h ÷ that region-year's mean load (the shape, not the level) [ratio]
ŷ(α)
the model's α-quantile prediction, α ∈ {0.1, 0.5, 0.9} [ratio]
xr,h
23 features: region, hour, weekday, weekend, holiday, month, day-of-year (sin, cos), trend year, temperature (now, 1 h and 3 h lags, 24 h mean and max, 72 h mean), cooling and heating degree-days, humidity, dew point, solar radiation (rooftop PV), wind
ρr50
peak ÷ mean ratio for the year: median over replayed weather years of the P50 annual peak (ρ⁹⁰: 90th percentile of the P90 peaks) [ratio]

One booster covers the seven EIA-930 load regions (PG&E, SCE and SDG&E areas of CAISO, plus LADWP, BANC, IID and TID) on hourly load from 2019 on and Open-Meteo weather at up to six population-weighted points per region. It is split by time, never at random: train through 2023, early-stop on 2024 (max depth 8, learning rate 0.05, up to 4,000 rounds), and report accuracy on 2025–2026, which it never sees: MAPE, monthly-peak error and P10–P90 coverage, next to a naive climatology baseline. Quantiles are sorted so they never cross.

Used in: Forecast drawer (peak demand by region and county, P50 and P90).

Code: ml/demand_forecast/train.py, ml/demand_forecast/dataset.py, ml/demand_forecast/export.py

Scenario growth to 2030 / 2035 / 2040

Ec(y)=Ec(2024)·πc(y)·(1+e−η)y−2024
Pr90(y)=L¯r(y)·ρr90(y)+DCr·LFdc·(1−φ)
Ec
annual energy of county c (EIA-930 regional load split by 2020 Census population) [MWh]
πc
CA Department of Finance P-2A projected population ratio for the county, year y ÷ 2024 [×]
e,η
per-capita electrification growth and efficiency offset [/yr]
L¯r
region mean load in year y [MW]
DCr
new data-center peak added in the region's counties [MW]
LFdc
data-center load factor, default 0.9 [0–1]
φ
flexible (carbon-aware) share of that load: adds energy, assumed off the peak hour [0–1]
Pr50
the median peak: the same formula with the P50 ratio [MW]

Presets (ml/demand_forecast/scenarios.json): low electrification 0.8%/yr, efficiency 0.7%/yr, no new data centers; mid 1.5%/yr and 0.7%/yr, a 1 GW AI campus in Kern and 500 MW in Santa Clara, 10% flexible; high 2.5%/yr and 0.5%/yr with 4 GW of data centers in Kern, Santa Clara, Fresno and Imperial. Growth is a scenario, not a prediction: the model learns weather and calendar response, not future EV or heat-pump adoption.

Used in: Forecast drawer: scenario presets, target year and what-if sliders (recomputed in milliseconds, no model run).

Code: ml/demand_forecast/scenarios.py, backend/app/forecast/service.py

Site suitability for each technology

psolar=0.45e−dline/15+0.20(1−crowd)+0.35clip(GHI−4.51.5,0,1)
pwind=0.40e−dline/15+0.10(1−crowd)+0.50clip(v100−44,0,1)
pbattery=0.50e−dsub/20+0.30e−dline/15+0.20dem
pgas=0.40e−dline/15+0.30dem+0.30(1−NA)
pi,k
suitability of 5 km cell i (about 15,000 scored cells over California) for technology k [0–1]
dline
distance to the nearest operating ≥ 220 kV line (straight line) [km]
dsub
distance to the nearest ≥ 220 kV substation [km]
GHI,v100
ERA5 2024 mean solar irradiance (kWh/m²/day) and 100 m wind (m/s)
crowd
clip(ln(1 + people within 10 km) ÷ 12, 0, 1) [0–1]
dem
ln(1 + demand within 150 km), rescaled to 0–1 over the cells [0–1]
NA
1 inside an EPA ozone / PM nonattainment area [0/1]

Trained model (train.py): one XGBoost classifier per technology, pi,k=σ(∑mfm(xi)), learning “where plants like this were actually built” from EIA-860 plants ≥ 5 MW online since 2000 (about 347 solar, 66 wind, 74 battery, 114 gas) against 10 random cells per plant at least 3 km away, with class weights to balance them. Validation is 5-fold spatial cross-validation over 50 km blocks (neighbours never straddle train and test), reporting ROC-AUC, PR-AUC and precision in the top 10%. This is the model that scores the live recommended sites (ROC-AUC 0.92 for gas to 0.96 for wind).

Fallback screening score (heuristic-v1): the fixed, documented blend in the equations above, used only when no trained artifact has been exported.

Used in: Forecast drawer → Sites (recommended sites on the map, “Use this site”).

Code: ml/site_location/train.py, ml/site_location/export_sites.py

How much new capacity the forecast needs

MWk∈solar, wind=ΔE·s·wk(∑solar, windw)·H·CFk
Fleft=max(ΔP90−∑solar, windMWkck,0)
MWj∈battery, gas=Fleft·wj(∑battery, gasw)·cj
ΔE,ΔP90
new annual energy and new P90 peak in a region, from the forecast [MWh, MW]
s
clean-energy share of the new energy met by solar + wind, default 0.8 [0–1]
wk
mix weights: solar 0.75 : wind 0.25; battery 0.7 : gas 0.3
Fleft
new P90 peak still uncovered after the renewables' capacity credit [MW]
CFk
annual capacity factor from the 2024 site profiles (solar: mean of the sites ≈ 0.28; wind: the best site ≈ 0.19, as wind gets built where it blows) [0–1]
ck
capacity credit: solar ≈ 0.055 and wind ≈ 0.136 (their mean output in CAISO's 100 highest net-load hours of 2024); battery 0.9, gas 0.95 (assumed) [0–1]

Solar and wind are sized to the clean share of the new energy; batteries and gas cover the new peak left after the renewables' capacity credit.

Used in: Forecast drawer → Sites (nameplate need by technology and region; mix and shares are editable).

Code: backend/app/sites/service.py

Placing it: a least weighted-cost linear program (HiGHS)

minx,u∑icixi+100∑kuks.t.∑i∈kxi+uk≥needk0≤xi≤capi,uk≥0
ci=1.0(1−pi)+0.5min(dline,100)100+0.3qi+0.3(1−gi)+0.5NAi
xi
MW of technology k placed on cell i [MW]
uk
need that no cell can take, reported as unmet [MW]
ci
weighted cost score of the cell (not dollars) [per MW]
qi
MW already in the county's interconnection queue (LBNL Queued Up), ÷ the maximum [0–1]
gi
new demand within 150 km, ÷ the maximum [0–1]
NAi
1 if the cell is in a nonattainment area; counted for gas only [0/1]
capi
cell limit: 25 km² × share of land one project may use (solar 20%, wind 100%, battery and gas 1%) ÷ acres per MW, capped at 400 / 300 / 500 / 1,000 MW [MW]

Only the 600 lowest-cost cells per technology enter the program, from anywhere in California. Each placed site then gets a CAPEX from the ATB catalog and a gen-tie cost of distance × the 230 kV line cost. The ranking weights (1.0, 0.5, 0.3, 0.3, 0.5) are assumptions you can change in the Sites panel.

Used in: Forecast drawer → Sites (the recommended sites, their MW, CAPEX and gen-tie cost; unmet MW when cells run out).

Code: backend/app/sites/service.py

Data sources

All public. Processed files are committed with their source, license and vintage. The app runs without any API key; Earth Engine and AirNow only refresh the site screening when keys are set.

Grid and map

Weather, prices and grid carbon

Costs

Emissions and air

Site screening, forecast and siting

Team

Five people, five vertical slices, each with its own backend module, endpoint, panel, data and tests, merged into one app during the Stanford Cleantech Hackathon 2026.

  • A

    Explore

    The California grid map: plants, transmission lines, substations and boundaries; the site summary (nearest substation and line); the interconnection queue by county and 2.5D asset footprints.

    @heruirayli

    PRs: #5 ws/a-explore (queue + footprints first opened as #13, rebuilt on main as #15 by KrishWu)

  • B

    Simulate + Stress Test

    The 8,784-hour dispatch with real 2024 solar, wind, price and grid-carbon profiles, the battery logic, the stress tests and the dispatch charts.

    @JosephtheUnbelievable

    PRs: #6 ws/b-simulate

  • C

    Evaluate

    The ATB 2025 cost catalog, CAPEX / OPEX / NPC / LCOE, emissions and air pollutants, the 24/7 CFE score and the bill of materials; later demand-led project planning, progressive zoning and map search.

    @10zingC

    PRs: #4 ws/c-evaluate, #7 contract/gas-default, #23 feature/project-planning

  • D

    Build + Report + UI shell

    The scenario builder and presets, compare view, report export and the app shell; the shared foundation (contract, rename to Griddy, static export to Cloudflare Pages, Render backend).

    @KrishWu

    PRs: #3 and #9–#12 ws/d-builder; foundation #1, #2, #14, #16, #17, #22, #24, #27, #29

  • E

    Site Intelligence + Pitch

    Earth Engine land screening, Sentinel-2 imagery, AirNow and nonattainment air-permit risk, carbon-aware flexible load with an SCI score, and the pitch.

    @shaleenb36

    PRs: #8 ws/e-site-intel (GriddyGrade feasibility score open as #21; an ML-based version by JosephtheUnbelievable open as #30)

  • Phase 2

    Forecast and where to build

    • Phase 2 ML layout, model-artifact contract and API wiring; the demand forecast; the site-location model: @heruirayli (PR #18, #19, #20)
    • The trained demand-forecast artifact (demand-20261024-104738): @KrishWu (PR #26)
    • The trained site-location model and its ranking on the forecast: @10zingC (PR #25)

Who-built-what is taken from GitHub pull-request authorship only: each workstream's own feature branch and its follow-ups. Each person worked with their own coding agent under shared team rules.

Limitations and honesty notes

Judges and planners should know where the numbers stop. Every estimate in the app is labeled as one.

It is a screening tool

  • Griddy shows whether a design is worth a closer look, not that it can be built. Every real project needs a utility interconnection study (CAISO cluster study, or the utility's Rule 21 / WDAT process for small ties), site studies and permits.
  • Public maps show where lines and substations are, not how much spare capacity they have. That is why every site and every connection carries a “needs a utility study” flag.
  • Interconnection cost assumes flat rural terrain and excludes right of way, permitting, mitigation and network upgrades. Real gen-tie routes are longer than the straight-line distances used here.
  • The bill of materials is a count from nameplate and typical unit sizes, not an engineered design.

The simulated year

  • One weather and price year (2024). A different year, or a drier, hotter one, would change the answers; the stress tests probe some of that.
  • Dispatch is a transparent rule set, not an optimizer. Battery grid charging uses perfect 24-hour foresight of prices, demand and solar, which is an upper bound on what it can earn.
  • Gas runs at its full-load heat rate at every output (no part-load penalty), which understates fuel and CO₂ for units that idle.
  • Grid carbon is CAISO's average hourly intensity, not the marginal plant's. CARB's import factor is shown as the more conservative alternative.
  • Firm-capacity credits are screening proxies, not an ELCC or resource-adequacy study.

Costs and emissions

  • No tax credits or incentives (no IRA credits), so clean options look more expensive than many real deals. Exports earn nothing by default.
  • NOx uses lean-premix turbines without SCR (conservative); PM2.5 counts all particulate matter as PM2.5 (an upper bound). Upstream methane is reported but off by default and never priced.
  • Land is project area: wind's 85 acres per MW is mostly farmable spacing; its direct footprint is 2.47 acres per MW.
  • Jobs and offtake contract numbers are illustrative assumptions, not an economic-impact model.

Forecast and siting

  • The trained forecast model predicts the hourly shape of demand, not its long-term level: growth comes from scenario assumptions. On test data its P10–P90 band held about half of the hours, not 80%, so P90 is a hot-weather planning case rather than a calibrated probability. Without a trained artifact the API falls back to observed 2024 demand (mode scenario_on_observed, where P50 = P90) and says so.
  • County demand is regional load split by population, so industrial counties read low. Long-term growth is a scenario, not a prediction, and today's load shape is reused for 2040.
  • “Suitability” means “looks like where plants of this type were built”, not a feasibility study. Land ownership, zoning, habitat and grid capacity are not modeled. The trained classifier scores the sites; the documented screening blend (heuristic-v1) is its fallback, and the API's mode field says which one answered.
  • Substations are volunteer-mapped in OpenStreetMap: about half have no voltage tag and some may be missing. Queue MW is requested capacity; only about 13% of capacity requested in 2000–2020 was ever built.