What does Indoor CO2 and the Cross Draught conclude, in numbers, about “Pulse Ventilation and Dynamic Programming: a Window Schedule inside a Sawtooth”?

Answer: Chapter 5 finds the lowest-cost window schedule by dynamic programming: a two-hour meeting held below 1000 ppm needs at least 35 open minutes and loses 2.34 kilowatt-hours of heat in winter, against 7.01 with the window always open.

Scope of the numbers: Marked boxes separate published evidence, runnable Python calculations (21 programs), classical sources and the author's hypotheses.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 1000, 2.34, 35, 7.01

ceilingDP open mingreedy open mingreedy meanheat kWh
80061617623.77
100035359252.34
1200232310721.68
1400151612141.30
fixed 5 of every 15 (40 open min): 2.62 kWh
window open all meeting: 7.01 kWh
Show the full program
# Chapter 5. p52: fewest open minutes that keep CO2 under a ceiling.
# Model: the minute-by-minute room of p51. Dynamic programming over the
# CO2 level (rounded to 1 ppm) finds the minimum number of open minutes
# in a 120 min meeting such that CO2 never exceeds the ceiling; a greedy
# rule (open only when one more shut minute would break the ceiling) is
# checked against it. Heat lost with the exchanged air in winter uses
# rho*cp = 1.206 kJ/(m^3 K) and dT = 15 K. All parameters illustrative.
# 动态规划求最少开窗分钟数,并与贪心规则对照;冬季热损为示意。
import math

V, C0, N, T = 84.0, 420.0, 8, 120
GEN = N * 0.0052e-3 * 3600
SHUT, OPEN = 0.5, 8.3


def step(c, ach):
    css = C0 + 1e6 * GEN / (ach * V)
    return css + (c - css) * math.exp(-ach / 60.0)


def dp(limit):
    best = {round(C0): 0}
    for _ in range(T):
        nxt = {}
        for c, cost in best.items():
            for ach, add in ((SHUT, 0), (OPEN, 1)):
                c2 = step(c, ach)
                if c2 > limit:
                    continue
                k = round(c2)
                if k not in nxt or cost + add < nxt[k]:
                    nxt[k] = cost + add
        best = nxt
    return min(best.values())


def greedy(limit):
    c, opened, cs = C0, 0, []
    for _ in range(T):
        if step(c, SHUT) > limit:
            c = step(c, OPEN)
            opened += 1
        else:
            c = step(c, SHUT)
        cs.append(c)
    return opened, cs


def heat_kwh(open_min, dt=15.0):
    m3 = (open_min * OPEN + (T - open_min) * SHUT) * V / 60.0
    return m3 * 1.206 * dt / 3600.0


if __name__ == "__main__":
    print("ceiling  DP open min  greedy open min  greedy mean  heat kWh")
    for lim in (800, 1000, 1200, 1400):
        g, cs = greedy(lim)
        print("{:7d} {:12d} {:16d} {:12.0f} {:9.2f}".format(
            lim, dp(lim), g, math.fsum(cs) / T, heat_kwh(g)))
    print("fixed 5 of every 15 (40 open min): {:.2f} kWh".format(
        heat_kwh(40)))
    print("window open all meeting: {:.2f} kWh".format(heat_kwh(T)))

Single source and citation

Fan, Y. (2026). Indoor CO2 and Cognitive Decline, Bernoulli Cross-Ventilation and an Engineering Re-reading of 'Storing Wind, Gathering Qi' (Version 1.0.0), Chapter 5: Pulse Ventilation and Dynamic Programming: a Window Schedule inside a Sawtooth. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-194 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026194,
  author    = {Fan, Yafu},
  title     = {Indoor CO2 and Cognitive Decline, Bernoulli Cross-Ventilation and an Engineering Re-reading of 'Storing Wind, Gathering Qi'},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book