added energetics.m