Pandiculation is the act stretching and stiffening of the trunk and extremities, as when fatigued and drowsy or on waking, often accompanied by yawning. There are three elements to a pandiculation: (1) a voluntary contraction into the muscles, (2) a slow lengthening of the muscles and (3) a complete relaxation of the body.

Much like a pleasant yawn, pandiculation re-sets both muscle length and function at the brain level; it "reminds" our muscles that they don't have to stay stuck in a contracted state. Pandiculation "turns on a light" in the sensory motor system and improves proprioception, which helps one sense their body more accurately. When you contract a muscle tighter than its present contraction rate, the brain (the command center of the muscles) receives strong sensory feedback, which allows it to “refresh” its sensation of the muscles. By slowly lengthening from that initial contraction, the brain can then lengthen the muscle past the point of its former, tighter length and into a new, fuller range. The result is a more relaxed muscle and greater voluntary muscle control and coordination.

More Info: en.wiktionary.org