Actually the psyhcology behind pain is far more extensive than the physiology.
It is the prime mover for those in search of satori, for instance. I spent a year in a Japanese soto zen monastery. Every three months the monks go through an ordeal called a zen seshin. For one week you sat in lotus for a total of seventeen hours per day. Lotus cuts off the circulation to the legs. Oxygen starvation results and the pain is like the bends. The last five minutes of each 45 minute seating takes a month to drag by. One is left sitting in a sea of pain tjhroughout the day and half the night for seven days. The psychology is subtle - for it is self-inflicted punishment - one can get up from the tatmi mat, roundly curse the sanga and go home whenever one wishes. Only the stubborn remain seated in the zendo and politely listen to the roshi tell us that we are all shit machines. All I can say is Ouch! Ouch! Nobody got satori that I knew of, but we did end up with the inner rage gone and enjoyed marvelously serene thoughts.
