Circadian rhythms are endogenous 24-hour biological oscillations that regulate many physiological processes. An unstable sleeping schedule disrupts can lead to circadian misalignment, resulting in impaired sleep, increased fatigue, and long-term health risks. This project employs the Forger–Jewett–Kronauer (FJK) model to simulate the human circadian pacemaker under a rotating work schedule. Circadian phase is modeled using the timing of the core body temperature minimum
(
CBT
min
), with further extensions to evaluate the effectiveness of timed bright-light therapy in accelerating circadian realignment. An interactive model in this project also allows users to visualize changes in circadian phase compare biological adaptation under different scenarios.

Introduction

Circadian rhythms are 24-hour biological oscillations that regulate physiological processes including the sleep-wake cycle, core body temperature (CBT), melatonin secretion, hormone release, and alertness. Under normal conditions, the circadian system remains synchronized with the day-night cycle. Scheduled exposure to light controls the biological clock, while other factors such as food intake, stress, physical activity, social environment and temperature contributions are less major. This circadian misalignment has been proven to be associated with impaired sleep quality, increases fatigue, reduced cognitive performance, metabolic dysfunction, and an elevated risks of chronic diseases (Baron & Reid, 2014).
​
Previous studies have analyzed circadian rhythms using statistical approaches such as the single cosinor model. Although these methods effectively characterize rhythmic data by estimating parameters such as phase and amplitude, they do not represent the physiological mechanisms governing circadian regulation. Consequently, this investigation employs the Forger–Jewett–Kronauer model, a system of ordinary differential equations, to simulate circadian adaptation under rotating shift schedules and evaluate the potential effectiveness of timed bright-light therapy (Asgari-Targhi & Klerman, 2018).

Background Information

Biological Clock and Circadian Rhythm

The human circadian rhythm consists of endogenous 24-hour biological oscillations that regulate physiological processes including the sleep-wake cycle, core body temperature (CBT), melatonin secretion, hormone release, and alertness. Under normal conditions, the circadian system remains synchronized with the light-dark cycle through exposure to environmental light. Thus, environmental light acts as the primary regulator of the biological clock, while other factors such as food intake, stress, physical activity, social interactions and temperature have comparatively smaller effects. Unusual work schedules disrupt this synchronization since humans are exposed to light at biologically inappropriate times, resulting in sleeping during daytime. This circadian misalignment is associated with impaired sleep quality, increased fatigue,reduced cognitive performance,metabolic dysfunction,and elevated risks of chronic diseases (Baron & Reid, 2014).

Shift Work and Circadian Misalignment

Many industries operate continuously to optimize productivity, therefore shift work outside working hours has become common. Consequently, millions of people worldwide are employed on evening, night, or rotating shift schedules. Although these schedules are economically beneficial, they pose significant risk to the body’s natural circadian rhythm. Night and rotating shift workers remain awake when their biological clock promotes sleep. Furthermore, they are also exposed to artificial light during the biological night while still receiving natural daylight during normal waking hours. This disturbs the natural synchronization between the internal biological clock and external light-dark cycle. These schedules increase the risk of experiencing circadian misalignment.
​
Circadian misalignment associated with shortened sleep duration, poor sleep quality, metabolic disorders, reduced cognitive performance (Baron & Reid, 2014). The study found that nurses whose CBT rhythms are misaligned demonstrated poorer cognitive performance . Rotating shift schedules present greater challenge since the worker changes schedules frequently before their biological clock has fully adapted to the previous shift. (Molzof et al., 2019).

Core Body Temperature

Core body temperature follows the circadian rhythm. It is highest during late afternoon or early evening and gradually decreases during the night as sleep approaches. It has been shown that the minimum point of the core body temperature marks the end of biological night as body temperature reaches its lowest value and increases prior to awakening (Sun & Chen, 2021). Core body temperature reflects internal physiological regulation and thus is used as a reliable indicator of circadian phase. Molzof et al. (2019) found that hospital shift workers with greater misalignment of their CBT rhythms demonstrated lower poorer cognitive performance, suggesting that this is also a strong indicator of functional outcomes caused by circadian disruption.

Light as the Main Manipulated Variable

In this study, environmental light mainly regulates the circadian system. Exposure to bright light at different times affects on circadian phase differently. Exposure to morning light generally generates advances circadian rhythm, moving the core body temperature minimum point to occur earlier. In contrast, evening or nighttime light delays circadian phase, shifting physiological rhythms to happen at later times. The Forger-Jewett-Kronauer model presents the effect of light schedule on circadian rhythm by allowing light intensity, time, and duration to show their effects on the circadian oscillator continuously. Thus, changes in work schedules can be represented mathematically by changing the timing and intensity of light exposure. This is the main mechanism used to stimulating this project.

