how to use the values of total energy and potential energy in a graph?