Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page I am actually trying to develop an algorithm to shift the load demand during on-peak hours using GenOpt. I have had a quick trial testing the example file HookJeeves Algorithm, however I have some doubts in order to achieve my target.

$\min_{J} : C(t) dt$

Where,

$C(t) = [P_{HP} + P_{DHW} +...] * TimeOfUse (t)$

• $C(t)$ : Cost function

• $TimeOf Use(t)$ : on-peak hour tariff prices and off-peak hour tariff prices

• $P_{HP}$: Power associated to a Heat Pump

• $P_{DHW}$ : Power associated to the Domestic Hot Water

and,

• 18C <= Temperature indoor<= 21C

• 45C <= Temperature Domestic Hot Water<= 55C

Therefore, I am not too sure if HookJeeves is the best algorithm to use for this case, and if it is, how can I set the time of use parameter and constraint the temperatures.

edit retag close merge delete

I'm pretty sure your question isn't actually about which algorithm to use (we don't care here...) but how to define your own cost function.

@Julien. Yes indeed. Thanks again

Could you rephrase the question and the title. Like "GenOpt/EnergyPlus-How to write your own cost function" or something

Sort by » oldest newest most voted

You need to define your own cost function. I've personally done it in Python when needed, because that's my language of choice and because there exists some examples of how to do this.

Specifically, here are my recommendations:

• Download and play with ExcalibBEM, which is a Graphical User Interface (GUI) for GenOpt developed by Hydro Quebec. It simplifies the setup quite a lot and comes with an example or two where a custom cost function is defined in Python. It's pretty easy to write your own function.

• For the constraints, one simple way is to set the value of the cost function to infinite (= a very large value) when the constraints aren't satisfied (penalization).

more

1

Adding a penalty or Barrier function is the only way to handle constraints in GenOpt

@Julien, and @GilbertLM thanks very much.Will give a try to ExcalibBEM