Internal energy and changes of states of matter