Why People Yawn?

An article by Jennifer Viegas, in Discovery News entitles "The Yawn Explained: It Cools Your Brain"

She said if your head is overheated, there's a good chance you'll yawn soon. A new study say's that the primary purpose of yawning is to control brain temperature.
These solves the mysteries of yawning, such as why it's most commonly done just before and after sleeping, why certain diseases lead to excessive yawning, and why breathing through the nose and cooling off the forehead often stop yawning.
"The key yawn instigator appears to be brain temperature.
"Brains are like computers," Andrew Gallup, a researcher in the Department of Biology at Binghamton University who led the study, told Discovery News. "They operate most efficiently when cool, and physical adaptations have evolved to allow maximum cooling of the brain."

http://dsc.discovery.com/news/2008/12/15/yawn-brain-head.html

Gallup and his colleagues Michael Miller and Anne Clark analyzed yawning in parakeets as representative vertebrates because the birds have relatively large brains, live wild in Australia, which is subject to frequent temperature swings, and, most importantly, do not engage in contagious yawning, as humans and some other animals do.
Contagious yawning is thought to be an evolved mechanism for keeping groups alert so they "remain vigilant against danger," Gallup said.

"For instance, yawning should not occur when ambient temperatures exceed body temperature, as taking a deep inhalation of warm air would be counterproductive. In addition, yawning when it is extremely cold may be maladaptive, as this may send unusually cold air to the brain, which may produce a thermal shock."

"If air in the atmosphere is cooler than brain and body temperatures, taking it in quickly cools facial blood that, in turn, cools the brain and may even alter blood flow. Prior studies reveal yawning leads to a heightened state of arousal, so a morning yawn may function somewhat like a cup of coffee in providing a jolt of energy.
"The new findings also explain why tired individuals often yawn, since both exhaustion and sleep deprivation have been shown to increase deep brain temperatures, again prompting a yawn-driven cool down. Yawning additionally appears to facilitate transitional states of the brain, such as going from sleep to waking periods. "
"It is interesting to note that instances of excessive yawning in humans may be indicative of brain cooling problems," Gallup, Jr., told Discovery News, pointing out that patients with multiple sclerosis often experience bouts of excessive yawning "and MS involves thermoregulatory dysfunction."
"Bouts of excessive yawning often precede the onset of seizures in epileptic patients, and predict the onset of headaches in people who suffer from migraines," he added.
In the future, researchers may focus more on brain temperature and its role in diseases and their symptoms. But the new study on yawning changes the popular notion that yawns are mere signs of boredom.
On the contrary, as Gallup said, "yawning more accurately reflects a mechanism that maintains attention, and therefore should be looked at as a compliment!"