Methodology

A dynamic mathematical modelling approach was employed using Forger–Jewett–Kronauer (FJK) model, which describes the circadian pacemaker as a system of ordinary differential equations (ODEs). The model incorporates environmental light exposure as the primary external input, allowing the circadian system to respond to changes in work and sleep schedules. This project also allows the investigation on different sleep schedules including the user’s input.
​
Rotating work schedules were simulated by defining piecewise light exposure patterns corresponding to the schedules. Numerical solutions of the ODE system were obtained to plot the core body clock and observe changes in circadian phase over time. The timing of the core body temperature minimum for each day (CBT min) was extracted as a pace marker of circadian phase.
CBT
min
trajectories were analyzed to determine the stability of the circadian system.
​
Timed-light therapy has been investigated widely by previous papers. This project also used this treatment as an intervention by modifying the light exposure input including time and level of light. Simulations with and without light therapy were compared to evaluate its effectiveness in accelerating circadian adaptation.

Mathematical Model

Overview of the Forger-Jewett-Kronauer (FJK) Model

The Forger–Jewett–Kronauer (FJK) model from paper: A Simpler Model of the Human Circadian Pacemaker 1999 is used in this project as the main mathematical model, by plotting this equation the result is the biological clock based on the sleeping schedule (Forger et al., 1999). The FJK model is a dynamic mathematical model consisting of system of ordinary different equations and allow to present how biological clock responds to different environmental light exposures.
​
Previous papers in this topic also used statistical approaches such as single cosinor model. Although these methods effectively characterize rhythmic data by estimating parameters such as phase and amplitude, they do not represent the physiological mechanisms governing circadian regulation. Consequently, this investigation employs the Forger–Jewett–Kronauer model, a system of ordinary differential equations, to simulate circadian adaptation under rotating shift schedules and evaluate the potential effectiveness of timed bright-light therapy (Asgari-Targhi & Klerman, 2018).
​
In this project, light (lux) is used as the main manipulated variable; by giving different light exposure data such as time of exposure and the light intensity, the biological clock shifts according to the changes. The resulting simulations are quantified by the timing of the core body temperature minimum Core body temperature
(
CBT
min
) has been proven that light is the primary environmental factor (zeitgeber) regulating the circadian clock. Thus, changing the timing and intensity of light causes the oscillator to shift its phase either being delayed or advanced in comparison with the normal biological clock. The Core Body Clock State ,as the result of the stimulation, shows the timing of the core body temperature minimum. This is a widely accepted marker of circadian phase. By comparing
CBT
min
under different work schedules allow us the determine whether the biological clock is having circadian misalignment.

Model Parameters

The FJK model contains physiological constants describe the intrinsic properties of the circadian pacemaker. These parameters are taken directly from the original model and remain constant.
Out[]=
Parameters
Description
Value
τ
x
Instrinsic circadian period
24.2h
μ
Oscillator nonlinerity constant
0.23
k
Strenth of light coupling
0.55
Out[]=
Parameters
Description
Value
alpha0
Baseline photosensitivity
0.16
β
Photoreceptor recovery rate
0.013
G
Maximum phoctic drive
19.875
p
Light sensitivity exponent
0.6
I0
Reference Light Intensity
9500
The Chrono-biological Constants are set up following the table above by these lines of codes:
Circadian Pacemaker core constants:
In[]:=
τ
x
= 24.2; ​​μ = 0.23; ​​k = 0.55;
Process L & Sensitivity Constants:
In[]:=
alpha0 = 0.16;​​β = 0.013;​​G = 19.875;​​p = 0.6;​​I0 = 9500;

Process L and Drive Equations

