Mathematical programming in energy modeling