What you are looking for is relationship that explains how energy relates to emotions and their permanence.
I find the question interesting but malformed. Here is why :
1) If you look at the mind as a mapping mechanism (neural nets a fundamentally that) the inputs are energetically unrelated to the "representational" mirror they on the receiving end. Much like an amplifier, the internal state only reproduces the signal the energy is not carried through directly, it's both useful and necessary far most type of intefacing.
2) There is not actual "mental input" but mental representation. The brain receives the input and as in is assimilated into the neural structure the patterns are interconnected a bit like throwing a fly into a complex pattern of websit gets tangled in till it is fixed. The mind does not get any input per se the input changes the mind.
3) The chemical reactions just happen to be the way we are built same argument should count for a (sufficiently complex) AI software.
4) Neurological responses are basically of four kinds, associative, dissociative and reinforcing or atrophied.
5) There is not just one mind but there are many in one brain each with different capabilities and different representational patterns of functioning.
Emotions are not necessary for a brain, they are an effect of what used to be called the limbic system. We got that from the reptiles, they are not smart compared to mammals but sure as hell have strong emotions. The limbic system covers hippocampus, amygdala, anterior thalamic nuclei,septum, limbic cortex and fornix, which seemingly support a variety of functions including emotion, behavior, long term memory, and olfaction. ( thanks wikipedia). We get fear pleasure reward, sexdrive etc.. all through this subset of the mind. Nothing logic happens here.
How long emotions last has nothing to do with energy or conservation, like any active system the memories can be augmented amplified, reproduced, destroyed. It's a bit like asking if the energy from the photons that hit the CCD of a camera increase the energy of the computer when you upload. They are so unrelated and perversely out of proportion comapred to the power supply the question is much more that of did the probability distribution of the information in the image on the CCD affect the probability distribution of the computer... That definitely yes.
I think in effect your "formula" is flawed because it is limited in argumentative consequence, but none the less good food for thought.