A two-store model in the spirit of complementary learning systems. A fast hippocampal trace h decays quickly, dh/dt = −h/τh. During sleep it is replayed into a slow neocortical trace c, dc/dt = k·S(t)·h − c/τc with S = 1 only while asleep. Recall probability is R = 1 − exp(−(h + c)).
Each study session adds strength 2·(1 − R) and lengthens τh by the factor 1 + (1 − R): reviewing when you have partly forgotten helps most (the spacing effect), while cramming sessions 15 minutes apart find R already near 1 and gain almost nothing. Between events the equations are linear, so the page checks the RK4 result against the exact piecewise-exponential solution c(t) = c0 e−t/τc + k h0 (e−t/τh − e−t/τc)/(1/τc − 1/τh).
Simplifications: τh = 2 d, τc = 40 d, k = 0.8 per day of sleep are illustrative, not fitted to data; no interference, emotion, or sleep stages. Educational model, not a study plan.