I've never been a great sleeper. I knew caffeine could be a factor and I understood, at least intellectually, that caffeine’s half-life clearance meant that some of it might still be floating around my brain later in the day. But I didn't fully grok the dynamics until seeing it play out visually.
So this is a (simple) simulator, built to visually explore 2 questions:
1. How long can caffeine stay in your system?
2. When will caffeine levels fall back below a threshold with minimal sleep disruption?
Take this with a big grain of salt. I'm not a pharmacist, physician, chemist, etc, and this hasn't been reviewed by one. But at least for me, being able to turn the dials on a simple half-life model and see the consequences has been eye-opening.