https://ftp.iza.org/dp8129.pdf
His models show peak productivity between 5 and 6 hours a day.
In my own experience, I have found productivity more related to sleep and exercise than anything else.
Getting 7 hours good sleep (which means winding down for at least 30 minutes before sleep, a stretching exercise or meditation), and enough exercise every day to get the heart rate up.
If I don’t do this for a couple of days, I can be unproductive from hour 2 after waking! We managed to implement a defect metric in my previous team that worked well, my defects went through the roof after a couple of days of 2 hours sleep.
There is a lot of literature on this correlation, but just thought I would share my own experience.