The human brain relies on two types of motivation: Intrinsic (internal desire) and Extrinsic (external rewards/consequences). The ADHD brain is notoriously 'blind' to future extrinsic rewards (like getting a good grade at the end of the semester) and completely devoid of intrinsic motivation for low-novelty tasks (like algebra).
The only chemical that can bridge the gap and force the motor cortex to initiate the action is Dopamine. If there is no dopamine, the bridge is out. You literally cannot cross into the task.
At 11:30 PM, the biology changes. The perceived threat of failing the class tomorrow morning hits the amygdala. The adrenal glands dump massive amounts of adrenaline and cortisol into the bloodstream. This acute stress hormone acts as a crude, toxic substitute for dopamine, forcibly kickstarting the prefrontal cortex and allowing you to finally hyperfocus and finish the work.
