This simulation reproduces Borbély's Two-Process model of sleep regulation. Process S, the homeostatic sleep pressure linked to adenosine accumulation, rises exponentially toward 1 while awake and decays toward 0 while asleep, following first-order kinetics dS/dt = (target−S)/τ. Process C is a 24-hour sinusoid from the suprachiasmatic nucleus. Sleep onset is triggered when S meets the upper threshold H_up = C + 0.1, and waking occurs when S falls to H_lo = C − 0.1.
The sliders adjust circadian amplitude, the wake buildup constant τ_wake (default 18 h), the sleep decay constant τ_sleep (default 4.5 h), an enforced sleep-deprivation window in hours, and a circadian phase offset. Three views render the S and C curves with shaded sleep episodes, a hypnogram, or a phase plane of S against C. The model underpins how chronobiologists explain jet lag, shift work, and recovery sleep after deprivation.
What is the Two-Process model of sleep?
It is a framework proposed by Alexander Borbély in 1982 that explains sleep timing as the interaction of two systems. Process S is a homeostatic sleep pressure that builds with time awake, and Process C is a circadian rhythm set by the body clock. Sleep happens when their combined effect crosses a threshold.
What is Process S in this simulation?
Process S represents homeostatic sleep pressure, tied to the accumulation of adenosine in the brain during wakefulness. In the simulation it rises exponentially toward a value of 1 while awake and decays toward 0 while asleep, plotted on a normalised 0 to 1 scale.
What is Process C and where does it come from?
Process C is the circadian component, modelled here as a 24-hour cosine wave. In the body it is generated by the suprachiasmatic nucleus (SCN) of the hypothalamus and entrained by the light-dark cycle. It sets the moving sleep and wake thresholds that Process S must reach.
Process S follows first-order exponential kinetics. While awake it obeys dS/dt = (1 − S)/τ_wake, climbing toward 1; while asleep it obeys dS/dt = (0 − S)/τ_sleep, falling toward 0. The simulation integrates this with one-minute time steps and the time constants you set with the sliders.
τ_wake (default 18 h) controls how quickly sleep pressure builds during wakefulness, while τ_sleep (default 4.5 h) controls how quickly it dissipates during sleep. A shorter τ_sleep means faster recovery and lighter sleep need; a longer τ_wake means pressure accumulates more slowly across the day.
It forces wakefulness for a chosen number of extra hours during the simulation, preventing the normal sleep episode. With deprivation, Process S climbs higher than usual and the following sleep is longer and deeper, illustrating the rebound recovery sleep observed after a missed night.
The thresholds track the circadian wave. The upper threshold is H_up = C + 0.1 and the lower threshold is H_lo = C − 0.1, giving a band of half-width 0.1 around Process C. Sleep starts when S rises to H_up and ends when S drops to H_lo, so the body clock effectively gates when sleep can occur.
The phase offset slider shifts Process C earlier or later by up to six hours. This mimics situations such as jet lag, delayed sleep phase, or shift work, where the internal clock is misaligned with the desired sleep schedule, and you can watch how onset times and sleep duration change.
The phase plane plots Process S against Process C rather than against time. The resulting looping trajectory shows the cyclic relationship between sleep pressure and the circadian clock, with the dashed threshold lines marking where sleep starts and ends. It is a compact way to see the limit-cycle behaviour of the system.
It captures the qualitative dynamics that real chronobiology research supports, and the default constants are close to published estimates. However, it is a simplified deterministic model: it ignores sleep stages, naps, light exposure feedback, individual variation, and noise, so it is a teaching tool rather than a clinical predictor.
The Two-Process model is the standard basis for predicting alertness and fatigue. It informs shift-scheduling software, jet-lag and light-therapy planning, and biomathematical fatigue-risk models used in aviation and transport, all of which rely on tracking homeostatic pressure and circadian phase together.