Adds a energyfunction for HP model