What does The Arithmetic of Sleep conclude, in numbers, about “The Sleep Switch: Why Ageing Fragments the Night Before It Shortens It”?
Answer: Chapter 2 writes the mutual inhibition of the VLPO and the monoaminergic nuclei as a flip-flop: weakening it shrinks the bistable margin from 0.655 to nothing, and with noise time asleep falls only from 0.989 to 0.908 while awakenings per night rise from 0.12 to 35.40 — ageing fragments the night before it shortens it.
Scope of the numbers: It is not medical advice, gives no doses and recommends no product; for persistent insomnia the first-line treatment is cognitive behavioural therapy for insomnia. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses; apart from cited literature, all data in the book are synthetic.
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: 0.12, 0.908, 0.989, 35.40
| mean of 200 nights | |
| inhibition w orexin O time asleep awakenings per night | |
| 1.5 | 0.3 1.000 0.00 |
| 1.0 | 0.3 0.933 0.01 |
| 0.7 | 0.3 0.640 13.29 |
| 0.5 | 0.3 0.546 59.19 |
| 1.5 | 0.0 1.000 0.00 |
| 1.0 | 0.0 0.989 0.12 |
| 0.7 | 0.0 0.938 10.61 |
| 0.5 | 0.0 0.908 35.40 |
| Reading (orexin O | 0 rows): weakening the mutual inhibition from 1.0 to |
| 0.5 costs less than a tenth of the time asleep but multiplies the | |
| awakenings - the night fragments long before it shortens. With orexin left | |
| active at night (O | 0.3 rows) the wake side is held too firmly and sleep |
| is lost outright. |
Key formula
Show the full program
# Chapter 2. The same switch with noise, over one 8-hour night. Sleep drive is
# high at lights-out and falls through the night as Process S decays: D(t) =
# 0.45 x exp(-t/4.2)
# - 0.05 (t in hours). Each population receives independent noise
# (Ornstein-Uhlenbeck,
# sd 0.12, correlation time 30 s). "Asleep" means x > y. A wake bout of at
# least 15 s counts as an awakening. Weaker mutual inhibition w stands for
# loss of VLPO neurons. 200 simulated nights per row, fixed seed; dt = 1 s.
import math
import random
def f(u):
return 1.0 / (1.0 + math.exp(-u / 0.1))
def night(w, O, rng, sd=0.12, tau_n=30.0, tau=10.0):
x, y = 1.0, 0.0
nx = ny = 0.0
a = math.exp(-1.0 / tau_n)
b = sd * math.sqrt(1 - a * a)
asleep_s, awakenings, wake_run, state = 0, 0, 0, True
for s in range(8 * 3600):
t = s / 3600.0
D = 0.45 * math.exp(-t / 4.2) - 0.05
nx = a * nx + b * rng.gauss(0, 1)
ny = a * ny + b * rng.gauss(0, 1)
x += (-x + f(0.5 + D - w * y + nx)) / tau
y += (-y + f(0.5 - D - w * x + O * y + ny)) / tau
if x > y:
asleep_s += 1
if not state and wake_run >= 15:
awakenings += 1
state, wake_run = True, 0
else:
state = False
wake_run += 1
return asleep_s / (8 * 3600), awakenings
if __name__ == "__main__":
rng = random.Random(57004)
print(" mean of 200 nights")
print(" inhibition w orexin O time asleep awakenings per night")
for O in (0.3, 0.0):
for w in (1.5, 1.0, 0.7, 0.5):
res = [night(w, O, rng) for _ in range(200)]
fa = sum(r[0] for r in res) / len(res)
aw = sum(r[1] for r in res) / len(res)
print(
" {:8.1f} {:5.1f} {:7.3f} {:7.2f}"
.format(w, O, fa, aw)
)
print("\nReading (orexin O = 0 rows): weakening the"
" mutual inhibition from 1.0 to")
print("0.5 costs less than a tenth of the time asleep but multiplies the")
print("awakenings - the night fragments long before"
" it shortens. With orexin left")
print("active at night (O = 0.3 rows) the wake side"
" is held too firmly and sleep")
print("is lost outright.")Single source and citation
Fan, Y. (2026). Two-Process Sleep Architecture, Slow-Wave Glymphatic Clearance and Thermoregulatory Phase Control (Version 1.0.0), Chapter 2: The Sleep Switch: Why Ageing Fragments the Night Before It Shortens It. 5D Library. https://doi.org/10.5281/zenodo.24090162
DOI: 10.5281/zenodo.24090162 · Read the monograph · 5DL-B-057 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026057,
author = {Fan, Yafu},
title = {Two-Process Sleep Architecture, Slow-Wave Glymphatic Clearance and Thermoregulatory Phase Control},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090162},
url = {https://doi.org/10.5281/zenodo.24090162}
}Other chapter answers in this book
- Chapter 1 · Sleep Pressure, the Clock, and What Caffeine Actually Does
- Chapter 3 · Sleep Architecture as a Markov Chain, and What One Night Can Tell You
- Chapter 4 · Does Sleep Wash the Brain? Diffusion, Flow and an Open Dispute
- Chapter 5 · Warm Hands, Cool Core: the Thermal Gate of Sleep
- Chapter 6 · What a Sleep Tracker Can Know, and the Score That Keeps You Awake
- Chapter 7 · The Defensive Qi by Day and by Night: the *Lingshu* and the Sleeping Immortal
- Chapter 8 · A Four-Step Check and a Pre-Registered Trial