dear patient,
according to ayrveda its called rasa-sheshajeerna.This is well related with the condition of stomach and grahani (
small intestine). The main causes are-irregular food habit,worms,irregularity in sleep and many more other related with other diseases.
See,when we eat the food accumulates in stomach.There snehan process begins. This is very essential if further process is considered.If any problem occurs in snehan,then the amma(improper digested material) is produced.Though this requires a large time span to get activate as a disease,but its a dangerous thing to there as this not only affects the body but mind too. The headache especially in morning due to this rasa-sheshajeerna.
treatment=
1)do complete fasting for 2/3 days;this will anuloma the samana vayu
2)drink only warm water with puffed rice
3)after 3 days then starts the medication like agnitundi rasa, shilajeet mandur, amrutarnava rasa, rasapachak
yoga, drakshasava, dashmularitha, chitrakadi gutika, bhalatak parpati and many more depending on the status of nadi.
Firstly,the main cause should be rectified according to nadi chikitsa(treatment). Then only the perfect treatment is possible. Also the last but not least ,the mental condition is also depends on the normality of stomach conditions and vice-versa. Also you should visit to an expert ayurvedic practitioner so that you will get the through guideline about your health.