energy demand calculation