Confusion between thermal energy and heat In the past, I usually misunderstood that thermal energy and heat are the same. However, some materials say that thermal energy is the intrinsic value of the system, including potential energy and kinetic energy, just as internal energy. Others say that it is just the average kinetic energy.
So, can anyone please clarify about thermal energy, heat, temperature and internal energy? Thanks a lot.
 A: *

*Thermal energy refers to the energy that a body has because of thermal excitations (e.g. because the individual atoms are moving/rotating/vibrating). Typically the amount is $\frac{1}{2}kT$ per degree of freedom by the equipartition theorem.

*Internal energy is a catch-all term that means "energy that a body has that isn't due to something external". That is, it doesn't include gravitational potential energy (the gravitational field is external), or overall kinetic energy. It includes thermal energy, but can also include other things (like if the system is elastic and is being stretched).

*Heat refers to the transfer of thermal energy between two systems. Sometimes when people are being sloppy they talk about the "amount of heat" a system has, which means its thermal energy.

*You can think of temperature as a measure of the amount of thermal energy a system has (see the first point), or a measure of its willingness to transfer heat to other systems.

A: Expanding on the last point by @KevinZhou, temperature is most properly thought of as the "willingness" of the system to transfer heat.  It is, in fact defined as
$\frac{1}{T} = \frac{\partial S}{\partial E}$
where $S$ is entropy and $E$ is internal energy.  For a system consisting of two objects in thermal contact they will exchange energy such that they maximize the entropy of the system is maximized.  So, if one can lose a little bit of entropy by giving up some energy and the other will increase its entropy by a large amount by taking in that energy then the energy will "flow" so that this happens.  In other words, the system with a large $\partial S/\partial E$ "grabs" the energy from the one with small $\partial S/\partial E$.  That is, energy flows from the one with high $T$ to the one with low $T$.  The great thermal physics textbook by Schroeder makes the analogy that $E$ is "money", $S$ is "happiness" and $T$ is "generosity".  The more generous system gives money to the less generous one to increase the overall happiness.
@KevinZhou says that temperature can be thought of as a measure of the amount of thermal energy.  Most of the time you can get away with this but it isn't technically correct.  We can form a relation between temperature and thermal energy for any system, but this isn't what temperature "is" (similarly $\sum F = ma$ means the sum of forces is equal to $ma$ not that the sum of forces "is" $ma$.  Fundamentally the temperature is a measure of the system's willingness to transfer heat to other systems.