Photo-activation rate alpha:
In[]:=
alphaI[t_]:=alpha0*
p
lightSchedule[t]
I0
;
Raw light drive engine:
In[]:=
Bhat[t_,n_]:=G*(1-n)*alphaI[t];
Modulated drive acting on the oscillator:
In[]:=
B[t_,x_,xc_,n_]:=Bhat[t,n]*(1-0.04*x)*(1-0.04*xc);
Equation (1): Primary Circadian Oscillator
x'[t]==
π
12
*μ*xc[t]-
4
3
xc[t]
3
-x[t]*
2
24
0.99669
τ
x
+k*B[t,x[t],xc[t],n[t]]
The variable x[t] is the primary circadian oscillator, representing one component of the biological clock out of two. This derived equation x’[t] shows how the main oscillator evolves over time. It gives the rate of change of circadian oscillator over time. This non linear cubic term - 4 xc[t]^3 maintains a stable oscillation close to a 24-hour period. B(t) represents the effect of light, showing how light shifts phase of circadian rhythm.
Equation (2): Complementary Oscillator
xc'[t]=
π
12
*(xc[t]+B[t,x[t],n[t]])
xc[t] gives the complementary oscillator, which together with x(t) generates the approximately 24-hour circadian rhythm. The derived equation also gives how does this complementary oscillator changes throughout time.
Equation (3): Photoreceptor Dynamics
n'[t]==60*(alphaI[t]*(1-n[t])-βn[t])
where n(t) represents the proportion of activated activated photoreceptors in the retina. α(I) depends on light intensity. β is the recovery rate of the photoreceptors.This equation models how the eye responds to changing light levels before transmitting the signal to the circadian oscillator.
Initial Conditions
The initial conditions are taken from the original FJK model and define the initial state of the circadian system presenting normal condition before the stimulation begins.
Initial Conditions specified at t=0
x[0]==-0.3,​​xc[0]==-1.13​​n[0]==0.1
Construct the final equation
The equation was constructed from parts to complete the final mathematical model that will be used for the whole project
System of ordinary differential equations describing the circadian pacemaker and its response to light:
In[]:=
equations=​​ x'[t]==
π
12
*(xc[t]+B[t,x[t],xc[t],n[t]]),xc'[t]==
π
12
*μ*xc[t]-
4
3
xc[t]
3
-x[t]*
2
24
0.99669
τ
x
+k*B[t,x[t],xc[t],n[t]],​​ n'[t]==60*(alphaI[t]*(1-n[t])-βn[t]),​​x[0]==-0.3,​​ xc[0]==-1.13,​​ n[0]==0.1​​;

Light schedule set up

Since light exposure is the most important factor in determining the biological clock, the project manipulates this variable by inputting different light intensity according to time schedule. This schedule will be used as “light Schedule” variable in the equation (1) above. The light intensities are made constant to show how they diverges from the normal base line: During sleeping time, the light intensity is 0 lux. For work/school time, it is 1000 lux and other time of the day is 200 lux. The project includes 3 cases study in total, showing how sleeping schedule changes the biological clock:

Case 1: Normal sleeping schedule

Out[]=
Sleep Time
Wake up
School starts
School ends
23 PM
7 AM
8 AM
16 PM
Morning shift light schedule:
In[]:=
morningShift[t_]:=Piecewise[{​​{0,23<=Mod[t,24]||Mod[t,24]<=7},​​{500,8<Mod[t,24]<16},​​{200,True}​​}];
In[]:=
DiscretePlot[morningShift[t],{t,0,24},ImageSize->Large]
Out[]=
5
10
15
20
100
200
300
400
500
The first base line simulation is normal sleeping schedule. The light schedule was input into the piecewise function following the table above. This base line simulation is important during comparison between shifting schedule and stable schedule.

Case 2: Night shift work time, sleep day time

Night shift light schedule:
The second base line simulation is night shift workers. The light schedule was input into the piecewise function following the table above . This base line simulation is important during comparison between shifting schedule and stable schedule.

Case 3: Rotating shift schedule

For the rotating shift schedule, the schedule differs for each day in the week. Instead of only either the normal or night schedule, the rotating includes both the normal and night. Therefore another function Which is used to set up the schedule according to the shift allocation.
Rotating Shift Light Schedule

Case 4: Rotating shift schedule

Equates and graph the model using the schedule

Case 1: Normal sleeping schedule

Run the equation for case 1 with morning light schedule

Case 2: Night shift work time, sleep day time

Run the equation for case 2 with night light schedule

Graph of normal and night light schedules

This graph compares the simulated circadian rhythms of a normal day worker and night shift worker. The night-shift rhythm is noticeably phase delayed relative to the normal day-light schedule. This observation indicates that the biological clock has shifted to a later circadian phase due to night time light exposure. This behavior is consistent with previous findings regarding the effects of shift work on circadian phase. This agreement between the simulated and predictions provides evidences that the mathematical model realistically showcases the effect of alerted light exposure on human circadian pacemaker.

Case 3: Rotating shift schedule 1

Run the equation for the case with rotating light schedule defined above:
Plot the graph between normal night schedule and rotating light schedule:
Plot the graph between normal day-light schedule and rotating light schedule:
From the resulted graph above, a conclusion is made regarding the phase shifts between the graphs: For the first graph between rotating shift and normal night shift, the rotating one represented by the blue line is advanced in comparison with the baseline night shift in purple dashed line. This suggests that the circadian rhythm is experiencing phase adapting delaying further apart from the normal base line; however when compare it with the night shift, it shows that the rotating shift has not reach the optimal status. The same conclusion is made for the graph between normal morning shift and rotating shift of the second period when the worker is adapting back to their normal day light shift from night shift.

