Fatigue Is a Brain-Derived Emotion that Regulates to Ensure Protection (2012)
'Protection' might be the goal of physical fatigue, but it doesn't work for intellectual effort - what are you being 'protected from breaking' by not being able to write another line of code? Carpal tunnel? In that case, it looks more like it's about conserving energy or rotating to another task after having spent so much time on one task: "A Meta-Analysis of Blood Glucose Effects on Human Decision Making" <a href="http://www.gwern.net/docs/2016-orquin.pdf" rel="nofollow">http://www.gwern.net/docs/2016-orquin.pdf</a> , Orquin & Kurzban 2016
"An opportunity cost model of subjective effort and task performance" <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3856320/" rel="nofollow">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3856320/</a> , Kurzban et al 2013