A human subject experiment was conducted to investigate caffeines effect on appraisal and performance of a mental serial subtraction task. Serial subtraction performance data was collected from three treatment groups: placebo, 200 mg caffeine, and 400 mg caffeine. Data were analyzed by average across treatment group and by challenge and threat task appraisal conditions. A cognitive model of the serial subtraction task was developed and fit to the human performance data. How the models parameters change to fit the data suggest how cognition changes across treatments and due to appraisal. Overall, the cognitive modeling and optimization results suggest that the speed of vocalization is changed the most along with some changes to declarative memory. This approach promises to offer fine-grained knowledge about the effects of moderators on task performance.