Case 4: Rotating shift schedule 2

Run the equation for the case with rotating light schedule defined above:
Plot the graph between normal night schedule and rotating light schedule:
Plot the graph between normal morning schedule and rotating light schedule

Core Body Temperature

Morning shift

AFter solving the equation, the circadian oscillator is extracted. The solution for the primary oscillator is extracted using the following functions:
The values of the circadian oscillator are sampled once every hour throughout the simulation by the following steps:
The initial date is used as Monday, July 6 2026 as the bench mark for the start of the week. The dates are generated into hourly data for 4 weeks:
The hourly data is then grouped into individual days, allowing the function to find the minimum point of each day in the next step. Each data point therefore consists of a date–time and its associated oscillator value, enabling the data to be grouped by day in the following steps.
This Thread function combines the sequence of hourly timestamps with the corresponding simulated values recorded from the circadian oscillator:
For each day, the minimum value of the circadian oscillator is determined using the function MinimalBy:
The minimal data is then merge with the corresponding hour that it occurs to get the final data set:

Night Shift

The process was repeated for calculating the minimum points of Core Body Temperature night shift. The InterpolationFunction was changed to “nightschedule” to calculate for the night shift (The code is located below)
◼
  • Code for night shift
  • The process was repeated for night shift
    After solving the equations, the circadian oscillator is extracted. The solution for the primary oscillator is extracted using the following functions:
    The initial date is used as Monday, July 6 2026 as the bench mark for the start of the week . The dates are generated into hourly data for 4 weeks:
    This Thread function combines the sequence of hourly timestamps with the corresponding simulated values recorded from the circadian oscillator:
    For each day, the minimum value of the circadian oscillator is determined using the function MinimalBy:
    The minimal data is then merge with the corresponding hour that it occurs to get the final data set:

    Comparison between Night and Morning Shifts

    Overall, the results demonstrate that a normal daytime schedule maintains an early circadian phase, whereas a permanent night-shift schedule produces a noticeably phase delay. These findings agree with established chronobiological principles and published experimental studies, providing confidence that the model realistically captures circadian adaptation under different patterns of light exposure.

    Rotating shift schedule

    Overall result of 2 cases

    Timed Light Therapy

    Case 1:

    New Light Schedule

    Therapy to adapt from day shift to night shift
    The light schedule for therapy is then equated by inputting the new schedule into the ODE system:
    Therapy to adapt from night shift to day shift
    The light schedule for therapy is then equated by inputting the new schedule into the ODE system:
    As mentioned before, the therapy only happens for the first 4 day of changing the schedule, and normal/night light schedule for the remaining days. Therefore, a new overall schedule consists of the therapy and base light schedules was created to simulate:
    New Light schedule including treatment for the first 4 days of changing shift between night and day schedule:
    The light schedule for therapy is then equated by inputting the new schedule into the ODE system:
    The graph of core biological clock is plotted including the rotating schedule and it’s result after therapy.
    Overall, when comparing the biological clocks under both schedules, the schedule with light therapy shows little difference from the original schedule. This suggests that the light therapy protocol, as implemented in this simulation, had only a limited effect on circadian adaptation.
    To further evaluate the effectiveness of the light therapy intervention, core body temperature (CBT) was quantified as a marker of circadian phase. The same process with previous section was used:
    The graphs above were created without the inclusion of the rotating with therapy result to confirms the effectiveness of the treatment on its own . Observation of the graphs confirms that the treatment has made effect on improving the overall situation . By comparing the components of both graphs, it is obvious that both of the graphs mostly in the same phase with the normal base line . Although they do not completely show the same lines with the baseline, they still confirms the effectiveness . Additionally, since both of the graphs show there are still delays between the baseline and the therapy; this explain why the effect on the rotating shift schedule is not noticeably different .

    Plotting graph code:

    Case 2:

    The same methodology has been used to implement the treatment on the second case study. The treatment is implemented with the goals of support the adaptation according to the altered light schedule.

    User-Defined Schedule Simulation

    To extend the model beyond fixed work schedules, an interactive simulation interface was developed using Wolfram Mathematica’s DynamicModule. This interface allows the user to define their own day schedule by specifying periods of work, and sleep. The user-defined schedule is then converted into external input for the Forger-Jewett-Kronaurer (FJK) model.

    Conclusion

    Limitations

    Despite its success, the model has several limitations. Only light exposure was considered as the external synchronizing factor, while other influences such as meal timing, physical activity, stress, and individual physiological differences were not included. In addition, the model assumes identical circadian parameters for all individuals, whereas real populations exhibit considerable variability in circadian period and sensitivity to light. Additionally, the timed light therapy did not include delay in the schedules to further accelerate the phase adjustment following the altered light conditions. Previous studies include the delay/advance of treatment time throughout the week to maximize the effect of the treatment(Bjorvatn et al., 1999).

    Future Directions

    In future work, the model could be extended by implementing a dynamic timed light therapy protocol according to previous studies. This dynamic approach may further accelerate adaptation to changing work schedules and improve the effectiveness of the intervention. Additionally, although this project developed an interactive simulation that allows users to investigate customized work schedules, the current implementation evaluates only a single schedule at a time. Future development could extend the interface to simulate user-defined rotating schedules, allowing users to specify multiple work rotations over longer periods. Incorporating additional physiological factors, such as meal timing, physical activity, and individual differences in light sensitivity, would also improve the biological realism of the model and enhance its potential application for personalized circadian health management.

    Acknowledgement

    I would like to express my sincere gratitude to my mentor, Dr . Daniel Sanchez, for his guidance, expertise, and unconditional support throughout this project . His insight was invaluable in the development of the simulation framework and the successful completion of this research . I am especially grateful for his patience and willingness to help me navigate the many challenges encountered along the way .
    I would also like to thank the Wolfram Research Summer Program directors -- Megan, Rory, and Eryn-- for their support, organization, and encouragement throughout the program . Their dedication helped create an excitement, safe, and inspiring learning environment.
    I am so grateful to have my TA, Amrita, for always be supportive and caring.
    Finally, I would like to thank Stephen Wolfram for making this incredible opportunity possible . I am deeply grateful for the chance to learn from and work alongside such an exceptional community, and for an experience that has greatly enriched both my academic and personal growth.
    Additional thanks to Stephen Wolfram for suggesting this project.

    References

    ◼
  • Asgari-Targhi, A., & Klerman, E. B. (2018). Mathematical modeling of circadian rhythms. WIREs Systems Biology and Medicine, 11(2). https://doi.org/10.1002/wsbm.1439
  • ◼
  • Baron, K. G., & Reid, K. J. (2014). Circadian misalignment and health. International Review of Psychiatry, 26(2), 139–154. https://doi.org/10.3109/09540261.2014.911149
  • ◼
  • Bjorvatn, B., Kecklund, Gör., & Åkerstedt, T. (1999). Bright light treatment used for adaptation to night work and re-adaptation back to day life. A field study at an oil platform in the North Sea. Journal of Sleep Research, 8(2), 105–112. https://doi.org/10.1046/j.1365-2869.1999.00146.x
  • ◼
  • Boivin, D. B., & Boudreau, P. (2014). Impacts of Shift Work on Sleep and Circadian Rhythms. Pathologie Biologie, 62(5), 292–301. https://doi.org/10.1016/j.patbio.2014.08.001
  • ◼
  • Doljansky, J. T., Kannety, H., & Dagan, Y. (2005). Working under daylight intensity lamp: an occupational risk for developing circadian rhythm sleep disorder? Chronobiology International, 22(3), 597–605. https://doi.org/10.1081/CBI-200062422
  • ◼
  • Forger, D. B., Jewett, M. E., Kronauer, R. E., & New Collective Author. (1999). A simpler model of the human circadian pacemaker. Journal of Biological Rhythms, 14(6), 532–537. https://doi.org/10.1177/074873099129000867
  • ◼
  • Molzof, H. E., Prapanjaroensin, A., Patel, V. H., Mokashi, M. V., Gamble, K. L., & Patrician, P. A. (2019). Misaligned core body temperature rhythms impact cognitive performance of hospital shift work nurses. Neurobiology of Learning and Memory, 160, 151–159. https://doi.org/10.1016/j.nlm.2019.01.002
  • ◼
  • Sun, S.-Y., & Chen, G.-H. (2021). Treatment of Circadian Rhythm Sleep–Wake Disorders. Current Neuropharmacology, 19(6). https://doi.org/10.2174/1570159x19666210907122933
  • CITE THIS NOTEBOOK

    Simulate circadian rhythm cycles for unusual sleep schedules​
    by Jolie Nguyen​
    Wolfram Community, STAFF PICKS, July 9, 2026
    https://community.wolfram.com/groups/-/m/t/3754811