Modeling Caffeine Metabolism - time offset

What’s the next level of complexity to add to our model? As noted previously, our model is not able to generate an arbitrary caffeine schedule. Let’s add functionality to enable it to do so!

What do we need in order to do this? What we would like to do is to be able to simulate a single day as a combination of caffeine inputs at arbitrary times during the day. We would then like to repeat the day periodically. To accomplish this, we need the ability to add a time offset to a dose delivered every 24 hours. This enables...

Read More

Modeling Caffeine Metabolism - mathematical note

I wanted to make a quick mathematical note on the long term behavior of our caffeine metabolism function. In the previous post, we came up with the expressions

as the exponential decay for a single dose of milligrams at time .

for the behavior at time for a dose of mg delivered every hours, where .

In this post, we’ll look at the long term behavior using two similar approaches. The quantity we are most interested in...

Read More

Modeling Caffeine Metabolism

Caffeine is a stimulant drug that is widely consumed in tea, coffee, soda, and chocolate, among other beverages and foods. In this post, we construct a toy model for caffeine metabolism.

The mechanism of action of caffeine is complex, as is the process of developing tolerance. These are important factors to consider when thinking about the ultimate effect of the drug on alertness and we will discuss them briefly at the end.

So–let’s build our model. We need to consider caffeine input (consumption) and caffeine output (metabolism).

For our caffeine input, let’s consider a semi-realistic model of consuming Read More