MaxDex AI

Methodology

Process C and Process S: The Two Clocks Behind Your Day

Two independent processes decide how alert you are at any hour: pressure that builds the longer you are awake, and a rhythm that runs on its own 24-hour clock regardless. Here is how each is computed.

What is the two-process model of sleep regulation?

Proposed by Borbély in 1982, it explains alertness as the interaction of two independent systems: Process S, homeostatic sleep pressure that rises during wake and dissipates during sleep, and Process C, a circadian rhythm that oscillates on roughly 24 hours regardless of how long you have been awake.

It is the reason a second wind at 10pm is real rather than imagined. Sleep pressure has been climbing all day, but the circadian signal is also near its evening alerting peak, and the two partially cancel. It is equally the reason 3am feels catastrophic even after a nap: pressure may be lower, but the circadian trough is at its deepest.

The model has been repeatedly refined rather than replaced — Borbély and colleagues published a full reappraisal in 2016 that still holds the two-process structure at its core.

How is sleep pressure (Process S) calculated?

Pressure rises toward an asymptote on a 15-hour time constant while you are awake and dissipates on a 4.2-hour constant while you sleep, with a floor of 0.05. The formula is pressure = residual + (asymptote − residual) × (1 − exp(−hours awake ÷ 15)).

The asymptote is not fixed. It is raised by two things: a rolling seven-day sleep debt, which increases the residual pressure carried into each new day, and irregular bedtimes, which raise the ceiling the accumulation climbs toward.

Dissipation is much faster than accumulation — 4.2 hours against 15 — which is why a single good night recovers most of a deficit while a single short night does comparatively little damage. Chronic restriction is the pattern that does damage, because the residual never fully clears.

How does MaxDex measure bedtime consistency?

With a bedtime consistency index, BCI7 = exp(−σ), where σ is the circular standard deviation of your recent sleep-onset times. It returns 1.0 for perfectly regular bedtimes and falls toward 0 as they scatter.

Clock times need circular statistics, not ordinary ones. The naive average of 23:00 and 01:00 is noon, which is nonsense. The engine computes a mean resultant length across the times as angles and derives the spread from it, so midnight-crossing schedules behave correctly.

Consistency is not a cosmetic metric here — it feeds the score in two places. It raises the pressure asymptote when irregular, and it contributes a direct bonus or penalty to the sleep score. Phillips and colleagues found irregular sleep-wake patterns predicted worse academic performance and delayed circadian timing even when total sleep duration was held constant, which is the finding this weighting reflects.

Why does the circadian curve peak at 4pm?

The circadian driver is a 24-hour cosine with its alertness peak at 16:00 and its trough near 04:00, plus a Gaussian post-lunch dip centred at 14:30 with a width of 1.6 hours and a depth of 0.28. The whole curve then shifts by your chronotype phase.

The post-lunch dip is modelled separately from the main cosine because it is a genuinely separate phenomenon. It appears even without lunch, which is why it is drawn as a circadian feature rather than folded into the meal model — though eating does deepen it, and that interaction is handled in the metabolic driver.

The source describes this cosine as a deliberately cheap stand-in for a Van der Pol limit-cycle oscillator. A full oscillator model needs light-exposure history that a phone cannot reliably supply, so we use the tractable approximation and say so.

How does MaxDex work out my chronotype?

From the circular mean of your sleep midpoints over the past 14 to 21 days, referenced against a neutral midpoint of 03:30. The resulting phase shift is clamped to ±12 hours, so night-shift workers and day sleepers are handled rather than treated as errors.

Sleep midpoint is the standard behavioural marker of chronotype in the research literature — it is the basis of Roenneberg’s Munich ChronoType Questionnaire, which established mid-sleep on free days as a practical proxy for internal circadian phase across very large populations.

Using observed midpoints rather than a questionnaire means the estimate updates as your schedule genuinely changes, instead of freezing whatever you answered during onboarding.

How is sleep inertia handled?

As an exponential decay from the moment you wake: 1.2 × exp(−hours since wake ÷ 0.9). It is strongest immediately on waking and has largely dissipated within about two hours.

Sleep inertia is a distinct state from ordinary tiredness, with its own well-documented time course of impaired alertness and decision-making after waking. Modelling it separately is what stops the app scheduling your hardest cognitive work into the first thirty minutes of the day just because sleep pressure happens to be at its daily minimum then.

Sources

Frequently asked questions

Why do I crash at 2pm even when I sleep well?

Because the post-lunch dip is circadian, not nutritional. It appears in controlled studies even without a midday meal. MaxDex models it as a Gaussian centred at 14:30 with a depth of 0.28, separate from the meal-response model — though a fast-carbohydrate lunch does deepen it.

How many days of data before the chronotype estimate is useful?

The estimate draws on a 14-21 day window of sleep midpoints, and the calibration learning rate starts at its maximum of 0.34 and decays as samples accumulate. Early days move it quickly; expect it to stabilise across two to three weeks of logged sleep.

Does MaxDex handle night shift work?

Yes. The chronotype phase shift is clamped to ±12 hours specifically so a day sleeper resolves to a valid phase rather than an error, and the sleep detector does not use time of day as a gate on what counts as sleep.

What is sleep debt and how is it calculated here?

It is a rolling seven-day accumulation of the shortfall between your sleep and your personal sleep need. It raises the residual pressure carried into each new day and applies a direct penalty to the sleep score of up to 30 points.

Can I recover sleep debt by sleeping in at the weekend?

Partially. Pressure dissipates on a 4.2-hour constant, so a long night clears most of a recent deficit. But the model also penalises sleep more than about 1.5 hours beyond your need, and irregular timing lowers your consistency index — so a large weekend catch-up recovers less than it appears to.

Why does bedtime consistency matter if I get enough hours?

Irregular timing raises the asymptote that sleep pressure accumulates toward, so the same number of hours buys less recovery. Research has found irregular sleep-wake patterns associated with worse performance and delayed circadian timing independently of total sleep duration.

Last reviewed August 28, 2026 by the MaxDex Services team. How we research and review this.

Get started

Max calls you. The day actually runs.

Available on Android now. Join the waitlist for iOS.