Lesson 40 (Capstone 4): Decarbonization, Monte Carlo LCA & Low-Carbon Energy Integration

Courses Integrated: LCA Track 1 & 2 (Matrix LCI + Monte Carlo Pedigree Uncertainty) Β· Material Flow Analysis Β· Renewable Energy I (Solar Thermal)
Companion Datasets: LCA1_System_LCI_Book_Matrix.csv, LCA1_LCIA_Characterization_Factors.csv, Solar_Irradiance_Collector_Hourly.csv, UCI_Concrete_LowCarbon_SCMs.csv

Why This Capstone Matters

Every single environmental decarbonization claim requires uncertainty bounds! In LCA Track 2 Module 5, LCI emission intensities follow lognormal uncertainty distributions (Monte Carlo runs 1,000–10,000 stochastic solves of \(\mathbf{s} = \mathbf{A}^{-1}\mathbf{f}\)). Combining Solar Industrial Heat Replacement, Low-Carbon Slag Concrete, and Monte Carlo Matrix LCA completes your systems-ecology toolkit!

from pathlib import Path
def data_file(name):
    """Locate a dataset file whether running from SRC_DIR, module folder, HOMEWORK, or EXAMS."""
    for p in [
        Path("datasets") / name,
        Path("../datasets") / name,
        Path("../../datasets") / name,
    ]:
        if p.exists():
            return p
    raise FileNotFoundError(f"Missing dataset {name} in datasets/")
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

# --- Stage 1: Stochastic Monte Carlo LCA (LCA Track 2 Module 5 Method!) on Book System LCI ---
with data_file("LCA1_System_LCI_Book_Matrix.csv").open(encoding="utf-8", newline="") as f:
    lci = list(csv.DictReader(f))
with data_file("LCA1_LCIA_Characterization_Factors.csv").open(encoding="utf-8", newline="") as f:
    cfs = {r["Flow_ID"]: float(r["GWP100_kgCO2eq"]) for r in csv.DictReader(f)}

pcols = ["P1_Forestry", "P2_Pulping", "P3_Papermaking", "P4_Printing"]
tech = [r for r in lci if r["Flow_Type"] == "technosphere"]
bio = [r for r in lci if r["Flow_Type"] == "biosphere"]

A0 = np.array([[float(r[c]) for c in pcols] for r in tech])
f0 = np.array([float(r["Final_Demand_f"]) for r in tech])
B0 = np.array([[float(r[c]) for c in pcols] for r in bio])
cf_gwp = np.array([cfs.get(r["Flow_ID"], 0.0) for r in bio])

# Run 2,000 lognormal Monte Carlo draws (+/- 12% CV uncertainty on biosphere fuel/process emissions & paper demand losses)
rng = np.random.default_rng(42)
N_mc = 2000
mc_gwp = np.empty(N_mc)
for k in range(N_mc):
    A_k = A0.copy()
    # Add uncertainty on off-diagonal paper/pulp input losses (negative coeffs in upper triangle)
    for (r_i, c_i) in [(0, 1), (1, 2), (2, 3)]:
        A_k[r_i, c_i] = A0[r_i, c_i] * rng.lognormal(0.0, 0.08)
    B_k = B0 * rng.lognormal(0.0, 0.14, size=B0.shape)
    s_k = np.linalg.solve(A_k, f0)
    mc_gwp[k] = float(cf_gwp @ (B_k @ s_k))

# Also compare Solar Collector Industrial Decarbonization across UCI Concrete Mix Scenarios
conc = pd.read_csv(data_file("UCI_Concrete_LowCarbon_SCMs.csv"))
conc["CO2_kg_m3"] = 0.85 * conc["Cement_kg_m3"] + 0.07 * conc["BlastFurnaceSlag_kg_m3"] + 0.02 * conc["FlyAsh_kg_m3"]
opc_mean = conc[(conc["BlastFurnaceSlag_kg_m3"]==0) & (conc["FlyAsh_kg_m3"]==0) & (conc["CompressiveStrength_MPa"]>=35)]["CO2_kg_m3"].mean()
scm_mean = conc[(conc["BlastFurnaceSlag_kg_m3"]+conc["FlyAsh_kg_m3"]>=150) & (conc["CompressiveStrength_MPa"]>=35)]["CO2_kg_m3"].mean()

