In psychology, sublimation is a term coined by Freud which was eventually used to describe the spirit as a reflection of the libido. It has it roots in Freud's psychoanalytical approach, and is sometimes also referred to as a type of defense mechanism.
Sublimation is when displacement "serves a higher cultural or socially useful purpose, as in the creation of art or inventions."
In Freudian psyhoanalytic theory, defence mechanisms are unconscious psychological strategies brought into play by various entities to cope with reality and to maintain self-image. The purpose of ego defense mechanisms is to protect the mind/self/ego from anxiety, social sanctions or to provide a refuge from a situation with which one cannot currently cope.