It’s something we’re all familiar with – the frustration of a bad night’s sleep. But what is a bad night’s sleep, exactly? For some, it might look like lying awake, being unable to fall asleep. For others, sleep may come quickly, only to be interrupted by unwanted early morning wake ups.
Others may find that even with a solid eight hours a night, the struggle to get out of bed in the morning makes the thought of “five more minutes” an irresistible prospect. If only we could start our days with the same vigour we use when hitting the snooze button.
Bad nights are more than just inconvenient. Poor sleep is associated with a suite of negative health outcomes, ranging from cardiovascular disease and diabetes to poor mental health and dementia. And with clinically significant insomnia affecting over 15% of the general adult population, it is unsurprising that insufficient sleep has been branded a public health epidemic.
There is no shortage of opinions on how to get a better night’s sleep. We are also spoilt for choice by the healthtech industry, where a booming gadget market vies for our attention with promises of making sleepless nights a thing of the past. Yet the guidance we receive from these sources tends to be quite generic. And because we each sleep a bit differently, one-size-fits-all advice just doesn’t cut it.
We need advice that is tailored to our specific sleep needs and problems. Personalised tools that give personalised predictions are essential.
Mathematical modelling
Sleep researchers have long used mathematical tools, or mathematical models, to understand sleep. For instance, the seminal two-process model of sleep regulation, developed in the early 1980s, shaped our understanding of sleep timing; our bed and rise times are regulated by the interaction of our body’s circadian “clock” and a homeostatic variable that accumulates sleep “pressure” as we continue to stay awake. Similarly, pioneering work by McCarley-Hobson in the 1970s used mathematical models to rationalise how distinct groups of neurons coordinate the transitions between the two main sleep stages: rapid eye movement (REM) and non-rapid eye movement (NREM) sleep.
The two-process and McCarley-Hobson models have both spawned numerous adaptations that have themselves been applied broadly, from predicting alertness in resident physicians to debating whether moving school start times will combat adolescent fatigue. The usefulness of these models comes from the fact that their variables can be related to measurable features of sleep. For example, the variables of the two-process model tell us about the onset and duration of sleep. In this way, models act as a mathematical playground in which we can simulate different sleep patterns and predict what sort of things might make sleep better or worse.
Of course, predictions are only helpful if they are tailored to that individual. And while available models are good at simulating the “average” person’s sleep, there are clinically important features of sleep that models haven’t yet fully considered. For example, preferred sleep timing varies a lot from person to person, with some people preferring to stay up late and others preferring to go to bed and wake up early.
Another feature of sleep is the cycling that occurs between NREM and REM sleep states across the night. In healthy young adults, NREM sleep predominates at the start of the night, and REM sleep predominates at the end of the night. This pattern is disrupted in sleep disorders and changes as we age.
In my PhD, I was curious as to whether existing models were able to simulate these two features of sleep. So I selected two models: one model – grounded in the two-process model – described sleep timing; the other model – built on the McCarley-Hobson model – described the cycling pattern between NREM and REM sleep. Next, I used theories from applied maths – coupled oscillator and geometric singular perturbation theories, to be precise – to uncover the geometric building blocks of each of the models. In doing so, I was able to discern what sort of sleep patterns could be constructed in model simulations.
When I looked at the first model, I saw that it had all the necessary mathematical building blocks to predict sleep timing in lots of different people. I could simulate sleep timing not just in the “average” person, but also in people with extreme “night owl” or “early bird” tendencies.
When it came to the second model, things were a bit more complicated. Its building blocks were put together in a way that meant that the model couldn’t simulate the predominance of NREM at the start of the night, and REM at the end of the night. However, I figured out a way to rearrange the model’s building blocks. The result? The model became more flexible, allowing me to simulate a progressive increase in REM duration across the night. All in all, my research showed that it is possible to make models that predict some of the key, finer details of sleep – the kind of details that vary from person to person.
Simulate your sleep
At the University of Surrey, we are developing digital tools, for both clinical and personal use, to help people calibrate models of their own sleep patterns. With a personalised model, it’s possible to simulate different lifestyle changes and predict which ones will be most effective at helping you get better sleep.
And the results might be surprisingly achievable – getting a good night’s sleep might be a matter of spending a short period out in the Sun each morning. You can see the impact light has on sleep with our online Visualisation Tools, available here.

Disturbed sleep will still trouble many of us, but now with the help of mathematical models we can take a glimpse into a future where each one of us can say goodnight to those bad nights – and hello to better sleep in nights to come.