Relationship between thermal energy and kinetic energy