print("=== Stochastic Monte Carlo LCA (LCA Track 2 Module 5, N = 2,000) ===")
print(f"1,000-Book Net GWP100 : Mean = {mc_gwp.mean():,.0f} kg CO2-eq | 95% CI = [{np.percentile(mc_gwp,2.5):,.0f}, {np.percentile(mc_gwp,97.5):,.0f}]")
print(f"Structural >=35 MPa Concrete Decarbonization (UCI): Pure OPC={opc_mean:.1f} vs High-SCM={scm_mean:.1f} kg CO2/m^3 ({(1-scm_mean/opc_mean):.1%} cut!)")

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10.2, 3.8))
ax1.hist(mc_gwp, bins=38, color="#059669", alpha=0.85, edgecolor="white")
ax1.axvline(np.percentile(mc_gwp, 2.5), color="#0f172a", ls="--"); ax1.axvline(np.percentile(mc_gwp, 97.5), color="#0f172a", ls="--")
ax1.set_title("Monte Carlo LCI Uncertainty Distribution (2,000 Runs)"); ax1.set_xlabel("GWP100 [kg CO2-eq / 1,000 books]"); ax1.set_ylabel("Runs"); ax1.grid(True, alpha=0.3)

ax2.boxplot([
    conc[(conc["BlastFurnaceSlag_kg_m3"]==0) & (conc["FlyAsh_kg_m3"]==0) & (conc["CompressiveStrength_MPa"]>=35)]["CO2_kg_m3"].values,
    conc[(conc["BlastFurnaceSlag_kg_m3"]+conc["FlyAsh_kg_m3"]>=150) & (conc["CompressiveStrength_MPa"]>=35)]["CO2_kg_m3"].values,
], labels=["Pure OPC (>=35 MPa)", "High Slag+FlyAsh (>=35 MPa)"])
ax2.set_title("Real UCI Concrete Decarbonization (>=35 MPa Mixes)"); ax2.set_ylabel("Embodied CO2 [kg/m^3]"); ax2.grid(True, axis="y", alpha=0.3)
fig.tight_layout()
Decarbonization, Monte Carlo LCA & Low-Carbon Energy Integration Output Plot 1
=== Stochastic Monte Carlo LCA (LCA Track 2 Module 5, N = 2,000) ===
1,000-Book Net GWP100 : Mean = 10,835 kg CO2-eq | 95% CI = [8,525, 13,830]
Structural >=35 MPa Concrete Decarbonization (UCI): Pure OPC=374.1 vs High-SCM=240.3 kg CO2/m^3 (35.8% cut!)

Concept Check Questions

  1. Why is lognormal distribution standard in LCA Pedigree uncertainty (LCA Track 2 Module 5) rather than normal Gaussian noise (what happens to a negative mass/emission draw in a normal distribution)?
  2. Why did we solve np.linalg.solve(A_k, f0) inside the Monte Carlo loop whenever A_k varied?
  3. How can recycling agricultural/industrial wastes (Slag and Fly Ash) simultaneously solve solid-waste landfill disposal (MFA) and concrete climate emissions (LCA)?

Guided Practice Problem 1: One-at-a-Time Global Sensitivity Check (Pulping vs Papermaking Losses)

Test which technical efficiency improvement cuts the 1,000-book baseline GWP100 more: (a) cutting wood-pulp requirement in papermaking (A[1,2] = -1.1 -> -0.95), OR (b) cutting grid fossil electricity/coal in pulping (B[fossil_CO2, P2] = 2.0 -> 1.4). Compute exact kg CO2-eq savings for both!

# Guided Practice 1 Starter
base_gwp = float(cf_gwp @ (B0 @ np.linalg.solve(A0, f0)))
A_a = A0.copy(); A_a[1, 2] = -0.95
gwp_a = float(cf_gwp @ (B0 @ np.linalg.solve(A_a, f0)))
B_b = B0.copy(); B_b[1, 1] = 1.4
gwp_b = float(cf_gwp @ (B_b @ np.linalg.solve(A0, f0)))
print(f"Baseline={base_gwp:,.0f} | Option A (Paper Yield) saves {base_gwp-gwp_a:,.0f} kg | Option B (Clean Pulping Energy) saves {base_gwp-gwp_b:,.0f} kg")
Baseline=10,649 | Option A (Paper Yield) saves 1,068 kg | Option B (Clean Pulping Energy) saves 792 kg